MC

MCP Server Creator: FastMCP Configs and Python

Generate dynamic MCP server configurations and Python code with a meta-server that creates FastMCP servers quickly and reliably.

Quick Install
npx -y @GongRzhe/MCP-Server-Creator

Overview

MCP Server Creator is a meta-server that automates the generation of FastMCP-compatible server configurations and Python starter code. Instead of hand-crafting many nearly-identical server setups for different models, environments, or tests, this tool emits ready-to-run configurations and server modules on demand. That makes spinning up ephemeral model servers fast, consistent, and scriptable.

For developers building model hosting, testing frameworks, or CI pipelines, the meta-server eliminates repetitive boilerplate and reduces error-prone manual edits. You can request a tailored FastMCP server (configuration + Python entrypoint) via an HTTP API or a small Python client, then deploy that generated server directly or adapt it as needed.

Features

  • Generate FastMCP configuration files dynamically from templates
  • Emit ready-to-run Python server code that loads the requested model and exposes the FastMCP protocol
  • HTTP API for programmatic creation of server bundles
  • Config templating supporting model, port, resource, and runtime options
  • CLI and Python client examples for quick integration
  • Designed for ephemeral/dev/test servers and CI/CD automation

Installation / Configuration

Prerequisites: Python 3.8+ and pip.

Clone the repository and install dependencies:

git clone https://github.com/GongRzhe/MCP-Server-Creator.git
cd MCP-Server-Creator
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Start the meta-server locally (example):

# run the meta-server process (example entrypoint)
python -m mcp_creator.app --host 0.0.0.0 --port 8000

Environment variables (examples)

  • MCP_CREATOR_HOST — host for the meta-server (default: 0.0.0.0)
  • MCP_CREATOR_PORT — port for the meta-server (default: 8000)
  • OUTPUT_DIR — directory where generated servers and configs are written

You can override these values on the command line or via a .env file depending on your setup.

Available Resources

  • GitHub repository: https://github.com/GongRzhe/MCP-Server-Creator
  • Template files: Jinja2 or similar templates for config and Python server entrypoints
  • Example clients: a small CLI and Python snippets illustrating the API
  • Docker support: Dockerfile for containerized meta-server (if provided in the repo)
  • Generated output: YAML/JSON config files plus Python modules you can launch directly

Example API usage

Create a new FastMCP server bundle via HTTP:

curl -X POST "http://localhost:8000/create" \
  -H "Content-Type: application/json" \
  -d '{
    "server_name": "test-model-1",
    "model": "gpt-example",
    "port": 5100,
    "max_tokens": 512,
    "context_window": 4096
  }'

Typical response:

{
  "status": "created",
  "bundle_path": "/tmp/mcp_servers/test-model-1/",
  "config_file": "fastmcp_config.yml",
  "entrypoint": "run_server.py"
}

Python client example:

import requests

payload = {
    "server_name": "dev-sentiment",
    "model": "sentiment-lite",
    "port": 5200
}
r = requests.post("http://localhost:8000/create", json=payload)
print(r.json())

After generation, start the emitted server:

cd /tmp/mcp_servers/dev-sentiment
python run_server.py
# or use the provided Dockerfile to containerize the generated bundle

Common configuration keys

KeyTypeDescription
server_namestringIdentifier used for filenames and directories
modelstringModel backend name or path
portintegerTCP port for the generated FastMCP server
max_tokensintegerMaximum generated tokens
context_windowintegerModel context size
workersintegerNumber of worker processes to spawn
envmapEnvironment variables to inject into the generated runtime

Use Cases

  • Local development: spin up a disposable model server to debug integrations without altering a shared host.
  • CI pipelines: generate and run short-lived model servers as part of integration tests to verify client behavior.
  • A/B testing: quickly create multiple server variants with different model settings or token limits to compare outputs.
  • Education and demos: provide students or stakeholders with ready-to-run server packages that illustrate model hosting patterns.
  • Edge prototypes: produce lightweight FastMCP servers configured for constrained resources for proof-of-concept deployments.

Extending and Best Practices

  • Templates: extend or replace provided templates to customize logging, metrics, authentication, or model-loading behavior.
  • Validation: the meta-server validates inputs; ensure production deployments add stricter policies (e.g., allowed model lists).
  • Security: restrict access to the meta-server API in production and sanitize model identifiers to prevent path traversal.
  • Artifact storage: use a persistent artifact store (S3, artifact registry) for generated bundles if they need to be preserved across restarts.

For full details and examples, see the repository: https://github.com/GongRzhe/MCP-Server-Creator.