Skip to main content

Python sdk support mcp server auto register to nacos

Project description

nacos-mcp-wrapper-python

Nacos mcp wrapper Python sdk

How to use:

  1. Install:
pip install nacos-mcp-wrapper-python
  1. Use

Before use nacos-mcp-wrapper-python,

# server.py
from mcp.server.fastmcp import FastMCP

# Create an MCP server
mcp = FastMCP("Demo")


# Add an addition tool
@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

Replace the FashMCP with NacosMCP to register your mcp server to nacos

# server.py
from nacos_mcp_wrapper.server.nacos_mcp import NacosMCP
from nacos_mcp_wrapper.server.nacos_settings import NacosSettings

# Create an MCP server
# mcp = FastMCP("Demo")
nacos_settings = NacosSettings()
nacos_settings.SERVER_ADDR = "<nacos_server_addr>"
mcp = NacosMCP(nacos_settings, "nacos-mcp-python")


# Add an addition tool
@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

After registering to Nacos, you can dynamically update the descriptions of Tools and the descriptions of parameters in the Mcp Server on Nacos without restarting your Mcp Server.

You can also replace the Server with NacosServer:

from mcp.server import Server
app = Server("mcp-website-fetcher")

change to NacosServer:

from nacos_mcp_wrapper.server.nacos_server import NacosServer
from nacos_mcp_wrapper.server.nacos_settings import NacosSettings

nacos_settings = NacosSettings()
nacos_settings.SERVER_ADDR = "<nacos_server_addr>"
app = NacosServer(nacos_settings,"mcp-website-fetcher")

For more examples, please refer to the content under the example directory.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nacos-mcp-wrapper-python-0.1.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nacos_mcp_wrapper_python-0.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file nacos-mcp-wrapper-python-0.1.0.tar.gz.

File metadata

  • Download URL: nacos-mcp-wrapper-python-0.1.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for nacos-mcp-wrapper-python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f5f4cfe5caab26df301a15a0a9d578dc4e5a1a96e44fc87d96c50a261301704e
MD5 786846f452eae1711f3d7ce17f2ad65d
BLAKE2b-256 ed80a9558d2521e6590b48e5cf039b47fa072c1139c472332d62ca3422511970

See more details on using hashes here.

File details

Details for the file nacos_mcp_wrapper_python-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nacos_mcp_wrapper_python-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8460cac34e73e2f62d7122542bc031d3e15ee2924e01508abbcaaf21cec7efd9
MD5 e9e298234571da63f8c701acc81fa506
BLAKE2b-256 b5ebadc9a40327075d6d5972059fd166b8ecb6a462ece89fa9892c1f625684c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page