A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/GongRzhe/mcp-server-creator below:

GongRzhe/MCP-Server-Creator: A powerful Model Context Protocol (MCP) server that creates other MCP servers! This meta-server provides tools for dynamically generating FastMCP server configurations and Python code.

A powerful Model Context Protocol (MCP) server that creates other MCP servers! This meta-server provides tools for dynamically generating FastMCP server configurations and Python code.

pip install mcp-server-creator
Run with uvx (recommended)
python -m mcp_server_creator

The MCP Server Creator is itself an MCP server that can be used with Claude Desktop or any MCP client.

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-server-creator": {
      "command": "uvx",
      "args": ["mcp-server-creator"]
    }
  }
}
from mcp_server_creator import create_server, add_tool, generate_server_code

# Create a new server configuration
result = create_server(
    name="My API Server",
    description="A custom API integration server",
    version="1.0.0"
)

# Add a tool
add_tool(
    server_id="my_api_server",
    tool_name="fetch_data",
    description="Fetch data from the API",
    parameters=[{"name": "endpoint", "type": "str"}],
    return_type="dict",
    implementation='return {"data": f"Fetched from {endpoint}"}'
)

# Generate the code
code = generate_server_code("my_api_server")
print(code)
Example: Creating a Weather Service
import asyncio
from mcp_server_creator import create_server, add_tool, add_resource, save_server

async def create_weather_service():
    # Create the server
    create_server(
        name="Weather Service",
        description="Get weather information",
        version="1.0.0"
    )
    
    # Add a weather tool
    add_tool(
        server_id="weather_service",
        tool_name="get_weather",
        description="Get current weather for a city",
        parameters=[
            {"name": "city", "type": "str"},
            {"name": "units", "type": "str", "default": '"celsius"'}
        ],
        return_type="dict",
        is_async=True,
        implementation='''
    # Your weather API logic here
    return {
        "city": city,
        "temperature": 20,
        "units": units,
        "condition": "sunny"
    }'''
    )
    
    # Add a resource
    add_resource(
        server_id="weather_service",
        uri="weather://{city}/current",
        name="Current Weather",
        description="Get current weather data",
        is_template=True,
        implementation='return {"city": city, "weather": "sunny"}'
    )
    
    # Save to file
    await save_server("weather_service", "weather_service.py")

# Run the creation
asyncio.run(create_weather_service())
git clone https://github.com/GongRzhe/mcp-server-creator.git
cd mcp-server-creator
pip install -e .
python test_mcp_creator.py

MIT License - see LICENSE file for details.

Contributions are welcome! Please feel free to submit a Pull Request.

GongRzhe - gongrzhe@gmail.com


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4