This repository contains the Web MCP (MOdel-Context Protocol) server, a specialized microservice within the Multi-Agent Bot system. Its primary role is to expose a suite of web-related tools (like general web search, Stack Overflow search, and news retrieval) via the FastMCP protocol, making them discoverable and invokable by the cyrene-agent (bot-api) service.
- Web Search: Provides a tool for general web searches (e.g., via SerpApi).
- Stack Overflow Search: Offers a specialized tool for searching programming-related questions and answers on Stack Overflow.
- News Article Retrieval: Integrates with a news API to fetch current news headlines and articles.
- FastMCP Integration: Registers all web-related functionalities as discoverable tools for the cyrene-agent.
- Modular & Scalable: Runs as an independent microservice, allowing for easy scaling and maintenance.
The web-mcp is one of several specialized MCP servers. It communicates with external web APIs (like SerpApi, NewsAPI) to perform its functions. The cyrene-agent discovers its tools via the fastmcp-core-server and then directly calls these tools on the web-mcp service.
-
Python 3.12+
-
API Keys:
- SerpApi API Key: Required for
serpapi_searchandgoogle_searchtools. Obtain one from SerpApi. - NewsAPI.org API Key: Required for
newsapi_orgtool. Obtain one from NewsAPI.org.
- SerpApi API Key: Required for
Clone this repository:
git clone https://github.com/CyreneAI/web-mcp.git
cd web-mcpNote: If you are setting up the entire multi-repo system, you would typically clone the main orchestrator repository first, which would then handle cloning individual MCPs or using them as submodules.
Install Python dependencies:
pip install -r requirements.txtCreate a .env file in the root of this web-mcp directory with the following variables:
# .env in web-mcp directory
SERPAPI_API_KEY=your_serpapi_api_key_here
NEWSAPI_API_KEY=your_newsapi_api_key_hereSERPAPI_API_KEY: Your SerpApi API key.NEWSAPI_API_KEY: Your NewsAPI.org API key.
Run the web-mcp service using Uvicorn:
uvicorn server:app --reload --host 0.0.0.0 --port 9000The web-mcp server will be accessible at http://localhost:9000. It will automatically register its tools with the fastmcp-core-server if it's running and configured correctly.
Once the web-mcp server is running and its tools are registered with fastmcp-core-server, the cyrene-agent can invoke its tools.
Example queries you can send to your agent (via the agent-UI or direct API chat) that would trigger web-mcp tools:
- “What is the capital of France?” (Uses
google_searchorserpapi_search) - “How do I fix a ‘TypeError: ‘int’ object is not subscriptable’ in Python?” (Uses
stackoverflow_search) - “What are the latest headlines about artificial intelligence?” (Uses
newsapi_org)
web-mcp/
├── .env.example
├── .gitignore
├── README.md # <- This file
├── Dockerfile # Dockerfile for the web-mcp service
├── requirements.txt # Python dependencies for web-mcp if running locally for docker it will use base-mcp for requirements
└── server.py # FastAPI application for the web-mcp