Development · MODEL CONTEXT PROTOCOL
Multiple MCP SSE Servers with a Python Host
This repository contains a python implementation of an MCP Host which is capable of running several MCP Servers with SSE protocol
连接能力
Multiple MCP SSE Servers with a Python Host 为 AI Agent 提供什么
来源目录未提供结构化功能列表,请在使用前阅读源仓库文档。
安全
MCP 收录不等于安全审核
MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。
README
仓库文档
This repository contains a Server-Sent Events (SSE) Model Control Protocol (MCP) client implementation that uses Google's Gemini API. The Host app reads the config.json file, instantiates instances of MCP Client class to launch the MCP servers and maintain connections with them, clean up on shutdown etc.
It's possible to package this host app as a dmg package and distribute which can then be used with any MCP SSE ervers. Todo: Add stdio server support Todo: Add multiple model support Todo: Add tool chaining
-
Clone this repository:
git clone https://github.com/hackerinheels/multipleMCPServerWithPythonHost.git cd multipleMCPServerWithPythonHost -
Create a
.envfile in the root directory with your API keys:GEMINI_API_KEY=your_api_key_here MODEL_NAME=gemini-2.0-flashYou can get a Gemini API key from Google's AI Studio.
-
Set up Google Calendar API using the instructions in the googleCalendar/README.md file
-
Update config.json to include the browser-use server:
{ "mcpServers": { "calendar": { "command": "uv", "args": ["run", "googleCalendar/calendarServer.py", "--port", "8000"] }, "browser-use": { "command": "uv", "args": ["run", "<path-to-browser-use-mcp-server>/server", "--port", "8006"] } } }Replace
<path-to-browser-use-mcp-server>with the actual path where you cloned the repository. -
Create a
.envfile in the browser-use-mcp-server directory with the following configuration:
CHROME_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"uv venv --python 3.11
source .venv/bin/activate
uv pip install -r requirements.txt
uv run host.pyThis will start all the servers listed in the config.json file
Once the servers and client are running, you can interact with them by typing queries.
The calendar server provides the following tools:
list_events: List upcoming calendar eventsget_event_details: Get detailed information about a specific eventsearch_events: Search for events matching a query
Example queries:
- "Show my upcoming events"
- "Search for meetings with John"
- "Get details for event {event_id}"
This tool enable browser automation and control with the following tools:
- 'browser_use'
- 'browser_get_result'
Type quit to exit the client.
- Python 3.11+
- UV package manager
- Google Gemini API key
- Google Calendar API credentials (for calendar server)
This repository demonstrates how to load and run multiple MCP servers using a configuration file.
- Interact with Google Calendar
- Manage events and schedules
- Automate browser interactions
- Control Chrome browser programmatically
- Execute browser-based tasks
Create a .env file in the browser-use-mcp-server directory with the following configuration:
CHROME_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"Note: Make sure to replace "your-openai-api-key" with your actual OpenAI API key.
- Make sure all API keys are properly configured in .env
- Ensure Chrome is installed for browser-use server
- Each server runs on its designated port
- The host manages all server lifecycles
- If a server fails to start, check its port availability
- Verify all environment variables are set correctly
- Ensure Chrome path is correct for your system
社区