Metadata-Version: 2.4
Name: iflow-mcp_satyamsingh8306-mcp_arena
Version: 0.2.3
Summary: An opinionated Python library for building MCP (Model Context Protocol) servers with presets, agents, and tools.
Project-URL: Homepage, https://github.com/SatyamSingh8306/mcp_arena
Project-URL: Repository, https://github.com/SatyamSingh8306/mcp_arena
Project-URL: Issues, https://github.com/SatyamSingh8306/mcp_arena/issues
Author-email: Satyam Singh <satyamsingh7734@gmail.com>
License: MIT
License-File: LICENSE
Keywords: agents,ai,llm,mcp,model-context-protocol
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.11
Requires-Dist: atlassian-python-api>=4.0.7
Requires-Dist: boto3>=1.42.15
Requires-Dist: chromadb<2.0,>=1.3.5
Requires-Dist: docker>=7.1.0
Requires-Dist: google-api-python-client<3.0,>=2.130
Requires-Dist: google-auth-httplib2<1.0,>=0.1.0
Requires-Dist: google-auth-oauthlib<2.0,>=1.2
Requires-Dist: google-auth<3.0,>=2.29
Requires-Dist: html2text>=2025.4.15
Requires-Dist: langchain-chroma<2.0,>=1.1
Requires-Dist: langchain-community<1.0,>=0.4
Requires-Dist: langchain-core<2.0,>=1.2
Requires-Dist: langchain-groq>=1.1.1
Requires-Dist: langchain-huggingface<2.0,>=1.2
Requires-Dist: langchain-mcp-adapters>=0.2.1
Requires-Dist: langchain-openai<2.0,>=1.1
Requires-Dist: langchain<2.0,>=1.2
Requires-Dist: mcp<2.0,>=1.25
Requires-Dist: msal<2.0,>=1.28
Requires-Dist: notion-client>=2.7.0
Requires-Dist: psutil<8.0,>=7.2
Requires-Dist: psycopg2-binary>=2.9.11
Requires-Dist: pyautogui>=0.9.54
Requires-Dist: pygithub<3.0,>=2.8
Requires-Dist: pymongo>=4.15.5
Requires-Dist: python-dotenv<2.0,>=1.0
Requires-Dist: python-gitlab>=7.0.0
Requires-Dist: redis>=7.1.0
Requires-Dist: requests<3.0,>=2.31
Requires-Dist: rich>=13.0.0
Requires-Dist: sentence-transformers<6.0,>=5.2
Requires-Dist: slack-sdk<4.0,>=3.27
Requires-Dist: twilio<10.0,>=9.0
Requires-Dist: typer>=0.9.0
Requires-Dist: typing-extensions<5.0,>=4.8
Provides-Extra: agents
Requires-Dist: langchain-agent<1.0,>=0.1; extra == 'agents'
Requires-Dist: langchain-groq<2.0,>=1.0; extra == 'agents'
Requires-Dist: langchain-mcp-adapters<1.0,>=0.1; extra == 'agents'
Provides-Extra: all
Requires-Dist: atlassian-python-api<5.0,>=4.0; extra == 'all'
Requires-Dist: chromadb<2.0,>=1.3.5; extra == 'all'
Requires-Dist: docker<8.0,>=7.1; extra == 'all'
Requires-Dist: google-api-python-client<3.0,>=2.130; extra == 'all'
Requires-Dist: google-auth-httplib2<1.0,>=0.1.0; extra == 'all'
Requires-Dist: google-auth-oauthlib<2.0,>=1.2; extra == 'all'
Requires-Dist: google-auth<3.0,>=2.29; extra == 'all'
Requires-Dist: kubernetes<35.0,>=28.1; extra == 'all'
Requires-Dist: langchain-agent<1.0,>=0.1; extra == 'all'
Requires-Dist: langchain-groq<2.0,>=1.0; extra == 'all'
Requires-Dist: langchain-mcp-adapters<1.0,>=0.1; extra == 'all'
Requires-Dist: msal<2.0,>=1.28; extra == 'all'
Requires-Dist: psutil<8.0,>=7.2; extra == 'all'
Requires-Dist: psycopg2-binary<3.0,>=2.9; extra == 'all'
Requires-Dist: pyautogui<1.0,>=0.9; extra == 'all'
Requires-Dist: pygithub<3.0,>=2.8; extra == 'all'
Requires-Dist: pymongo<5.0,>=4.6; extra == 'all'
Requires-Dist: python-gitlab<8.0,>=7.0; extra == 'all'
Requires-Dist: redis<8.0,>=5.0; extra == 'all'
Requires-Dist: sentence-transformers<6.0,>=5.2; extra == 'all'
Requires-Dist: slack-sdk<4.0,>=3.27; extra == 'all'
Requires-Dist: twilio<10.0,>=9.0; extra == 'all'
Provides-Extra: bitbucket
Requires-Dist: atlassian-python-api<5.0,>=4.0; extra == 'bitbucket'
Provides-Extra: communication
Requires-Dist: google-api-python-client<3.0,>=2.130; extra == 'communication'
Requires-Dist: google-auth-httplib2<1.0,>=0.1.0; extra == 'communication'
Requires-Dist: google-auth-oauthlib<2.0,>=1.2; extra == 'communication'
Requires-Dist: google-auth<3.0,>=2.29; extra == 'communication'
Requires-Dist: msal<2.0,>=1.28; extra == 'communication'
Requires-Dist: slack-sdk<4.0,>=3.27; extra == 'communication'
Requires-Dist: twilio<10.0,>=9.0; extra == 'communication'
Provides-Extra: complete
Requires-Dist: atlassian-python-api<5.0,>=4.0; extra == 'complete'
Requires-Dist: black<26.0,>=24.0; extra == 'complete'
Requires-Dist: chromadb<2.0,>=1.3.5; extra == 'complete'
Requires-Dist: docker<8.0,>=7.1; extra == 'complete'
Requires-Dist: google-api-python-client<3.0,>=2.130; extra == 'complete'
Requires-Dist: google-auth-httplib2<1.0,>=0.1.0; extra == 'complete'
Requires-Dist: google-auth-oauthlib<2.0,>=1.2; extra == 'complete'
Requires-Dist: google-auth<3.0,>=2.29; extra == 'complete'
Requires-Dist: isort<6.0,>=5.12; extra == 'complete'
Requires-Dist: kubernetes<35.0,>=28.1; extra == 'complete'
Requires-Dist: langchain-agent<1.0,>=0.1; extra == 'complete'
Requires-Dist: langchain-groq<2.0,>=1.0; extra == 'complete'
Requires-Dist: langchain-mcp-adapters<1.0,>=0.1; extra == 'complete'
Requires-Dist: msal<2.0,>=1.28; extra == 'complete'
Requires-Dist: mypy<2.0,>=1.7; extra == 'complete'
Requires-Dist: pre-commit<4.0,>=3.5; extra == 'complete'
Requires-Dist: psutil<8.0,>=7.2; extra == 'complete'
Requires-Dist: psycopg2-binary<3.0,>=2.9; extra == 'complete'
Requires-Dist: pyautogui<1.0,>=0.9; extra == 'complete'
Requires-Dist: pygithub<3.0,>=2.8; extra == 'complete'
Requires-Dist: pymongo<5.0,>=4.6; extra == 'complete'
Requires-Dist: pytest-asyncio<1.0,>=0.23; extra == 'complete'
Requires-Dist: pytest<9.0,>=8.0; extra == 'complete'
Requires-Dist: python-gitlab<8.0,>=7.0; extra == 'complete'
Requires-Dist: redis<8.0,>=5.0; extra == 'complete'
Requires-Dist: ruff<1.0,>=0.12; extra == 'complete'
Requires-Dist: sentence-transformers<6.0,>=5.2; extra == 'complete'
Requires-Dist: slack-sdk<4.0,>=3.27; extra == 'complete'
Requires-Dist: twilio<10.0,>=9.0; extra == 'complete'
Provides-Extra: dev
Requires-Dist: black<26.0,>=24.0; extra == 'dev'
Requires-Dist: isort<6.0,>=5.12; extra == 'dev'
Requires-Dist: mypy<2.0,>=1.7; extra == 'dev'
Requires-Dist: pre-commit<4.0,>=3.5; extra == 'dev'
Requires-Dist: pytest-asyncio<1.0,>=0.23; extra == 'dev'
Requires-Dist: pytest<9.0,>=8.0; extra == 'dev'
Requires-Dist: ruff<1.0,>=0.12; extra == 'dev'
Provides-Extra: docker
Requires-Dist: docker<8.0,>=7.1; extra == 'docker'
Provides-Extra: email
Requires-Dist: google-api-python-client<3.0,>=2.130; extra == 'email'
Requires-Dist: google-auth-httplib2<1.0,>=0.1.0; extra == 'email'
Requires-Dist: google-auth-oauthlib<2.0,>=1.2; extra == 'email'
Requires-Dist: google-auth<3.0,>=2.29; extra == 'email'
Requires-Dist: msal<2.0,>=1.28; extra == 'email'
Provides-Extra: github
Requires-Dist: pygithub<3.0,>=2.8; extra == 'github'
Provides-Extra: gitlab
Requires-Dist: python-gitlab<8.0,>=7.0; extra == 'gitlab'
Provides-Extra: gmail
Requires-Dist: google-api-python-client<3.0,>=2.130; extra == 'gmail'
Requires-Dist: google-auth-httplib2<1.0,>=0.1.0; extra == 'gmail'
Requires-Dist: google-auth-oauthlib<2.0,>=1.2; extra == 'gmail'
Requires-Dist: google-auth<3.0,>=2.29; extra == 'gmail'
Provides-Extra: kubernetes
Requires-Dist: kubernetes<35.0,>=28.1; extra == 'kubernetes'
Provides-Extra: local-operation
Requires-Dist: psutil<8.0,>=7.2; extra == 'local-operation'
Requires-Dist: pyautogui<1.0,>=0.9; extra == 'local-operation'
Provides-Extra: messaging
Requires-Dist: slack-sdk<4.0,>=3.27; extra == 'messaging'
Requires-Dist: twilio<10.0,>=9.0; extra == 'messaging'
Provides-Extra: mongodb
Requires-Dist: pymongo<5.0,>=4.6; extra == 'mongodb'
Provides-Extra: outlook
Requires-Dist: msal<2.0,>=1.28; extra == 'outlook'
Provides-Extra: postgres
Requires-Dist: psycopg2-binary<3.0,>=2.9; extra == 'postgres'
Provides-Extra: redis
Requires-Dist: redis<8.0,>=5.0; extra == 'redis'
Provides-Extra: slack
Requires-Dist: slack-sdk<4.0,>=3.27; extra == 'slack'
Provides-Extra: vectordb
Requires-Dist: chromadb<2.0,>=1.3.5; extra == 'vectordb'
Requires-Dist: sentence-transformers<6.0,>=5.2; extra == 'vectordb'
Provides-Extra: whatsapp
Requires-Dist: twilio<10.0,>=9.0; extra == 'whatsapp'
Description-Content-Type: text/markdown

# mcp_arena

[![PyPI version](https://badge.fury.io/py/mcp-arena.svg)](https://badge.fury.io/py/mcp-arena)
[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![PyPI Downloads](https://static.pepy.tech/personalized-badge/mcp-arena?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads)](https://pepy.tech/projects/mcp-arena)

**mcp_arena** is a production-ready Python library for building **MCP (Model Context Protocol) servers** with intelligent agent orchestration and domain-specific presets.

## ✨ Features

- 🚀 **Ready-to-use MCP servers** for popular platforms (GitHub, Slack, Notion, AWS, etc.)
- 🤖 **Intelligent agents** with reflection, planning, and routing capabilities
- 🔧 **Zero-configuration setup** for common use cases
- 🏗️ **Extensible architecture** built on SOLID principles
- 📦 **Modular design** - use only what you need

## 🚀 Quick Start

### Installation

```bash
# Core library
pip install mcp-arena

# With specific presets
pip install mcp-arena[github,slack,notion]

# All presets
pip install mcp-arena[all]
```

### Basic Usage

```python
from mcp_arena.presents.github import GithubMCPServer

# Zero-config GitHub MCP server
mcp_server = GithubMCPServer(token="your_github_token")
mcp_server.run()
```

### Using Tools Directly

```python
from mcp_arena.tools.github import GithubTools
from mcp_arena.presents.github import GithubMCPServer

# Create GitHub MCP server first
mcp_server = GithubMCPServer(token="your_token")

# Create tools wrapper
tool = GithubTools(server=mcp_server)
tools = tool.get_list_of_tools()

@mcp_server.tool()
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b


# Add a dynamic greeting resource
@mcp_servevr.resource("greeting://{name}")
def get_greeting(name: str) -> str:
    """Get a personalized greeting"""
    return f"Hello, {name}!"

@mcp_server.prompt()
def greet_user(name: str, style: str = "friendly") -> str:
    """Generate a greeting prompt"""
    styles = {
        "friendly": "Please write a warm, friendly greeting",
        "formal": "Please write a formal, professional greeting",
        "casual": "Please write a casual, relaxed greeting",
    }

    return f"{styles.get(style, styles['friendly'])} for someone named {name}."

```

## Advance Documentation
```
from mcp.server.fastmcp import Icon
from mcp_arena.presents.github import GithubMCPServer

# Create an icon from a file path or URL
icon = Icon(
    src="icon.png",
    mimeType="image/png",
    sizes="64x64"
)

# Add icons to server
mcp = GithubMCPServer(
    "My Server",
    website_url="https://example.com",
    token="*******",
    icons=[icon]
)

# Add icons to tools, resources, and prompts
@mcp.tool(icons=[icon])
def my_tool():
    """Tool with an icon."""
    return "result"

@mcp.resource("demo://resource", icons=[icon])
def my_resource():
    """Resource with an icon."""
    return "content"


```

### With Agent Orchestration

```python
from mcp_arena.presents.github import GithubMCPServer
from mcp_arena.agent.react_agent import ReactAgent

# Create MCP server
mcp_server = GithubMCPServer(token="your_token")

# Create agent separately
agent = ReactAgent(llm=None, memory_type="conversation")

# Run the server
mcp_server.run()
```

### LangChain Integration

#### Using MCP Arena Wrapper

```python
from mcp_arena.wrapper.langchain_wrapper import MCPLangChainWrapper
from mcp_arena.presents.github import GithubMCPServer

# Create MCP server
github_server = GithubMCPServer(token="your_token")

# Wrap with LangChain
wrapper = MCPLangChainWrapper(
    servers={"github": github_server},
    auto_start=True
)

# Connect and create agent
await wrapper.connect()
agent = wrapper.create_agent(
    llm="gpt-4-turbo",
    system_prompt="You are a GitHub assistant"
)
```

#### Direct langchain_mcp_adapters Usage

```python
from langchain_mcp_adapters.client import MultiServerMCPClient  
from langchain.agents import create_agent
from mcp_arena.presents.github import GithubMCPServer

# Start GitHub MCP server in background
github_server = GithubMCPServer(token="your_token", transport="stdio")
github_server.run()

# Create client with multiple servers
client = MultiServerMCPClient(  
    {
        "github": {
            "transport": "stdio",
            "command": "python",
            "args": ["/path/to/github_server_script.py"],
        },
        "math": {
            "transport": "http",
            "url": "http://localhost:8001/mcp",
        }
    }
)

tools = await client.get_tools()  
agent = create_agent(
    "claude-sonnet-4-5-20250929",
    tools  
)

# Use the agent
github_response = await agent.ainvoke(
    {"messages": [{"role": "user", "content": "List my GitHub repositories"}]}
)
math_response = await agent.ainvoke(
    {"messages": [{"role": "user", "content": "what's (3 + 5) x 12?"}]}
)
```

## 📚 Available Presets

### Development Platforms
- **GitHub** - Repositories, issues, PRs, workflows
- **GitLab** - Projects, CI/CD, issues  
- **Bitbucket** - Repositories and pipelines

### Data & Storage
- **PostgreSQL** - Database operations
- **MongoDB** - Document operations
- **Redis** - Cache and data structures
- **VectorDB** - Vector database operations

### Communication
- **Slack** - Channels, messages, workflows
- **WhatsApp** - Messaging via Twilio API
- **Gmail** - Email management and sending
- **Outlook** - Microsoft 365 email and calendar
- **Discord** - Servers and channels
- **Teams** - Microsoft Teams integration

### Productivity
- **Notion** - Databases, pages, blocks
- **Confluence** - Spaces and pages
- **Jira** - Projects, issues, workflows

### Cloud Services
- **AWS S3** - Storage operations
- **Azure Blob** - Azure storage
- **Google Cloud Storage** - GCP storage

### System Operations
- **Local Operations** - File system and system ops
- **Docker** - Container management
- **Kubernetes** - Cluster operations

## 🤖 Agent Types

### Reflection Agent
Self-improving agent that refines responses through iterative refinement.

```python
from mcp_arena.agent.reflection_agent import ReflectionAgent

agent = ReflectionAgent(
    llm=None,
    memory_type="conversation"
)
```

### ReAct Agent
Systematic reasoning and acting cycle for complex problem-solving.

```python
from mcp_arena.agent.react_agent import ReactAgent

agent = ReactAgent(
    llm=None,
    memory_type="conversation"
)
```

### Planning Agent
Goal decomposition and step-by-step execution for complex tasks.

```python
from mcp_arena.agent.planning_agent import PlanningAgent

agent = PlanningAgent(
    llm=None,
    memory_type="conversation"
)
```

### Router Agent
Dynamic agent selection based on task requirements.

```python
from mcp_arena.agent.router import AgentRouter

router = AgentRouter()

# Add routing rules
router.add_route(
    condition=lambda input_text: "github" in input_text.lower(),
    agent_type="react",
    config={"llm": your_llm}
)

router.add_route(
    condition=lambda input_text: "reflect" in input_text.lower(),
    agent_type="reflection",
    config={"llm": your_llm}
)
```

## 🔧 Custom Tools

Extend any preset with custom tools:

```python
from mcp_arena.presents.github import GithubMCPServer
from mcp_arena.tools.base import tool

@tool(description="Custom repository analyzer")
def analyze_repo(repo: str) -> str:
    return f"Analysis for {repo}"

server = GithubMCPServer(
    token="your_token",
    extra_tools=[analyze_repo]
)
```

## 🤖 LangChain Integration

Integrate mcp_arena MCP servers with LangChain agents for powerful multi-service automation:

```python
from langchain_openai import ChatOpenAI
from mcp_arena.wrapper.langchain_integration import AsyncMCPLangChainIntegration

# Initialize LLM
llm = ChatOpenAI(model="gpt-4")

# Create integration with automatic setup
async with AsyncMCPLangChainIntegration(llm) as integration:
    # Add your MCP servers
    integration.add_github_server(token="your_github_token")
    integration.add_slack_server(bot_token="xoxb-your-slack-token")
    integration.add_gmail_server(
        credentials_path="path/to/credentials.json",
        token_path="path/to/token.json"
    )
    
    # Use the unified agent
    response = await integration.invoke(
        "Check my latest GitHub commits and summarize important emails"
    )
    print(response)
```

### Quick Setup Examples

**GitHub Agent:**
```python
async with AsyncMCPLangChainIntegration(llm) as integration:
    integration.add_github_server(token="your_token")
    response = await integration.invoke("List my GitHub repositories")
```

**Multi-Service Agent:**
```python
async with AsyncMCPLangChainIntegration(llm) as integration:
    integration.add_github_server(token="github_token")
    integration.add_slack_server(bot_token="slack_token")
    response = await integration.invoke("Deploy latest code and notify in Slack")
```

**Installation:**
```bash
pip install langchain-openai langchain-mcp-adapters
pip install "mcp_arena[communication]"
```

📖 **[Full Documentation](docs/LANGCHAIN_INTEGRATION.md)**

## 🏗️ Custom MCP Server

Build from scratch for full control:

```python
from mcp_arena.mcp.server import BaseMCPServer
from mcp_arena.tools.base import tool

@tool(description="Search internal docs")
def search_docs(query: str) -> str:
    return f"Results for {query}"

class CustomMCPServer(BaseMCPServer):
    def _register_tools(self):
        self.add_tool(search_docs)

server = CustomMCPServer(
    name="custom-server",
    description="Custom MCP server"
)
server.run()
```

## 📖 Documentation

- **[Installation Guide](docs/INSTALLATION.md)** - Detailed installation instructions for all presets and communication services
- **[MCP Servers Guide](docs/MCP_SERVERS_GUIDE.md)** - Comprehensive guide to all 17 available MCP servers
- **[Agent Guide](docs/AGENT_GUIDE.md)** - Using and configuring intelligent agents
- **[Tools Guide](docs/TOOLS_GUIDE.md)** - Tool development and integration
- **[LangChain Integration](docs/LANGCHAIN_INTEGRATION.md)** - Integrate MCP servers with LangChain agents
- **[Quick Start](docs/QUICKSTART.md)** - Get started in minutes
- **[Tutorial](docs/tutorial.md)** - Step-by-step tutorial

### Architecture

```
MCP Client
   │
   ▼
┌─────────────────┐
│   MCP Server    │  ← Core Layer
│ - Protocol      │
│ - Auth          │
│ - Tool Registry │
└─────────────────┘
   │
   ▼
┌─────────────────┐
│  Agent System   │  ← Intelligence Layer
│ - Reflection    │
│ - ReAct         │
│ - Planning      │
│ - Router        │
└─────────────────┘
   │
   ▼
┌─────────────────┐
│ Tool Ecosystem  │  ← Execution Layer
│ - Presets       │
│ - Custom Tools  │
│ - Orchestration │
└─────────────────┘
```

### Installation Options

```bash
# Core only
pip install mcp-arena[core]

# Development platforms
pip install mcp-arena[github,gitlab,bitbucket]

# Data & storage
pip install mcp-arena[postgres,mongodb,redis,vectordb]

# Communication
pip install mcp-arena[slack,whatsapp,gmail,outlook]

# All communication services
pip install mcp-arena[communication]

# Productivity
pip install mcp-arena[notion,confluence,jira]

# Cloud services
pip install mcp-arena[aws,docker,kubernetes]

# System operations
pip install mcp-arena[local_operation]

# Agent framework
pip install mcp-arena[agents]

# All presets
pip install mcp-arena[all]

# Complete with dev tools
pip install mcp-arena[complete]
```

## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

### Development Setup

```bash
# Clone the repository
git clone https://github.com/SatyamSingh8306/mcp_arena.git
cd mcp_arena

# Install in development mode
pip install -e .[dev]

# Run tests
pytest

# Run linting
black .
isort .
mypy .
```

### Priority Areas

- New preset implementations
- Agent pattern improvements  
- Documentation and examples
- Bug fixes and performance

## 📋 Requirements

- Python 3.12+
- MCP client compatible with Model Context Protocol v1.0+

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🔗 Links

- [Documentation](docs/) - Complete documentation library
- [Installation Guide](docs/INSTALLATION.md) - Installation instructions
- [MCP Servers Guide](docs/MCP_SERVERS_GUIDE.md) - Server documentation
- [LangChain Integration](docs/LANGCHAIN_INTEGRATION.md) - LangChain integration guide
- [Repository](https://github.com/SatyamSingh8306/mcp_arena.git)
- [Issues](https://github.com/SatyamSingh8306/mcp_arena/issues)
- [PyPI](https://pypi.org/project/mcp-arena/)

## 🚧 Status

**Version:** 0.2.1 (Production-ready)

✅ **Stable Features:**
- MCP server base classes
- 17 production-ready presets
- 4 agent types
- Tool registration system
- SOLID architecture
- Communication services (Gmail, Outlook, Slack, WhatsApp)

🔄 **Evolving APIs:**
- Agent interfaces may enhance based on feedback
- New preset additions
- Performance optimizations

📈 **Production Ready:**
- Comprehensive documentation
- Active development
- Community support


