mcp-master


Namemcp-master JSON
Version 0.0.4 PyPI version JSON
download
home_pageNone
SummaryA Python package for master MCP servers.
upload_time2025-07-10 22:46:11
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
A Python package for master MCP servers.

<div align="center">

<strong>Python implementation of master MCP servers.</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
import asyncio
from os import getenv

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

# 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=[
        ("http://localhost:8091/mcp", 'test_server_1'),
        ("http://localhost:8092/mcp", 'test_server_2')
    ]
)
asyncio.run(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, 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/39/43/35ccd92b95dd76a8583cf72139989a07a1b57c80007b1dd1d62d7bfd818e/mcp_master-0.0.4.tar.gz",
    "platform": null,
    "description": "# mcp-master\nA Python package for master MCP servers.\n\n<div align=\"center\">\n\n<strong>Python implementation of master MCP servers.</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\nimport asyncio\nfrom os import getenv\n\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\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        (\"http://localhost:8091/mcp\", 'test_server_1'),\n        (\"http://localhost:8092/mcp\", 'test_server_2')\n    ]\n)\nasyncio.run(server.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, 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.4",
    "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": "ef99bb6cf79709eae37f7f34c02e19620bab5a3198c0bd7244a1f333cf331415",
                "md5": "383a6f1eeb752c9e367b8d7ab118cea2",
                "sha256": "d0f4848035dd6045d29a52b4e50cc338ea35bae8bda58540334d6a86b45e5a4b"
            },
            "downloads": -1,
            "filename": "mcp_master-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "383a6f1eeb752c9e367b8d7ab118cea2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 14528,
            "upload_time": "2025-07-10T22:46:09",
            "upload_time_iso_8601": "2025-07-10T22:46:09.906410Z",
            "url": "https://files.pythonhosted.org/packages/ef/99/bb6cf79709eae37f7f34c02e19620bab5a3198c0bd7244a1f333cf331415/mcp_master-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "394335ccd92b95dd76a8583cf72139989a07a1b57c80007b1dd1d62d7bfd818e",
                "md5": "e26532940a8b1fc295905aa598fc6be0",
                "sha256": "b34e7be58b95ce8bbc5324bf87787f90a55c02b23636e64f684dbe9a40d8c2b2"
            },
            "downloads": -1,
            "filename": "mcp_master-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "e26532940a8b1fc295905aa598fc6be0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 15922,
            "upload_time": "2025-07-10T22:46:11",
            "upload_time_iso_8601": "2025-07-10T22:46:11.125465Z",
            "url": "https://files.pythonhosted.org/packages/39/43/35ccd92b95dd76a8583cf72139989a07a1b57c80007b1dd1d62d7bfd818e/mcp_master-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-10 22:46:11",
    "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: 0.50003s