Skip to main content

MCP Server Creator 🏗️

PyPI version License: MIT

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.

🚀 Quick Start

Install with pip

pip install mcp-server-creator

Run with uvx (recommended)

uvx mcp-server-creator

Run as a module

python -m mcp_server_creator

Features

  • Dynamic Server Creation: Create new MCP server configurations on the fly
  • Tool Builder: Add custom tools with parameters, return types, and implementations
  • Resource Manager: Add static and dynamic resources with template support
  • Code Generation: Generate complete, runnable Python code for your servers
  • File Export: Save generated servers directly to Python files
  • Example Templates: Built-in example server to demonstrate capabilities

Usage

As an MCP Server

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"]
    }
  }
}

Programmatic Usage

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)

Available Tools

Server Management

  • create_server: Create a new MCP server configuration
  • list_servers: List all server configurations in memory
  • get_server_details: Get detailed information about a specific server

Tool Management

  • add_tool: Add a tool to an existing server
    • Supports both sync and async tools
    • Custom parameter definitions with types and defaults
    • Automatic import management

Resource Management

  • add_resource: Add a resource to an existing server
    • Static resources for fixed data
    • Dynamic resource templates with parameters
    • Custom MIME types

Code Generation

  • generate_server_code: Generate complete Python code for a server
  • save_server: Save generated server code to a file
  • create_example_server: Create a complete example Weather Service

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())

Development

Setup

git clone https://github.com/GongRzhe/mcp-server-creator.git
cd mcp-server-creator
pip install -e .

Testing

python test_mcp_creator.py

Requirements

  • Python 3.8+
  • FastMCP >= 0.1.0

License

MIT License - see LICENSE file for details.

Contributing

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

Author

GongRzhe - gongrzhe@gmail.com

Links

Metadata

Release files for mcp-server-creator 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-server-creator 0.1.3
File Size Uploaded
mcp_server_creator-0.1.3.tar.gz 15.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-server-creator 0.1.3
File Interpreter ABI Platform
mcp_server_creator-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 25.0 kB

Release files / mcp_server_creator-0.1.3.tar.gz

Download URL mcp_server_creator-0.1.3.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
52657bf7f8277e723b3ebde7dad4e230b87992eff1724f1a8b22cafbd3b2c280
BLAKE2b-256 checksum
How to use checksums
362d175239ecffdfc2a3b285c1d9bd3f382d319bcb9c551b6252e3734a582b82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / mcp_server_creator-0.1.3-py3-none-any.whl

Download URL mcp_server_creator-0.1.3-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f46dc397b585fab8a41fa63aaec91ea57d6ae2966df9461cd9d025ae0b8bcf0
BLAKE2b-256 checksum
How to use checksums
2f0582e11557fd639116568fcb5fb26cc3e33a85986feb058508528c1e9a57d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page