Skip to main content
Glama

mcp-toolforge

一个 meta-MCP 服务器,可根据自然语言工具描述生成新的 MCP 服务器。

给定项目名称、简短描述以及一组自然语言工具描述(例如 `"fetches the weather for a string city and returns a string summary"` ),mcp-toolforge 会写入一个完整、可运行的 MCP 服务器项目——schema、实现、带真实断言的测试、README、LICENSE——可直接安装并运行。

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

架构

┌─────────────────────┐     ┌──────────────────────────┐
│   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-creator

快速开始

安装 mcp-toolforge

pip install -e ".[dev]"

运行 mcp-toolforge 本身(meta 服务器)

作为 MCP 服务器(stdio 传输):

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

或者作为 CLI 生成独立的服务器项目:

# 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

使用 generate_server 工具

当 mcp-toolforge 被注册为 MCP 服务器时,AI 智能体可以调用:

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
)

该工具会把一个完整项目写入 dest/<package_name>/ 并返回一个摘要字符串,随后生成的服务器可以独立安装并注册到你的 MCP 客户端。

自然语言解析的工作原理

每个工具描述都应遵循如下模式:

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

示例:

描述

工具名称

参数

fetches the weather for a 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(回退)

可识别的参数类型:stringintegernumberbooleanarray。如果检测不到带类型的参数,则推断一个自由格式的 query: string 参数。

示例

本文档在 examples/ 下生成三个示例服务器:

服务器

包名

工具

描述

WeatherServer

weather_server

fetchforecast

获取天气信息

TodoServer

todo_server

addlistremove

管理待办事项列表

MathServer

math_server

addmultiplycompute

算术工具

每一个示例都是一台可以正常运行的 MCP 服务器,并自带测试:

cd examples/math_server
pip install -e .
pytest

开发

# 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

测试

  • tests/test_generator.py — 16 个测试,用于生成器(解析、schema 推断、文件渲染、项目创建)

  • tests/test_server.py — 5 个测试,用于 meta-MCP 服务器(工具列举、工具调用、错误处理)

  • e2e_test.py — 端到端测试,以真实 stdio 子进程方式运行 meta-MCP 服务器,并通过 MCP Client 进行连接

  • 每个示例服务器自带 4 个测试(3 个示例共 12 个)

所有测试均使用真实断言,并校验实际文件输出 / 工具结果。

许可协议

MIT — 见 LICENSE

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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
    A tool that enables AI assistants to conversationally scaffold, build, and publish Python MCP servers to PyPI. It automates the entire development lifecycle, including package naming, tool scaffolding, GitHub repository setup, and package publishing.
    10
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A production-ready Python scaffold for building Model Context Protocol (MCP) servers using FastMCP. It provides a structured framework for developers and AI agents to rapidly develop, test, and manage custom tools and workflows.
    1
  • 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

View all related MCP servers

Related MCP Connectors

  • MCP server for generating rough-draft project plans from natural-language prompts.

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/prem-the-dev/mcp-toolforge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server