MCP服务器自动生成器

一款通过自然语言描述自动生成生产就绪的MCP服务器的工具,支持多种服务和API集成。

  • by Coutinho072
  • Jinja
  • 本地部署
  • 更新于
在 GitHub 查看 Coutinho072/mcp-auto-builder

使用说明

MCP Auto-Builder Skill

Autonomous MCP (Model Context Protocol) server generator for Claude Code.

What It Does

Generates complete, production-ready MCP servers from natural language descriptions:

  • FastMCP server code with all tools
  • Docker containerization with security hardening
  • Comprehensive test suite
  • Complete documentation
  • Automatic Claude Desktop integration

Usage

Just describe what you want:

"Create an MCP server that lets me manage my GitHub repositories"
"I need an MCP server to check my Google Calendar"
"Build an MCP server for querying my PostgreSQL database"

Claude will ask clarifying questions and generate everything automatically.

Prerequisites

  • Python 3.11+
  • uv package manager
  • Docker (optional, for containers)

Install uv:

curl -LsSf https://astral.sh/uv/install.sh | sh

Generated Project Structure

~/mcp-servers/[project-name]/
├── src/[module]/server.py    # FastMCP server with tools
├── tests/test_server.py       # Comprehensive test suite
├── Dockerfile                 # Docker configuration
├── docker-compose.yml         # Docker Compose setup
├── pyproject.toml             # Python project config
├── README.md                  # Full project documentation
└── USAGE.md                   # Detailed setup guide

Supported Services

Pre-built Patterns

Version Control:

  • GitHub, GitLab, Bitbucket

Communication:

  • Slack, Discord, Microsoft Teams

Project Management:

  • Jira, Linear, Trello, Todoist

Calendar & Scheduling:

  • Google Calendar, Outlook Calendar

Databases:

  • PostgreSQL, MySQL, MongoDB

Custom APIs:

  • Any REST API with API key or OAuth

File Structure

mcp-auto-builder/
├── SKILL.md                      # Main skill (orchestration)
├── README.md                     # This file
├── reference/                    # Technical documentation
│   ├── generation_workflow.md   # Implementation notes
│   ├── code_templates.md        # FastMCP patterns
│   ├── api_integration_patterns.md # Service patterns
│   ├── validation_checklist.md  # QA procedures
│   └── troubleshooting.md       # Common issues
└── templates/                    # Jinja2 templates
    ├── server_base.py.jinja2    # Server code template
    ├── Dockerfile.jinja2        # Docker template
    └── ...

Workflow

  1. Requirements Gathering - Interactive questions
  2. Project Scaffolding - Create directory structure
  3. Code Generation - Generate server with all tools
  4. Docker Configuration - Security-hardened containers
  5. Testing - Comprehensive test suite
  6. Integration - Update Claude Desktop config
  7. Handoff - Complete instructions to user

Example: GitHub Integration

User: Create an MCP server for GitHub

Claude: [Generates complete server]

Generated tools:
- create_issue(repo, title, body)
- list_repos(username)
- search_code(query)
- create_pr(repo, title, head, base)

Next steps:
1. Add token: echo "ghp_xxx" > secrets/github_token.txt
2. Test: uv run python src/github_mcp/server.py
3. Restart Claude Desktop

Troubleshooting

Skill Doesn't Activate

Use phrases like:

  • "Create an MCP server"
  • "Build an MCP server for [service]"
  • "Integrate Claude with [API]"

Generation Fails

Check prerequisites:

which uv          # uv installed?
python --version  # Python 3.11+?
docker info       # Docker running?

Generated Server Issues

See the generated project's USAGE.md:

cd ~/mcp-servers/[project-name]
cat USAGE.md

Common fixes:

  • Add credentials to secrets/ directory
  • Run uv sync to install dependencies
  • Restart Claude Desktop
  • Check Claude Desktop logs

Best Practices

  1. Be specific in requests

    • "Create a GitHub MCP server for managing issues"
    • Better than: "I need GitHub integration"
  2. Test immediately after generation

    • Run local tests first
    • Use MCP Inspector for debugging
    • Verify in Claude Desktop
  3. Customize as needed

    • Generated code is a starting point
    • Add more tools following patterns
    • Extend functionality
  4. Keep secrets secure

    • Never commit secrets/ directory
    • Use environment variables in production
    • Rotate credentials regularly

Resources

MCP Documentation:

  • Official Spec: https://modelcontextprotocol.io
  • FastMCP: https://gofastmcp.com

Docker Resources:

  • Docker MCP Guide: https://www.docker.com/blog/mcp-toolkit

Claude Code:

  • Skills Documentation: https://docs.claude.com/en/docs/claude-code/skills

Version

v1.0.0

License

MIT License


Transform your ideas into working MCP servers in minutes!