Sponsored by Deepsite.site

Multiple MCP SSE Servers with a Python Host

Created By
hackerinheels9 months ago
This repository contains a python implementation of an MCP Host which is capable of running several MCP Servers with SSE protocol
Content

Multiple MCP SSE Servers with a Python Host

This repository contains a Server-Sent Events (SSE) Model Control Protocol (MCP) client implementation that uses Google's Gemini API.

Setup

  1. Clone this repository:

    git clone https://github.com/hackerinheels/multipleMCPServerWithPythonHost.git
    cd multipleMCPServerWithPythonHost
    
  2. Create a .env file in the root directory with your API keys:

    GEMINI_API_KEY=your_api_key_here
    MODEL_NAME=gemini-2.0-flash
    

    You can get a Gemini API key from Google's AI Studio.

  3. Set up Google Calendar API:

    • Go to the Google Cloud Console
    • Create a new project or select an existing one
    • Enable the Google Calendar API
    • Create OAuth 2.0 credentials
    • Download the credentials and save as credentials.json in the current directory

Running the Application

uv venv --python 3.11
source .venv/bin/activate
uv pip install -r requirements.txt
uv run host.py

This will start all the servers listed in the config.json file

Usage

Once the servers and client are running, you can interact with them by typing queries.

Google Calendar Commands

The calendar server provides the following tools:

  • list_events: List upcoming calendar events
  • get_event_details: Get detailed information about a specific event
  • search_events: Search for events matching a query

Example queries:

  • "Show my upcoming events"
  • "Search for meetings with John"
  • "Get details for event {event_id}"

Browser Use For Browser Automation

Type quit to exit the client.

Requirements

  • Python 3.11+
  • UV package manager
  • Google Gemini API key
  • Google Calendar API credentials (for calendar server)

License

MIT

MCP Multi-Server Configuration

This repository demonstrates how to load and run multiple MCP servers using a configuration file.

Servers Included

Calendar Server

  • Interact with Google Calendar
  • Manage events and schedules

Browser-use Server

  • Automate browser interactions
  • Control Chrome browser programmatically
  • Execute browser-based tasks

Setup Instructions

1. Environment Setup

# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

2. Configuration

Create a .env file with your API keys:

GEMINI_API_KEY="your-gemini-api-key"
MODEL_NAME="gemini-1.5-flash"

3. Browser-use MCP Server Setup

  1. Download the server:
    git clone https://github.com/co-browser/browser-use-mcp-server
    
  2. 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.

4. Browser-use Server Environment Setup

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.

Notes

  • 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

Troubleshooting

  • 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
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Playwright McpPlaywright MCP server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
Serper MCP ServerA Serper MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
ChatWiseThe second fastest AI chatbot™
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
WindsurfThe new purpose-built IDE to harness magic
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
CursorThe AI Code Editor
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Tavily Mcp
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.