mcp-master
A Python package for master MCP servers.
Table of Contents
Overview
The MCP Master package allows the creation of intermediaries between clients and MCP servers. This offloads tool-related reasoning and logic to the master server without requiring client-side modifications. This Python package provides full master MCP support, making it easy to:
- Build MCP master servers that connect clients to multiple MCP servers through the Streamable HTTP transport
- Choose tools via reasoning structures like LangGraph
- Easily scale the available selection of tools
Read about the Model Context Protocol here.
Installation
For projects using pip:
pip install mcp-master
Quickstart
Master MCP Servers
A simple master MCP server that connects to two of the included demo servers:
# master_server.py
from src.mcp_master import MasterMCPServer
from src.mcp_master import global_config as gconfig
from os import getenv
gconfig.selector_model_id = '' # Set this to your tool selector model ID
gconfig.judge_model_id = '' # Set this to your judge model ID
gconfig.judge_model_service_url = '' # Set this to where your judge LLM is hosted
gconfig.OPENAI_API_KEY = getenv('OPENAI_API_KEY')
gconfig.OPENAI_BASE_URL = getenv('OPENAI_BASE_URL') # Set this to where your other LLMs will be hosted, None for default
# Create an MCP server on port 3000 with two test servers
# Ensure both test servers are running by starting them in the terminal before starting demo_master_server.py
server = MasterMCPServer(
port=3000,
sub_servers=[
# (server url, server identifier) pairs - ensure all server identifiers are unique
# If the server is located locally (as the demo servers are), ensure the server identifier matches the server's file name (without the .py)
("http://localhost:8091/mcp", 'test_server_1'),
("http://localhost:8092/mcp", 'test_server_2')
]
)
server.startup()
You can run this server in the terminal by running:
python master_server.py
Master MCP Clients
MCP clients utilizing the streamable-HTTP protocol can connect to master MCP servers without any modification. Details provided in the URL.
For a complete working example of an MCP client, see the MCP GitHub repository.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for mcp-master 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mcp_master-0.0.9.tar.gz | 16.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_master-0.0.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.5 kB
Release files / mcp_master-0.0.9.tar.gz
| Download URL | mcp_master-0.0.9.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
214ed5cc81f256299f8857c95d229d09e5415846b67ab150268009ce1f05ca65
|
|
BLAKE2b-256 checksum How to use checksums |
8f18d3c1646aa196a39bd5b7e1450fb1b3d2262216eecd72a7cef4125d05e631
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / mcp_master-0.0.9-py3-none-any.whl
| Download URL | mcp_master-0.0.9-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
177caca0c2caaa4e4772fc38e94ffd948a52ab5d5e08eb330ab9abc38d3464db
|
|
BLAKE2b-256 checksum How to use checksums |
f17d4d1028b454698403565daa52f5691bc3f316cc7196d5b13f6210b682f549
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Security for mcp-master 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.