MCPAgentAI is a standardized tool wrapping framework for implementing and managing diverse tools in a unified way. It is designed to help developers quickly integrate and launch tool-based use cases.
The Model Context Protocol (MCP) is a cutting-edge standard for context sharing and management across AI models and systems. Think of it as the language AI agents use to interact seamlessly. 🧠✨
Here’s why MCP matters:
pip install mcpagentai
mcpagentai --local-timezone "America/New_York"
Build the Docker image:
docker build -t mcpagentai .
Run the container:
docker run -i --rm mcpagentai
MCPAgentAI offers robust Twitter integration, allowing you to automate tweeting, replying, and managing Twitter interactions. This section provides detailed instructions on configuring and using the Twitter integration, both via Docker and .env
+ scripts/run_agent.sh
.
When running MCPAgentAI within Docker, it's essential to configure environment variables for Twitter integration. These variables are divided into two categories:
These credentials are used by the Node.js client within the agent for managing Twitter interactions.
ENV TWITTER_USERNAME=
ENV TWITTER_PASSWORD=
ENV TWITTER_EMAIL=
These credentials are utilized by Tweepy for interacting with Twitter's API v2.
ENV TWITTER_API_KEY=
ENV TWITTER_API_SECRET=
ENV TWITTER_ACCESS_TOKEN=
ENV TWITTER_ACCESS_SECRET=
ENV TWITTER_CLIENT_ID=
ENV TWITTER_CLIENT_SECRET=
ENV TWITTER_BEARER_TOKEN=
Build the Docker image:
docker build -t mcpagentai .
Run the container:
docker run -i --rm mcpagentai
.env
+ scripts/run_agent.sh
Create a .env
file in the root directory of your project and add the following environment variables:
ANTHROPIC_API_KEY=your_anthropic_api_key
ELIZA_PATH=/path/to/eliza
TWITTER_USERNAME=your_twitter_username
TWITTER_EMAIL=your_twitter_email
TWITTER_PASSWORD=your_twitter_password
PERSONALITY_CONFIG=/path/to/personality_config.json
RUN_AGENT=True
# Tweepy (Twitter API v2) Credentials
TWITTER_API_KEY=your_twitter_api_key
TWITTER_API_SECRET=your_twitter_api_secret
TWITTER_ACCESS_TOKEN=your_twitter_access_token
TWITTER_ACCESS_SECRET=your_twitter_access_secret
TWITTER_CLIENT_ID=your_twitter_client_id
TWITTER_CLIENT_SECRET=your_twitter_client_secret
TWITTER_BEARER_TOKEN=your_twitter_bearer_token
Make the script executable:
chmod +x scripts/run_agent.sh
Run the agent:
bash scripts/run_agent.sh
You can configure MCPAgentAI to run with Twitter integration either using Docker or by setting up environment variables in a .env
file and running the scripts/run_agent.sh
script.
This flexibility allows you to choose the method that best fits your deployment environment.
MCPAgentAI offers seamless integration with ElizaOS, providing enhanced automation capabilities through Eliza Agents. There are two primary ways to integrate Eliza Agents:
This approach allows you to use Eliza Agents without running the Eliza Framework in the background. It simplifies the setup by embedding Eliza functionality directly within MCPAgentAI.
Steps:
MultiToolAgent
:
from mcpagentai.core.multi_tool_agent import MultiToolAgent
from mcpagentai.tools.eliza_mcp_agent import eliza_mcp_agent
multi_tool_agent = MultiToolAgent([
# ... other agents
eliza_mcp_agent
])
Advantages:
This method involves running the Eliza Framework as a separate background process alongside MCPAgentAI.
Steps:
Start Eliza Framework:
bash src/mcpagentai/tools/eliza/scripts/run.sh
Monitor Eliza Processes:
bash src/mcpagentai/tools/eliza/scripts/monitor.sh
Configure MCPAgentAI to Use Eliza Agent:
In your Python code, add Eliza Agent to the MultiToolAgent
:
from mcpagentai.core.multi_tool_agent import MultiToolAgent
from mcpagentai.tools.eliza_agent import eliza_agent
multi_tool_agent = MultiToolAgent([
# ... other agents
eliza_agent
])
You can configure MCPAgentAI to run only certain tools by modifying the agent configuration in your server or by updating the server.py
file to only load desired agents. For example:
from mcpagentai.tools.time_agent import TimeAgent
from mcpagentai.tools.weather_agent import WeatherAgent
from mcpagentai.core.multi_tool_agent import MultiToolAgent
multi_tool_agent = MultiToolAgent([
TimeAgent(),
WeatherAgent()
])
This setup will only enable **Time** and **Weather** tools.
You can integrate MCPAgentAI with Claude Desktop using the following configuration (claude_desktop_config.json
), note that local ElizaOS repo is optional arg:
{
"mcpServers": {
"mcpagentai": {
"command": "docker",
"args": ["run", "-i", "-v", "/path/to/local/eliza:/app/eliza", "--rm", "mcpagentai"]
}
}
}
Clone this repository:
git clone https://github.com/mcpagents-ai/mcpagentai.git
cd mcpagentai
(Optional) Create a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
Install dependencies:
pip install -e .
Build the package:
python -m build
We welcome contributions! Please open an issue or pull request.
License: MIT
Enjoy! 🎉
{
"mcpServers": {
"mcpagentai": {
"env": {},
"args": [
"run",
"-i",
"-v",
"/path/to/local/eliza:/app/eliza",
"--rm",
"mcpagentai"
],
"command": "docker"
}
}
}
Seamless access to top MCP servers powering the future of AI integration.