MCP Agent is a development framework that seamlessly integrates MCP rmcp
tools with LLM async-openai
clients. As a framework, it provides a structured way to build MCP tools by enabling developers to easily leverage the capabilities of large language models. The framework handles the integration of dependent MCP tools and LLM clients, allowing developers to focus on implementing their specific business logic.
- Seamless integration of MCP tools with LLM clients
- Flexible configuration system
- Support for multiple MCP servers
- Configurable LLM parameters
- Simple and intuitive interface
You can install MCP Agent in several ways:
-
Using
cargo add
:cargo add mcp-agent
-
Or add the following to your
Cargo.toml
:# From crates.io mcp-agent = "0.1.0" # Or from GitHub mcp-agent = { git = "https://github.com/CeerDecy/mcp-agent", branch = "main" }
MCP Agent uses a TOML configuration file to manage settings. The configuration file is typically named mcp-agent.toml
. Here's an example configuration:
[mcp_servers.searxng]
command = "uvx"
args = ["mcp-searxng"]
[mcp_servers.searxng.env]
SEARXNG_URL = "https://searxng.example.com"
[mcp_servers.fetch]
command = "uvx"
args = ["mcp-server-fetch", "--ignore-robots-txt"]
[llm]
api_key = "your_api_key"
base_url = "https://api.openai.com/v1/"
model = "gpt-4.1"
-
Dependent MCP Tools Configuration
- Configure the third-party MCP tools that your project depends on
- Each tool can have its own command, arguments, and environment variables
- Support for multiple dependent MCP tools
- These tools will be automatically managed by the framework
-
LLM Configuration
api_key
: API key for the LLM servicebase_url
: Base URL for the LLM APImodel
: Name of the model to use
For detailed usage examples, please refer to the code in the examples
directory. Here's a quick overview of the basic setup:
-
Create configuration file:
cp examples/simple/mcp-agent.toml.template mcp-agent.toml
-
Edit the configuration file with your actual settings
-
Implement your MCP tool using the framework:
use mcp_agent::*; // Your implementation here
For more detailed examples and best practices, please check:
examples/simple/
- Basic usage exampleexamples/advanced/
- Advanced usage patterns
mcp-agent/
├── src/
│ ├── agent/ # Core agent implementation
│ ├── llm/ # LLM client implementation
│ ├── mcp_server/ # MCP server implementation
│ └── lib.rs # Library entry point
├── examples/ # Example code
└── Cargo.toml # Project dependencies
-
Clone the repository:
git clone https://github.com/CeerDecy/mcp-agent.git cd mcp-agent
-
Install dependencies:
cargo build
-
Run tests:
cargo test
Pull requests and issues are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2025 CeerDecy