MCP Agent & Server Ecosystem

MCP Agent & Server Ecosystem

An autonomous agent ecosystem that leverages Groq for high-performance reasoning and Playwright for web automation via the Model Context Protocol. It features an interactive CLI and a custom server providing a run_task tool for orchestrating multi-server workflows.

Category
访问服务器

README

🚀 MCP Agent & Server Ecosystem

A state-of-the-art demonstration of the Model Context Protocol (MCP), featuring autonomous agents, browser automation, and multi-server orchestration. This ecosystem leverage's Groq's high-performance inference to provide a seamless agentic experience.


🏗️ Architecture Overview

The system operates in two distinct modes. Below are the precise technical architectures for both the interactive CLI and the standalone MCP Server mode.

🎯 1. MCP Architecture - Direct CLI Mode (app.py)

In this mode, the user interacts directly with the terminal-based agent which handles reasoning and tool execution in a single host process.

graph TD
    %% Color Definitions
    classDef blue fill:#3498db,stroke:#333,stroke-width:2px,color:#fff
    classDef lightblue fill:#87ceeb,stroke:#333,stroke-width:2px,color:#000
    classDef purple fill:#9b59b6,stroke:#333,stroke-width:2px,color:#fff
    classDef yellow fill:#f1c40f,stroke:#333,stroke-width:2px,color:#000
    classDef orange fill:#e67e22,stroke:#333,stroke-width:2px,color:#fff
    classDef red fill:#e74c3c,stroke:#333,stroke-width:2px,color:#fff
    classDef green fill:#2ecc71,stroke:#333,stroke-width:2px,color:#fff

    User["👤 User"]:::blue
    App["🖥️ app.py (CLI Interface)"]:::lightblue
    
    subgraph Host ["🟦 MCP Host (Application Space)"]
        direction TB
        subgraph AgentBox ["🟪 MCPAgent (Decision Maker)"]
            Agent["🤖 MCPAgent<br/>(Decision Maker: LLM + Planning)"]:::purple
            LLM["🧠 LLM (Groq - Llama 3.3)<br/>(Reasoning / Decision Making)"]:::purple
            Client["🔌 MCPClient<br/>(Tool Execution Layer / Connector)"]:::yellow
            Agent --- LLM
            Agent --- Client
        end
    end

    Config["📄 browser_mcp.json (Registry)"]:::orange
    
    subgraph ServersBox ["🟥 MCP Servers (Tool Providers)"]
        PW["🌐 Playwright MCP Server"]:::red
        AB["🏠 Airbnb MCP Server"]:::red
        DDG["🔍 DuckDuckGo MCP Server"]:::red
    end

    subgraph ToolsBox ["🟩 Tools Layer"]
        Tools["browser_navigate<br/>browser_click<br/>duckduckgo_search<br/>airbnb_search"]:::green
    end

    %% Logical Connections
    User --> App
    App --> Agent
    Client -->|reads config| Config
    Client --> PW
    Client --> AB
    Client --> DDG
    PW --> Tools
    AB --> Tools
    DDG --> Tools

🎯 2. MCP Architecture - Server Mode (server.py)

In this mode, the project acts as an MCP server itself, exposing its capabilities to external clients like VS Code Copilot.

graph TD
    %% Color Definitions
    classDef blue fill:#3498db,stroke:#333,stroke-width:2px,color:#fff
    classDef lightblue fill:#87ceeb,stroke:#333,stroke-width:2px,color:#000
    classDef purple fill:#9b59b6,stroke:#333,stroke-width:2px,color:#fff
    classDef yellow fill:#f1c40f,stroke:#333,stroke-width:2px,color:#000
    classDef orange fill:#e67e22,stroke:#333,stroke-width:2px,color:#fff
    classDef red fill:#e74c3c,stroke:#333,stroke-width:2px,color:#fff
    classDef green fill:#2ecc71,stroke:#333,stroke-width:2px,color:#fff

    Ext["🌐 External Client<br/>(Caller of MCP Server)"]:::blue
    
    subgraph ServerHost ["🟦 MCP Host (server.py)"]
        Server["⚙️ server.py (FastMCP Server)"]:::lightblue
        Task["🛠️ run_task(query)"]:::lightblue
        
        subgraph AgentBoxServer ["🟪 MCPAgent"]
            AgentS["🤖 MCPAgent<br/>(Decision Maker)"]:::purple
            LLMS["🧠 Groq LLM"]:::purple
            ClientS["🔌 MCPClient<br/>(Tool Connector)"]:::yellow
            AgentS --- LLMS
            AgentS --- ClientS
        end
    end

    ConfigS["📄 browser_mcp.json"]:::orange
    
    subgraph ServersBoxServer ["🟥 MCP Servers (Tool Providers)"]
        PWS["🌐 Playwright"]:::red
        ABS["🏠 Airbnb"]:::red
    end

    subgraph ToolsBoxServer ["🟩 Tools"]
        TS["browser, search, etc."]:::green
    end

    %% Logical Connections
    Ext -->|Calls run_task| Server
    Server --> Task
    Task --> AgentS
    ClientS -->|reads config| ConfigS
    ClientS --> PWS
    ClientS --> ABS
    PWS --> TS
    ABS --> TS

✨ Key Features

  • ⚡ High-Performance Inference: Powered by Groq's llama-3.3-70b-versatile for near-instantaneous reasoning.
  • 🌐 Autonomous Browser Control: Deep integration with Playwright for navigating and interacting with the web.
  • 🔌 Flexible Server Protocol: Connects to any standard MCP server for extensible tool capabilities.
  • 📂 State-Aware Memory: (In app.py) Maintains conversation state to handle complex, iterative requests.
  • 🛠️ Custom Server Extension: Includes its own FastMCP server for wrapping agentic workflows as reusable tools.

📂 Project Structure

Component Responsibility
app.py The flagship CLI chat interface and agent controller.
server.py A FastMCP server implementation providing the run_task tool.
browser_mcp.json The core registry for all connected MCP services.
pyproject.toml Project dependencies managed via Python's uv tool.
.env Secure storage for sensitive API keys.

🛠️ Getting Started

1. Environment Setup

Ensure you have uv installed and a valid Groq API key.

# Clone the environment variables
echo "GROQ_API_KEY=your_key_here" > .env

2. Launch the Ecosystem

You can interact with the agent directly or run the custom server.

Start the Interactive Agent:

python app.py

Expose the Custom MCP Server:

python server.py

📖 Implementation Notes

The ecosystem is built on the mcp_use library, bridging LangChain components with the Model Context Protocol. The MCPAgent is configured with safety rails like max_steps to prevent infinite loops during autonomous execution.


🔥 MCP enables a single agent to interact with multiple tool providers via standardized servers.


Note: The previous mcp.json was detected as missing or redundant; all core configuration is now consolidated in browser_mcp.json.


Made with ❤️ for the MCP Community

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选