Codebase to MCP Tool
One command to turn any codebase into an MCP server. Not just REST APIs. Not just OpenAPI specs.
What is Codebase to MCP Tool?
Codebase to MCP Tool is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to one command to turn any codebase into an mcp server. not just rest apis. not just openapi specs.
One command to turn any codebase into an MCP server. Not just REST APIs. Not just OpenAPI specs.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- One command to turn any codebase into an MCP server. Not jus
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-anythingConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Codebase to MCP Tool
mcp-anything is a Python CLI tool that converts any codebase, REST API, OpenAPI spec, GraphQL schema, or gRPC definition into a fully packaged MCP server in one command. It uses an LLM (via the Anthropic API) in build mode to read a YAML brief describing your domain and generate optimized tool groupings, or operates with static code analysis alone in generate mode. Developers use it to rapidly expose existing internal APIs and applications to AI assistants without manually writing MCP server boilerplate or tool definitions.
Prerequisites
- Python 3.10 or higher with pip installed
- ANTHROPIC_API_KEY required for build mode (LLM-assisted generation); generate mode works without it
- Source code, an OpenAPI/Swagger spec, GraphQL schema, or gRPC proto files for the API you want to expose
- An MCP-compatible client such as Claude Desktop to test the generated server
Install mcp-anything
Install the package from PyPI using pip.
pip install mcp-anythingSet your Anthropic API key (for build mode)
If you plan to use build mode (recommended), export your Anthropic API key so mcp-anything can use Claude to analyze your codebase and generate optimized tools.
export ANTHROPIC_API_KEY="sk-ant-your-key-here"Create a YAML brief describing your API (build mode)
Write a YAML file describing your domain, API, and use cases. mcp-anything reads this brief to understand what your API does and how to group operations into well-designed MCP tools.
# brief.yaml
domain: "Customer Support API"
base_url: "https://api.yourapp.com"
use_cases:
- "Look up customer accounts and orders"
- "Create and update support tickets"
- "Search knowledge base articles"
source: "./openapi.yaml"Generate the MCP server
Run mcp-anything in build mode with your brief file. It will analyze your source and generate a complete server package including server.py, tools, SKILL.md, tests, and a Dockerfile.
mcp-anything build --brief brief.yaml --output ./my-mcp-serverUse generate mode for static analysis (no LLM required)
If you prefer not to use an LLM, generate mode performs static analysis on your source files directly. It supports 27 source types including FastAPI, Django, Express, Spring Boot, and OpenAPI specs.
mcp-anything generate --source ./openapi.yaml --output ./my-mcp-serverConfigure your MCP client to use the generated server
Install the generated server package and add it to your Claude Desktop configuration.
cd my-mcp-server
pip install -e .
# Then add to your claude_desktop_config.json:
# {
# "mcpServers": {
# "my-api": {
# "command": "python",
# "args": ["-m", "my_mcp_server.server"]
# }
# }
# }Test via the discovery endpoint
Each generated server exposes a /.well-known/mcp endpoint that lists all available tools, useful for verifying what was generated.
# Start the server with HTTP transport and check the discovery endpoint
curl http://localhost:8000/.well-known/mcpCodebase to MCP Tool Examples
Client configuration
Claude Desktop configuration for a generated MCP server installed as a Python package.
{
"mcpServers": {
"my-api": {
"command": "python",
"args": ["-m", "my_mcp_server.server"],
"env": {
"API_BASE_URL": "https://api.yourapp.com",
"API_KEY": "your_api_key_here"
}
}
}
}Prompts to try
Example prompts for a generated server wrapping a customer support API.
- "Generate an MCP server from my FastAPI application in ./backend/"
- "Convert the OpenAPI spec at ./api/openapi.yaml into an MCP server"
- "Look up customer account for email [email protected]"
- "Create a support ticket for customer 12345 about billing issue"
- "Search the knowledge base for articles about password reset"Troubleshooting Codebase to MCP Tool
Build mode fails with API key errors
Ensure ANTHROPIC_API_KEY is set correctly in your shell environment (export ANTHROPIC_API_KEY=sk-ant-...). If you do not have an Anthropic API key, use generate mode instead which performs static analysis without an LLM.
Generated server tools do not cover all the API endpoints you expected
Refine your brief.yaml to include more specific use cases, or add more detail to the domain description. In generate mode, ensure your OpenAPI/source files are complete and well-documented, as the static analysis depends on accurate specs.
The generated server.py fails to start with import errors
Install the generated package dependencies with pip install -e . from inside the output directory. The generated package includes a pyproject.toml or requirements.txt listing all required dependencies including httpx and fastmcp.
Frequently Asked Questions about Codebase to MCP Tool
What is Codebase to MCP Tool?
Codebase to MCP Tool is a Model Context Protocol (MCP) server that one command to turn any codebase into an mcp server. not just rest apis. not just openapi specs. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Codebase to MCP Tool?
Follow the installation instructions on the Codebase to MCP Tool GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Codebase to MCP Tool?
Codebase to MCP Tool works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Codebase to MCP Tool free to use?
Yes, Codebase to MCP Tool is open source and available under the Apache 2.0 license. You can use it freely in both personal and commercial projects.
Codebase to MCP Tool Alternatives — Similar Developer Tools Servers
Looking for alternatives to Codebase to MCP Tool? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Codebase to MCP Tool in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Codebase to MCP Tool?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.