Codebase to MCP Tool

v1.0.0Developer Toolsstable

One command to turn any codebase into an MCP server. Not just REST APIs. Not just OpenAPI specs.

aianthropicautomationclaudecli
Share:
36
Stars
0
Downloads
0
Weekly
0/5

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

Convert codebases to MCP servers
REST API automation
Type-MCP

Maintainer

LicenseApache 2.0
Languagepython
Versionv1.0.0
UpdatedMay 8, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-anything

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

Install mcp-anything

Install the package from PyPI using pip.

pip install mcp-anything
2

Set 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"
3

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"
4

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-server
5

Use 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-server
6

Configure 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"]
#     }
#   }
# }
7

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/mcp

Codebase 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.

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.

Quick Config Preview

{ "mcpServers": { "mcp-anything": { "command": "npx", "args": ["-y", "mcp-anything"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides