Skip to main content
Glama

mcp-toolforge

Un servidor meta-MCP que genera nuevos servidores MCP a partir de descripciones de herramientas en lenguaje natural.

A partir de un nombre de proyecto, una descripción breve y una lista de descripciones de herramientas en lenguaje natural (p. ej., "fetches the weather for a string city and returns a string summary"), mcp-toolforge escribe un proyecto de servidor MCP completo y ejecutable — esquema, implementación, pruebas con aserciones reales, README, LICENSE — listo para instalar y ejecutar.

flowchart TD
    subgraph Client_Layer["AI Client / Claude Desktop"]
        A["Client (Claude, Cursor, etc.)"]
    end
    subgraph Meta_Server["mcp-toolforge (this repo)"]
        M["mcp_toolforge.server"]
        G["mcp_toolforge.generator"]
    end
    subgraph Generated["Generated Server Project"]
        P["src/<pkg>/__init__.py"]
        S["src/<pkg>/server.py"]
        T["tests/test_<pkg>.py"]
        R["README.md"]
        L["LICENSE"]
        PP["pyproject.toml"]
    end

    A -- "MCP stdio JSON-RPC" --> M
    M -- "generate_server tool call" --> G
    G -- "writes files" --> P
    G -- "writes files" --> S
    G -- "writes files" --> T
    G -- "writes files" --> R
    G -- "writes files" --> L
    G -- "writes files" --> PP

Arquitectura

┌─────────────────────┐     ┌──────────────────────────┐
│   AI Client         │  stdio  │  mcp-toolforge server  │
│ (Claude, Cursor)    │──JSON──│  (this repo)           │
└─────────────────────┘  RPC    └────────┬───────────────┘
                                          │ generate_server
                                          │  (name, description,
                                          │   tool_descriptions, dest)
                                          ▼
                        ┌────────────────────────────────────┐
                        │  generator.generate_project()      │
                        │  parses NL → ToolSpec → ServerSpec │
                        │  renders: pyproject, server.py,    │
                        │  tests, README, LICENSE            │
                        └────────────────────────────────────┘
                                          │
                        ┌─────────────────┴─────────────────┐
                        │  Example generated servers         │
                        │  • examples/weather_server         │
                        │  • examples/todo_server            │
                        │  • examples/math_server            │
                        └────────────────────────────────────┘

Related MCP server: MCP Server Generator

Inicio rápido

Instalar mcp-toolforge

pip install -e ".[dev]"

Ejecutar mcp-toolforge como meta-servidor

Como servidor MCP (transporte stdio):

{
  "mcpServers": {
    "mcp-toolforge": {
      "command": "python",
      "args": ["-m", "mcp_toolforge.server"],
      "cwd": "/path/to/mcp-toolforge"
    }
  }
}

Ejecutar mcp-toolforge como CLI que genera un proyecto de servidor independiente

# Interactive wizard
mcp-toolforge -i

# One-shot
mcp-toolforge \
  --name my_server \
  --description "A server that does X" \
  --tool "fetches the weather for a string city and returns a string summary" \
  --dest ./my_server

Usar la herramienta generate_server

Cuando mcp-toolforge está registrado como servidor MCP, un agente de IA puede llamar a la herramienta:

generate_server(
  name="my_server",
  description="A server that does X",
  tool_descriptions=[
    "fetches the weather for a string city and returns a string summary",
    "adds a string task and returns a string confirmation"
  ],
  dest="/path/to/output"  # optional, defaults to /tmp/mcp-toolforge-gen
)

La herramienta escribe un proyecto completo en dest/<package_name>/ y devuelve una cadena de resumen. A continuación, el servidor generado se puede instalar y registrar de manera independiente en tu cliente MCP.

Cómo funciona el análisis de lenguaje natural

Cada descripción de herramienta debe seguir el patrón:

<VERB> [a/an] <type> <name> [, <type> <name>] ... and returns <type> <description>

Ejemplos:

Descripción

Nombre de la herramienta

Parámetros

fetches the weather for a string city and returns a string summary

fetch

city: string

adds a string task and returns a string confirmation

add

task: string

multiplies two numbers given a number a and number b and returns a number product

multiply

a: number, b: number

lists all todos and returns an array of todo items

list

query: string (respaldo)

Tipos de parámetros reconocidos: string, integer, number, boolean, array. Si no se detectan parámetros tipados, se infiere un parámetro query: string de forma libre.

Ejemplos

En examples/ se generan tres servidores de ejemplo:

Servidor

Paquete

Herramientas

Descripción

WeatherServer

weather_server

fetch, forecast

Obtiene información meteorológica

TodoServer

todo_server

add, list, remove

Gestiona una lista de tareas

MathServer

math_server

add, multiply, compute

Herramientas aritméticas

Cada ejemplo es un servidor MCP totalmente funcional con sus propias pruebas:

cd examples/math_server
pip install -e .
pytest

Desarrollo

# Install with dev dependencies
pip install -e ".[dev]"

# Run all tests
pytest

# Run end-to-end test against the meta-server over stdio
python e2e_test.py

# Regenerate examples
python make_examples.py

Pruebas

  • tests/test_generator.py — 16 pruebas del generador (análisis, inferencia de esquema, renderizado de archivos, creación de proyectos)

  • tests/test_server.py — 5 pruebas del servidor meta-MCP (listado de herramientas, invocación de herramientas, manejo de errores)

  • e2e_test.py — prueba de extremo a extremo que ejecuta el meta-servidor como subproceso stdio real y se conecta con un Client de MCP

  • Cada servidor de ejemplo incluye 4 pruebas (12 en total entre los 3 ejemplos)

Todas las pruebas usan aserciones reales y verifican la salida real de los archivos / resultados de las herramientas.

Licencia

MIT — ver LICENSE.

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    An intelligent tool that automates the setup of new Model Context Protocol (MCP) server projects through a conversational interface. It generates project structures, technical specifications, and context-rich documentation to streamline AI-assisted development in TypeScript or Python.
    10
    3
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Generates production-ready MCP servers with dual-mode (MCP + CLI) architecture, tests, and documentation. Includes progressive disclosure tools for AI agents and best practices guidance.
    7
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Automatically generates MCP server tools from OpenAPI specifications, enabling LLMs to interact with any API defined by an OpenAPI spec through natural language.
    13 npm
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Generates complete, runnable MCP server projects from natural-language tool descriptions, including schema, implementation, tests, README, and license. It enables AI agents to scaffold standalone MCP servers ready to install and run.
    MIT