mcp-master


Namemcp-master JSON
Version 0.0.9 PyPI version JSON
download
home_pageNone
SummaryA Python package for master MCP servers.
upload_time2025-08-01 05:24:48
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseNone
keywords automation git llm mcp
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mcp-master

<div align="center">

<strong>A Python package for [master MCP servers](https://medium.com/@aaron.shen321/why-you-need-a-master-for-your-mcp-servers-1c294be6bfc8).</strong>

[![PyPI][pypi-badge]][pypi-url]
[![MIT licensed][mit-badge]][mit-url]
[![Python Version][python-badge]][python-url]

</div>

<!-- omit in toc -->
## Table of Contents

- [MCP Master](#mcp-master)
  - [Overview](#overview)
  - [Installation](#installation)
  - [Quickstart](#quickstart)
    - [Master MCP Servers](#master-mcp-servers)
    - [Master MCP Clients](#master-mcp-clients)
  - [License](#license)

[pypi-badge]: https://img.shields.io/pypi/v/mcp-master
[pypi-url]: https://pypi.org/project/mcp/
[mit-badge]: https://img.shields.io/badge/license-MIT-blue
[mit-url]: https://github.com/ashen-321/mcp-master/blob/main/LICENSE
[python-badge]: https://img.shields.io/badge/python-3.12%20%7C%203.13-green
[python-url]: https://www.python.org/downloads/

## 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](https://github.com/modelcontextprotocol/python-sdk).

## Installation

For projects using pip:
```bash
pip install mcp-master
```

## Quickstart

### Master MCP Servers

A simple master MCP server that connects to two of the included demo servers:

```python
# 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:
```bash
python master_server.py
```

### Master MCP Clients

[MCP clients](https://modelcontextprotocol.io/quickstart/client) 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](https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/client/streamable_http.py).

## License

This project is licensed under the MIT License - see the LICENSE file for details.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mcp-master",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "automation, git, llm, mcp",
    "author": null,
    "author_email": "Aaron Shen <aaron.shen321@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/8f/18/d3c1646aa196a39bd5b7e1450fb1b3d2262216eecd72a7cef4125d05e631/mcp_master-0.0.9.tar.gz",
    "platform": null,
    "description": "# mcp-master\n\n<div align=\"center\">\n\n<strong>A Python package for [master MCP servers](https://medium.com/@aaron.shen321/why-you-need-a-master-for-your-mcp-servers-1c294be6bfc8).</strong>\n\n[![PyPI][pypi-badge]][pypi-url]\n[![MIT licensed][mit-badge]][mit-url]\n[![Python Version][python-badge]][python-url]\n\n</div>\n\n<!-- omit in toc -->\n## Table of Contents\n\n- [MCP Master](#mcp-master)\n  - [Overview](#overview)\n  - [Installation](#installation)\n  - [Quickstart](#quickstart)\n    - [Master MCP Servers](#master-mcp-servers)\n    - [Master MCP Clients](#master-mcp-clients)\n  - [License](#license)\n\n[pypi-badge]: https://img.shields.io/pypi/v/mcp-master\n[pypi-url]: https://pypi.org/project/mcp/\n[mit-badge]: https://img.shields.io/badge/license-MIT-blue\n[mit-url]: https://github.com/ashen-321/mcp-master/blob/main/LICENSE\n[python-badge]: https://img.shields.io/badge/python-3.12%20%7C%203.13-green\n[python-url]: https://www.python.org/downloads/\n\n## Overview\n\nThe 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:\n\n- Build MCP master servers that connect clients to multiple MCP servers through the Streamable HTTP transport\n- Choose tools via reasoning structures like LangGraph\n- Easily scale the available selection of tools\n\nRead about the Model Context Protocol [here](https://github.com/modelcontextprotocol/python-sdk).\n\n## Installation\n\nFor projects using pip:\n```bash\npip install mcp-master\n```\n\n## Quickstart\n\n### Master MCP Servers\n\nA simple master MCP server that connects to two of the included demo servers:\n\n```python\n# master_server.py\nfrom src.mcp_master import MasterMCPServer\nfrom src.mcp_master import global_config as gconfig\nfrom os import getenv\n\ngconfig.selector_model_id = ''  # Set this to your tool selector model ID\ngconfig.judge_model_id = ''  # Set this to your judge model ID\ngconfig.judge_model_service_url = ''  # Set this to where your judge LLM is hosted\ngconfig.OPENAI_API_KEY = getenv('OPENAI_API_KEY')\ngconfig.OPENAI_BASE_URL = getenv('OPENAI_BASE_URL')  # Set this to where your other LLMs will be hosted, None for default\n\n# Create an MCP server on port 3000 with two test servers\n# Ensure both test servers are running by starting them in the terminal before starting demo_master_server.py\nserver = MasterMCPServer(\n    port=3000,\n    sub_servers=[\n        # (server url, server identifier) pairs - ensure all server identifiers are unique\n        # If the server is located locally (as the demo servers are), ensure the server identifier matches the server's file name (without the .py)\n        (\"http://localhost:8091/mcp\", 'test_server_1'),\n        (\"http://localhost:8092/mcp\", 'test_server_2')\n    ]\n)\nserver.startup()\n```\n\nYou can run this server in the terminal by running:\n```bash\npython master_server.py\n```\n\n### Master MCP Clients\n\n[MCP clients](https://modelcontextprotocol.io/quickstart/client) utilizing the streamable-HTTP protocol can connect to master MCP servers without any modification. Details provided in the URL.\n\nFor a complete working example of an MCP client, see [the MCP GitHub repository](https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/client/streamable_http.py).\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python package for master MCP servers.",
    "version": "0.0.9",
    "project_urls": {
        "Homepage": "https://github.com/ashen-321/mcp-master/",
        "Issues": "https://github.com/ashen-321/mcp-master/issues"
    },
    "split_keywords": [
        "automation",
        " git",
        " llm",
        " mcp"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f17d4d1028b454698403565daa52f5691bc3f316cc7196d5b13f6210b682f549",
                "md5": "6f54de09d49f52e9845be7beb4f5b480",
                "sha256": "177caca0c2caaa4e4772fc38e94ffd948a52ab5d5e08eb330ab9abc38d3464db"
            },
            "downloads": -1,
            "filename": "mcp_master-0.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6f54de09d49f52e9845be7beb4f5b480",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 12465,
            "upload_time": "2025-08-01T05:24:48",
            "upload_time_iso_8601": "2025-08-01T05:24:48.168604Z",
            "url": "https://files.pythonhosted.org/packages/f1/7d/4d1028b454698403565daa52f5691bc3f316cc7196d5b13f6210b682f549/mcp_master-0.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8f18d3c1646aa196a39bd5b7e1450fb1b3d2262216eecd72a7cef4125d05e631",
                "md5": "0b28fecf9d59142169d786a4d811795b",
                "sha256": "214ed5cc81f256299f8857c95d229d09e5415846b67ab150268009ce1f05ca65"
            },
            "downloads": -1,
            "filename": "mcp_master-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "0b28fecf9d59142169d786a4d811795b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 15996,
            "upload_time": "2025-08-01T05:24:48",
            "upload_time_iso_8601": "2025-08-01T05:24:48.929075Z",
            "url": "https://files.pythonhosted.org/packages/8f/18/d3c1646aa196a39bd5b7e1450fb1b3d2262216eecd72a7cef4125d05e631/mcp_master-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-01 05:24:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ashen-321",
    "github_project": "mcp-master",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mcp-master"
}
        
Elapsed time: 1.24665s