Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
"cld",
"co",
"hf",
"mcp",
"cli,mcp",
"hf,mcp",
"oai,mcp",
"hf,net",
"cli,hf",
"cli,gem",
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
"cld",
"co",
"hf",
"mcp",
"cli,mcp",
"hf,mcp",
"oai,mcp",
"hf,net",
"cli,hf",
"cli,gem",
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,6 @@ When activated by ManagerGPT, OptimizerGPT will:
- Apply standard conventions and folder structures depending on the tech stack (React, FastAPI, etc.).
- Refactor duplicated or redundant code into reusable functions or components.

With Autogpt's team of specialized agents working together, your project is in capable hands. Simply provide a simple project goal, and let Autogpt handle the rest!
With Autogpt's team of specialized agents working together, your project is in capable hands. All agents support the **Model Context Protocol (MCP)**, allowing you to extend their capabilities with thousands of external tools. Simply provide a simple project goal, and let Autogpt handle the rest!

---
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ To install AutoGPT CLI via Cargo, execute the following command:
cargo install autogpt --all-features
```

To install with specific features (e.g., MoP and Gemini):
To install with specific features (e.g., MoP, Gemini, and MCP):

```sh
cargo install autogpt --features "cli,gem,mop"
cargo install autogpt --features "cli,gem,mop,mcp"
```

### 🐳 Using Docker
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ AutoGPT agents are modular and autonomous, built from composable components:
- 🧑‍🤝‍🧑 **Collaboration**: Agents can delegate, swarm, or work in teams with other agents.
- 🪞 **Self-Reflection**: Introspection module to debug, adapt, or evolve internal strategies.
- 🔄 **Context Management**: Manages active memory (context window) for ongoing tasks and conversations.
- 🔌 **MCP (Model Context Protocol)**: Seamlessly connect to external tool servers (Stdio, SSE, HTTP) to extend agent capabilities with thousands of existing tools.
- 📅 **Scheduler**: Time-based or reactive triggers for agent actions.

### 🚀 Developer Features
Expand All @@ -63,6 +64,7 @@ AutoGPT is designed for flexibility, integration, and scalability:

- 🧪 **Custom Agent Creation**: Build tailored agents for different roles or domains.
- 📋 **Task Orchestration**: Manage and distribute tasks across agents efficiently.
- 🔌 **MCP Integration**: First-class support for the Model Context Protocol to unify tool access.
- 🧱 **Extensibility**: Add new tools, behaviors, or agent types with ease.
- 💻 **CLI Tools**: Command-line interface for rapid experimentation and control.
- 🧰 **SDK Support**: Embed AutoGPT into existing projects or systems seamlessly.
Expand Down
10 changes: 10 additions & 0 deletions auto-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ pub fn derive_agent(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
fn context_mut(&mut self) -> &mut ContextManager {
&mut self.agent.context
}

#[cfg(feature = "mcp")]
fn mcp_servers(&self) -> &[::autogpt::mcp::settings::McpServerConfig] {
&self.agent.mcp_servers
}

#[cfg(feature = "mcp")]
fn mcp_servers_mut(&mut self) -> &mut Vec<::autogpt::mcp::settings::McpServerConfig> {
&mut self.agent.mcp_servers
}
}

impl Functions for #name {
Expand Down
6 changes: 5 additions & 1 deletion autogpt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ iac-rs = { workspace = true, optional = true }

uuid = { version = "=1.23.1", features = ["v4"] }
tokio = { version = "=1.52.2", default-features = false, features = ["full"] }
reqwest = { version = "^0.12.24", features = ["json", "stream"] }
reqwest = { version = "^0.12.24", features = ["json", "stream", "blocking"] }
serde = { version = "1.0.228", features = ["derive"] }
gems = { version = "0.1.5", optional = true }
getimg = { version = "0.0.1", optional = true }
Expand Down Expand Up @@ -100,10 +100,14 @@ cli = [
"tracing-appender",
"tracing-subscriber",
]
mcp = ["dirs"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[badges]
maintenance = { status = "actively-developed" }

[dev-dependencies]
tempfile = "3"
59 changes: 59 additions & 0 deletions autogpt/src/agents/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use crate::common::utils::{
Capability, ContextManager, Knowledge, Message, Persona, Planner, Reflection, Status, Task,
TaskScheduler, Tool, default_eval_fn,
};
#[cfg(feature = "mcp")]
use crate::mcp::settings::McpServerConfig;
use crate::traits::agent::Agent;
use derivative::Derivative;
use std::borrow::Cow;
Expand Down Expand Up @@ -129,6 +131,13 @@ pub struct AgentGPT {
/// Round-robin index used to evenly distribute workload among peers.
#[cfg(feature = "net")]
pub rr_idx: usize,

/// MCP server configurations attached to this agent.
///
/// When populated the agent can connect to these servers and use their tools
/// as part of its tool-use loop. Each entry is keyed by the server name.
#[cfg(feature = "mcp")]
pub mcp_servers: Vec<McpServerConfig>,
}

impl Default for AgentGPT {
Expand Down Expand Up @@ -177,6 +186,8 @@ impl Default for AgentGPT {
cap_index: HashMap::new(),
#[cfg(feature = "net")]
rr_idx: 0,
#[cfg(feature = "mcp")]
mcp_servers: vec![],
}
}
}
Expand All @@ -187,6 +198,38 @@ impl AgentGPT {
self.memory.push(message);
}

/// Attaches an MCP server configuration to this agent (builder-style).
///
/// # Example
///
/// ```rust
/// use autogpt::agents::agent::AgentGPT;
/// use autogpt::cli::settings::{McpServerConfig, McpTransport};
/// use std::collections::HashMap;
///
/// let mut agent = AgentGPT::new_borrowed("MyAgent", "Do research");
/// agent.with_mcp_server(McpServerConfig {
/// name: "github".to_string(), transport: McpTransport::Stdio,
/// command: Some("docker".to_string()),
/// args: vec!["run".into(), "-i".into(), "ghcr.io/github/github-mcp-server".into()],
/// url: None, http_url: None, headers: HashMap::new(), env: HashMap::new(),
/// cwd: None, timeout_ms: 500_000, trust: false,
/// include_tools: vec![], exclude_tools: vec![],
/// description: None, oauth: None,
/// });
/// ```
#[cfg(feature = "mcp")]
pub fn with_mcp_server(&mut self, config: McpServerConfig) -> &mut Self {
self.mcp_servers.push(config);
self
}

/// Returns the MCP server configurations attached to this agent.
#[cfg(feature = "mcp")]
pub fn mcp_servers(&self) -> &[McpServerConfig] {
&self.mcp_servers
}

/// Creates a new instance of `AgentGPT` with owned strings.
///
/// # Arguments
Expand Down Expand Up @@ -257,6 +300,8 @@ impl AgentGPT {
cap_index: HashMap::new(),
#[cfg(feature = "net")]
rr_idx: 0,
#[cfg(feature = "mcp")]
mcp_servers: vec![],
}
}

Expand Down Expand Up @@ -330,6 +375,8 @@ impl AgentGPT {
cap_index: HashMap::new(),
#[cfg(feature = "net")]
rr_idx: 0,
#[cfg(feature = "mcp")]
mcp_servers: vec![],
}
}

Expand Down Expand Up @@ -461,6 +508,8 @@ impl Agent for AgentGPT {
cap_index: HashMap::new(),
#[cfg(feature = "net")]
rr_idx: 0,
#[cfg(feature = "mcp")]
mcp_servers: vec![],
}
}

Expand Down Expand Up @@ -554,6 +603,16 @@ impl Agent for AgentGPT {
fn context_mut(&mut self) -> &mut ContextManager {
&mut self.context
}

#[cfg(feature = "mcp")]
fn mcp_servers(&self) -> &[crate::mcp::settings::McpServerConfig] {
&self.mcp_servers
}

#[cfg(feature = "mcp")]
fn mcp_servers_mut(&mut self) -> &mut Vec<crate::mcp::settings::McpServerConfig> {
&mut self.mcp_servers
}
}

#[cfg(feature = "net")]
Expand Down
Loading
Loading