# MCPAgentAI ๐
[![PyPI](https://img.shields.io/pypi/v/mcpagentai.svg)](https://pypi.org/project/mcpagentai/)
[![Python Versions](https://img.shields.io/pypi/pyversions/mcpagentai.svg)](https://pypi.org/project/mcpagentai/)
[![License](https://img.shields.io/pypi/l/mcpagentai.svg)](https://github.com/mcpagents-ai/mcpagentai/blob/main/LICENSE)
**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.
### Key Features
- ๐ง **Standardized Wrapping**: Provides an abstraction layer for building tools using the MCP protocol.
- ๐ **Flexible Use Cases**: Easily add or remove tools to fit your specific requirements.
- โจ **Out-of-the-Box Tools**: Includes pre-built tools for common scenarios:
- ๐ฆ **Twitter Management**: Automate tweeting, replying, and managing Twitter interactions.
- ๐ธ Crypto: Get the latest cryptocurrency prices.
- ๐ค [ElizaOS](https://github.com/elizaos/eliza) Integration: Seamlessly connect and interact with ElizaOS for enhanced automation.
- ๐ Time utilities
- โ๏ธ Weather information (API)
- ๐ Dictionary lookups
- ๐งฎ Calculator for mathematical expressions
- ๐ต Currency exchange (API)
- ๐ Stocks Data: Access real-time and historical stock market information.
- [WIP] ๐ฐ News: Retrieve the latest news headlines.
### Tech Stack ๐ ๏ธ
- **Python**: Core programming language
- **[MCP](https://pypi.org/project/mcp/) Framework**: Communication protocol
- **Docker**: Containerization
#### ๐ค What is MCP?
The **Model Context Protocol ([MCP](https://modelcontextprotocol.io/introduction))** 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:
- ๐งฉ **Standardization**: MCP defines how context can be shared across models, enabling **interoperability**.
- โก **Scalability**: Itโs built to handle large-scale AI systems with high throughput.
- ๐ **Security**: Robust authentication and fine-grained access control.
- ๐ **Flexibility**: Works across diverse systems and AI architectures.
![mcp_architecture](https://imageio.forbes.com/specials-images/imageserve/674aaa6ac3007d55b62fc2bf/MCP-Architecture/960x0.png?height=559&width=711&fit=bounds)
[source](https://www.forbes.com/sites/janakirammsv/2024/11/30/why-anthropics-model-context-protocol-is-a-big-step-in-the-evolution-of-ai-agents/)
---
## Installation ๐ฆ
### Install via PyPI
```bash
pip install mcpagentai
```
---
## Usage ๐ป
### Run Locally
```bash
mcpagentai --local-timezone "America/New_York"
```
### Run in Docker
1. **Build the Docker image:**
`docker build -t mcpagentai .`
2. **Run the container:**
`docker run -i --rm mcpagentai`
---
## Twitter Integration ๐ฆ
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`.
### Docker Environment Variables for Twitter Integration
When running MCPAgentAI within Docker, it's essential to configure environment variables for Twitter integration. These variables are divided into two categories:
#### 1. Agent Node Client Credentials
These credentials are used by the **Node.js client** within the agent for managing Twitter interactions.
```dockerfile
ENV TWITTER_USERNAME=
ENV TWITTER_PASSWORD=
ENV TWITTER_EMAIL=
```
#### 2. Tweepy (Twitter API v2) Credentials
These credentials are utilized by **Tweepy** for interacting with Twitter's API v2.
```dockerfile
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=
```
### Running MCPAgentAI with Docker
1. **Build the Docker image:**
```bash
docker build -t mcpagentai .
```
2. **Run the container:**
```bash
docker run -i --rm mcpagentai
```
### Running MCPAgentAI with `.env` + `scripts/run_agent.sh`
#### Setting Up Environment Variables
Create a `.env` file in the root directory of your project and add the following environment variables:
```dotenv
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
```
#### Running the Agent
1. **Make the script executable:**
```bash
chmod +x scripts/run_agent.sh
```
2. **Run the agent:**
```bash
bash scripts/run_agent.sh
```
### Summary
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.
---
## ElizaOS Integration ๐ค
[MCPAgentAI](https://github.com/mcpagents-ai/mcpagentai) offers seamless integration with [ElizaOS](https://github.com/elizaos/eliza), providing enhanced automation capabilities through Eliza Agents. There are two primary ways to integrate Eliza Agents:
### **1. Directly Use Eliza Agents from mcpagentai**
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:**
1. **Configure MCPAgentAI to Use Eliza MCP Agent:**
In your Python code, add Eliza MCP Agent to the `MultiToolAgent`:
```python
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:**
- **Simplified Setup:** No need to manage separate background processes.
- **Easier Monitoring:** All functionalities are encapsulated within MCPAgentAI.
- **Highlight Feature:** Emphasizes the flexibility of MCPAgentAI in integrating various tools seamlessly.
### **2. Run Eliza Framework from mcpagentai**
This method involves running the Eliza Framework as a separate background process alongside MCPAgentAI.
**Steps:**
1. **Start Eliza Framework:**
`bash src/mcpagentai/tools/eliza/scripts/run.sh`
2. **Monitor Eliza Processes:**
`bash src/mcpagentai/tools/eliza/scripts/monitor.sh`
3. **Configure MCPAgentAI to Use Eliza Agent:**
In your Python code, add Eliza Agent to the `MultiToolAgent`:
```python
from mcpagentai.core.multi_tool_agent import MultiToolAgent
from mcpagentai.tools.eliza_agent import eliza_agent
multi_tool_agent = MultiToolAgent([
# ... other agents
eliza_agent
])
```
---
## Tutorial: Selecting Specific Tools
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:
```python
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.
```
---
## Integration Example: Claude Desktop Configuration
You can integrate MCPAgentAI with Claude Desktop using the following configuration (`claude_desktop_config.json`), **note that** local ElizaOS repo is optional arg:
```json
{
"mcpServers": {
"mcpagentai": {
"command": "docker",
"args": ["run", "-i", "-v", "/path/to/local/eliza:/app/eliza", "--rm", "mcpagentai"]
}
}
}
```
---
## Development ๐ ๏ธ
1. **Clone this repository:**
```bash
git clone https://github.com/mcpagents-ai/mcpagentai.git
cd mcpagentai
```
2. **(Optional) Create a virtual environment:**
```bash
python3 -m venv .venv
source .venv/bin/activate
```
3. **Install dependencies:**
```bash
pip install -e .
```
4. **Build the package:**
```bash
python -m build
```
---
## Contributing ๐ค
We welcome contributions! Please open an [issue](https://github.com/mcpagents-ai/mcpagentai/issues) or [pull request](https://github.com/mcpagents-ai/mcpagentai/pulls).
---
**License**: MIT
Enjoy! ๐
Raw data
{
"_id": null,
"home_page": null,
"name": "mcpagentai",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "LLM, agent, aiagent, calculator, currency, dictionary, mcp, time, twitter, weather",
"author": null,
"author_email": "MCPAgentAIDev <dev@mcpagentai.com>",
"download_url": "https://files.pythonhosted.org/packages/a9/07/0d36530110ee86ed465b4c087945baa074c4bdc8f2711d891933e284cf37/mcpagentai-1.0.0.tar.gz",
"platform": null,
"description": "\n# MCPAgentAI \ud83d\ude80 \n\n[![PyPI](https://img.shields.io/pypi/v/mcpagentai.svg)](https://pypi.org/project/mcpagentai/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/mcpagentai.svg)](https://pypi.org/project/mcpagentai/)\n[![License](https://img.shields.io/pypi/l/mcpagentai.svg)](https://github.com/mcpagents-ai/mcpagentai/blob/main/LICENSE)\n\n**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.\n\n### Key Features\n- \ud83d\udd27 **Standardized Wrapping**: Provides an abstraction layer for building tools using the MCP protocol.\n- \ud83d\ude80 **Flexible Use Cases**: Easily add or remove tools to fit your specific requirements.\n- \u2728 **Out-of-the-Box Tools**: Includes pre-built tools for common scenarios:\n - \ud83d\udc26 **Twitter Management**: Automate tweeting, replying, and managing Twitter interactions.\n - \ud83d\udcb8 Crypto: Get the latest cryptocurrency prices.\n - \ud83e\udd16 [ElizaOS](https://github.com/elizaos/eliza) Integration: Seamlessly connect and interact with ElizaOS for enhanced automation.\n - \ud83d\udd51 Time utilities\n - \u2601\ufe0f Weather information (API)\n - \ud83d\udcda Dictionary lookups\n - \ud83e\uddee Calculator for mathematical expressions\n - \ud83d\udcb5 Currency exchange (API)\n - \ud83d\udcc8 Stocks Data: Access real-time and historical stock market information.\n - [WIP] \ud83d\udcf0 News: Retrieve the latest news headlines.\n\n### Tech Stack \ud83d\udee0\ufe0f\n- **Python**: Core programming language\n- **[MCP](https://pypi.org/project/mcp/) Framework**: Communication protocol\n- **Docker**: Containerization\n\n#### \ud83e\udd14 What is MCP?\n\nThe **Model Context Protocol ([MCP](https://modelcontextprotocol.io/introduction))** 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. \ud83e\udde0\u2728\n\nHere\u2019s why **MCP** matters:\n\n- \ud83e\udde9 **Standardization**: MCP defines how context can be shared across models, enabling **interoperability**.\n- \u26a1 **Scalability**: It\u2019s built to handle large-scale AI systems with high throughput.\n- \ud83d\udd12 **Security**: Robust authentication and fine-grained access control.\n- \ud83c\udf10 **Flexibility**: Works across diverse systems and AI architectures.\n\n![mcp_architecture](https://imageio.forbes.com/specials-images/imageserve/674aaa6ac3007d55b62fc2bf/MCP-Architecture/960x0.png?height=559&width=711&fit=bounds)\n[source](https://www.forbes.com/sites/janakirammsv/2024/11/30/why-anthropics-model-context-protocol-is-a-big-step-in-the-evolution-of-ai-agents/)\n---\n\n## Installation \ud83d\udce6\n\n### Install via PyPI\n```bash\npip install mcpagentai\n```\n\n---\n\n## Usage \ud83d\udcbb\n\n### Run Locally\n```bash\nmcpagentai --local-timezone \"America/New_York\"\n```\n\n### Run in Docker\n1. **Build the Docker image:**\n `docker build -t mcpagentai .`\n\n2. **Run the container:**\n `docker run -i --rm mcpagentai`\n\n---\n\n## Twitter Integration \ud83d\udc26\n\nMCPAgentAI 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`.\n\n### Docker Environment Variables for Twitter Integration\n\nWhen running MCPAgentAI within Docker, it's essential to configure environment variables for Twitter integration. These variables are divided into two categories:\n\n#### 1. Agent Node Client Credentials\nThese credentials are used by the **Node.js client** within the agent for managing Twitter interactions.\n\n```dockerfile\nENV TWITTER_USERNAME=\nENV TWITTER_PASSWORD=\nENV TWITTER_EMAIL=\n```\n\n#### 2. Tweepy (Twitter API v2) Credentials\nThese credentials are utilized by **Tweepy** for interacting with Twitter's API v2.\n\n```dockerfile\nENV TWITTER_API_KEY=\nENV TWITTER_API_SECRET=\nENV TWITTER_ACCESS_TOKEN=\nENV TWITTER_ACCESS_SECRET=\nENV TWITTER_CLIENT_ID=\nENV TWITTER_CLIENT_SECRET=\nENV TWITTER_BEARER_TOKEN=\n```\n\n### Running MCPAgentAI with Docker\n\n1. **Build the Docker image:**\n ```bash\n docker build -t mcpagentai .\n ```\n\n2. **Run the container:**\n ```bash\n docker run -i --rm mcpagentai\n ```\n\n### Running MCPAgentAI with `.env` + `scripts/run_agent.sh`\n\n#### Setting Up Environment Variables\n\nCreate a `.env` file in the root directory of your project and add the following environment variables:\n\n```dotenv\nANTHROPIC_API_KEY=your_anthropic_api_key\nELIZA_PATH=/path/to/eliza\nTWITTER_USERNAME=your_twitter_username\nTWITTER_EMAIL=your_twitter_email\nTWITTER_PASSWORD=your_twitter_password\nPERSONALITY_CONFIG=/path/to/personality_config.json\nRUN_AGENT=True\n\n# Tweepy (Twitter API v2) Credentials\nTWITTER_API_KEY=your_twitter_api_key\nTWITTER_API_SECRET=your_twitter_api_secret\nTWITTER_ACCESS_TOKEN=your_twitter_access_token\nTWITTER_ACCESS_SECRET=your_twitter_access_secret\nTWITTER_CLIENT_ID=your_twitter_client_id\nTWITTER_CLIENT_SECRET=your_twitter_client_secret\nTWITTER_BEARER_TOKEN=your_twitter_bearer_token\n```\n\n#### Running the Agent\n\n1. **Make the script executable:**\n ```bash\n chmod +x scripts/run_agent.sh\n ```\n\n2. **Run the agent:**\n ```bash\n bash scripts/run_agent.sh\n ```\n\n\n### Summary\nYou 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.\n\nThis flexibility allows you to choose the method that best fits your deployment environment.\n\n---\n\n## ElizaOS Integration \ud83e\udd16\n\n[MCPAgentAI](https://github.com/mcpagents-ai/mcpagentai) offers seamless integration with [ElizaOS](https://github.com/elizaos/eliza), providing enhanced automation capabilities through Eliza Agents. There are two primary ways to integrate Eliza Agents:\n\n### **1. Directly Use Eliza Agents from mcpagentai**\nThis 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.\n\n**Steps:**\n\n1. **Configure MCPAgentAI to Use Eliza MCP Agent:**\n In your Python code, add Eliza MCP Agent to the `MultiToolAgent`:\n ```python\n from mcpagentai.core.multi_tool_agent import MultiToolAgent\n from mcpagentai.tools.eliza_mcp_agent import eliza_mcp_agent\n\n multi_tool_agent = MultiToolAgent([\n # ... other agents\n eliza_mcp_agent\n ])\n ```\n\n**Advantages:**\n- **Simplified Setup:** No need to manage separate background processes.\n- **Easier Monitoring:** All functionalities are encapsulated within MCPAgentAI.\n- **Highlight Feature:** Emphasizes the flexibility of MCPAgentAI in integrating various tools seamlessly.\n\n\n### **2. Run Eliza Framework from mcpagentai**\nThis method involves running the Eliza Framework as a separate background process alongside MCPAgentAI.\n\n**Steps:**\n\n1. **Start Eliza Framework:**\n `bash src/mcpagentai/tools/eliza/scripts/run.sh`\n\n2. **Monitor Eliza Processes:**\n `bash src/mcpagentai/tools/eliza/scripts/monitor.sh`\n\n3. **Configure MCPAgentAI to Use Eliza Agent:**\n In your Python code, add Eliza Agent to the `MultiToolAgent`:\n ```python\n from mcpagentai.core.multi_tool_agent import MultiToolAgent\n from mcpagentai.tools.eliza_agent import eliza_agent\n\n multi_tool_agent = MultiToolAgent([\n # ... other agents\n eliza_agent\n ])\n ```\n---\n\n## Tutorial: Selecting Specific Tools\n\nYou 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:\n\n```python\nfrom mcpagentai.tools.time_agent import TimeAgent\nfrom mcpagentai.tools.weather_agent import WeatherAgent\nfrom mcpagentai.core.multi_tool_agent import MultiToolAgent\n\nmulti_tool_agent = MultiToolAgent([\n TimeAgent(),\n WeatherAgent()\n])\nThis setup will only enable **Time** and **Weather** tools.\n```\n---\n\n## Integration Example: Claude Desktop Configuration\n\nYou can integrate MCPAgentAI with Claude Desktop using the following configuration (`claude_desktop_config.json`), **note that** local ElizaOS repo is optional arg:\n```json\n{\n \"mcpServers\": {\n \"mcpagentai\": {\n \"command\": \"docker\",\n \"args\": [\"run\", \"-i\", \"-v\", \"/path/to/local/eliza:/app/eliza\", \"--rm\", \"mcpagentai\"]\n }\n }\n}\n```\n---\n\n## Development \ud83d\udee0\ufe0f\n\n1. **Clone this repository:**\n ```bash\n git clone https://github.com/mcpagents-ai/mcpagentai.git\n cd mcpagentai\n ```\n\n2. **(Optional) Create a virtual environment:**\n ```bash\n python3 -m venv .venv\n source .venv/bin/activate\n ```\n\n3. **Install dependencies:**\n ```bash\n pip install -e .\n ```\n\n4. **Build the package:**\n ```bash\n python -m build\n ```\n---\n\n## Contributing \ud83e\udd1d\n\nWe welcome contributions! Please open an [issue](https://github.com/mcpagents-ai/mcpagentai/issues) or [pull request](https://github.com/mcpagents-ai/mcpagentai/pulls).\n\n---\n\n**License**: MIT \nEnjoy! \ud83c\udf89\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A generic multi-tool MCP Agent with Twitter, Eliza, Weather, Dictionary, Calculator, etc.",
"version": "1.0.0",
"project_urls": null,
"split_keywords": [
"llm",
" agent",
" aiagent",
" calculator",
" currency",
" dictionary",
" mcp",
" time",
" twitter",
" weather"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "83d0b2fcf07b0b475a1895cc210329df7b39329ae6ef586834ea6abd54367a23",
"md5": "56eb1440b4665e98c8b685c812a47c8c",
"sha256": "7896dd6d8f11eac3b224e6809e6c0d8a9d8f612e6f1ffe9f5dc715aaf541bb89"
},
"downloads": -1,
"filename": "mcpagentai-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "56eb1440b4665e98c8b685c812a47c8c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 51250,
"upload_time": "2025-01-15T01:15:17",
"upload_time_iso_8601": "2025-01-15T01:15:17.233058Z",
"url": "https://files.pythonhosted.org/packages/83/d0/b2fcf07b0b475a1895cc210329df7b39329ae6ef586834ea6abd54367a23/mcpagentai-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a9070d36530110ee86ed465b4c087945baa074c4bdc8f2711d891933e284cf37",
"md5": "f54c8105f760768dfd048da9444400a0",
"sha256": "f296d0e3a74dad5480e389b3f5834f313fd88f12c47b4184fe0eda14805f2a2e"
},
"downloads": -1,
"filename": "mcpagentai-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "f54c8105f760768dfd048da9444400a0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 56548,
"upload_time": "2025-01-15T01:15:19",
"upload_time_iso_8601": "2025-01-15T01:15:19.950741Z",
"url": "https://files.pythonhosted.org/packages/a9/07/0d36530110ee86ed465b4c087945baa074c4bdc8f2711d891933e284cf37/mcpagentai-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-15 01:15:19",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "mcpagentai"
}