mcp-composer

MCP.Pizza Chef: htkuan

MCP Composer is a client that centrally manages multiple MCP servers and tools through a unified Server-Sent Events (SSE) interface. It enables dynamic activation, deactivation, and configuration of MCP servers, allowing AI agents or applications to flexibly control and access various MCP services via independent, customizable SSE endpoints.

Use This MCP client To

Consolidate multiple MCP servers into a single access point Dynamically activate or deactivate MCP servers and tools Create independent SSE endpoints for different AI agents Customize MCP server combinations per AI application Manage MCP server connections centrally for easier orchestration Enable flexible AI app control over multiple MCP servers Simplify multi-server MCP workflows with unified SSE streaming

README

MCP Composer

UI Demo

MCP Composer is a gateway service that centrally manages all your MCP servers. You can use it to consolidate all the MCP servers you need and open independent ports with different combinations of servers and tools for each service (like AI agents or tools) that requires access to MCP servers.

Key Features

  • Dynamic MCP Server Management: Dynamically manages connections to multiple MCP servers and their tools, enabling on-the-fly activation or deactivation of services.
  • Unified SSE Interface: Exposes a single Server-Sent Events (SSE) interface that provides access to all capabilities of the managed MCP servers.
  • Multiple Dynamic Endpoints: Supports dynamic creation and removal of multiple SSE endpoints to accommodate different AI agents or AI tools.
  • Independent Interface Configuration: Each SSE interface independently manages its own combination of MCP servers and tools, allowing for customized service provision.

System Architecture

MCP Composer Architecture Diagram

Key Terms

  • MCP Client: External tools or AI agents and AI workflows, such as Cursor, n8n, etc.
  • Gateway[A/B]: MCP server implementation bound to ServerKit and managed by the Composer, used to handle MCP Client connections.
  • Server Kit: Manages and controls information about Downstream MCP servers and which tools within servers should be enabled.
  • Downstream Controller: Responsible for controlling and managing connections to Downstream MCP servers.
  • Downstream MCP Server: An internal object connecting to a Downstream MCP server, implemented as an internal MCP client that links to the Downstream MCP server.
  • MCP Server: External MCP server services, such as: https://github.com/modelcontextprotocol/servers etc.
  • Composer: Provides APIs to control and orchestrate Gateways, Server Kits, and Downstream Controllers.

Requirements

  • Python >= 3.12
  • uv: A fast Python package installer and manager.

Installation

Method 1:

  1. Clone the repository:

    git clone https://github.com/htkuan/mcp-composer
    cd mcp-composer
  2. Install dependencies: Use uv to sync the project dependencies.

    make install
    # or directly use uv
    # uv sync

Method 2:

use docker compose to run the project

make run-docker

Configuration

Before running the application, you need to configure the target MCP servers.

  1. Copy the example configuration file:

    cp mcp_servers.example.json mcp_servers.json
  2. Edit mcp_servers.json and enter the details of the MCP servers you want to connect to.

  3. Set up environment variables:

    cp .env.example .env
  4. Edit the .env file to configure the following settings:

    • HOST: Server host address (default: 0.0.0.0)
    • PORT: Server port (default: 8000)
    • MCP_COMPOSER_PROXY_URL: MCP Composer proxy URL (default: http://localhost:8000)
    • MCP_SERVERS_CONFIG_PATH: Path to the MCP servers configuration file (default: ./mcp_servers.json)

Running

Use uv to run the FastAPI application:

make run
# or directly use uv
# uv run src/main.py

After the service starts, you can interact with the API through the API documentation in your browser (typically at http://127.0.0.1:8000/docs).

Development

The project includes a Makefile to simplify common development tasks:

  • Install dependencies: make install
  • Format and check code: make format (using Ruff)
  • Run the application: make run

Contributing

Contributions to this project are welcome! Please follow the standard GitHub Fork & Pull Request workflow. It's recommended to create an Issue for discussion before submitting a Pull Request.

mcp-composer FAQ

How does MCP Composer manage multiple MCP servers?
It dynamically connects to and controls multiple MCP servers and tools through a single SSE interface, allowing flexible activation and configuration.
Can I create separate endpoints for different AI agents?
Yes, MCP Composer supports multiple dynamic SSE endpoints, each independently managing its own combination of MCP servers and tools.
What is the benefit of using a unified SSE interface?
A unified SSE interface simplifies streaming data and events from multiple MCP servers into one consolidated channel for easier consumption by AI apps.
How does MCP Composer handle server activation and deactivation?
It allows on-the-fly activation or deactivation of MCP servers and tools, enabling dynamic service management without downtime.
Is MCP Composer suitable for complex AI workflows?
Yes, it is designed to orchestrate multiple MCP servers and tools flexibly, making it ideal for complex AI agent and app workflows.
Can MCP Composer be used to customize MCP server combinations?
Absolutely, each SSE interface can be independently configured with different MCP servers and tools tailored to specific AI services.
Does MCP Composer support scalability for multiple AI applications?
Yes, by creating multiple dynamic SSE endpoints, it supports scalable deployment for various AI agents or tools simultaneously.
What protocols does MCP Composer use for communication?
It uses Server-Sent Events (SSE) to stream real-time data from MCP servers to clients efficiently.