Transform any API into an MCP server in seconds, not hours
gen-mcp eliminates the complexity of building Model Context Protocol (MCP) servers. Instead of writing boilerplate code and learning protocol internals, simply describe your tools in a configuration fileβgen-mcp handles the rest.
Perfect for:
- π API Developers - Expose existing REST APIs to AI assistants instantly
- π€ AI Engineers - Connect LLMs to external tools without custom server code
- π οΈ DevOps Teams - Integrate legacy systems with modern AI workflows
- π Zero-Code Server Generation - Create MCP servers from simple YAML configs
- π‘ OpenAPI Auto-Conversion - Transform existing OpenAPI specs into MCP servers instantly
- π Real-Time Tool Exposure - HTTP endpoints become callable AI tools automatically
- π‘οΈ Built-in Validation - Schema validation and type safety out of the box
- π Security Out of the Box - TLS encryption and OAuth/OIDC authentication built-in
- β‘ Background Processing - Detached server mode with process management
- π§ Flexible Configuration - Fine-tune which endpoints to expose and how they behave
Option A: Download Pre-built Binary
# Download from GitHub releases
# Visit: https://github.com/genmcp/gen-mcp/releases
# Or using curl (replace with latest version):
curl -L https://github.com/genmcp/gen-mcp/releases/latest/download/genmcp-linux-amd64 -o genmcp
chmod +x genmcp
sudo mv genmcp /usr/local/bin
Option B: Build from Source
# Clone and build
git clone https://github.com/genmcp/gen-mcp.git
cd gen-mcp
# Build CLI
make build-cli
# Add to PATH (recommended)
sudo mv genmcp /usr/local/bin
Option A: Convert Existing API
genmcp convert https://api.example.com/openapi.json
genmcp run
Option B: Create Custom Tools
# Create mcpfile.yaml with your tools (see documentation)
genmcp run
- MCP File Format Guide - Learn to write custom tool configurations
- Examples Directory - Real-world integration examples
Command | Description | Example |
---|---|---|
run |
Start MCP server | genmcp run -f myapi.yaml |
stop |
Stop running server | genmcp stop |
convert |
OpenAPI β MCP conversion | genmcp convert api-spec.json |
build |
Build container image from mcpfile | genmcp build -f myapi.yaml --tag myapi:latest |
version |
Display version information | genmcp version |
# Run in foreground (development)
genmcp run -f /path/to/mcpfile.yaml
# Run in background
genmcp run -d
# Auto-detect mcpfile.yaml in current directory
genmcp run
# From local OpenAPI file
genmcp convert ./api-spec.json
# From remote OpenAPI URL
genmcp convert https://api.example.com/openapi.json -o custom-name.yaml
# Petstore example
genmcp convert https://petstore.swagger.io/v2/swagger.json
Instead of manually writing an MCP file for a CLI, you can use an LLM to generate a genmcp-compatible mcpfile.yaml.
# Set OpenAI endpoint configurations
export MODEL_BASE_URL='https://HOST:PORT/v1' # OpenAI Base URL (v1 endpoint)
export MODEL_KEY='' # OpenAI Access Token
export MODEL_NAME='' # OpenAI Model Name
# Run gen-mcp convert-cli to generate mcpfile.yaml
MODEL_BASE_URL=$MODEL_BASE_URL MODEL_KEY=$MODEL_KEY MODEL_NAME=$MODEL_NAME genmcp convert-cli "podman images"
# Start mcpserver with generated mcpfile.yaml
genmcp run
# Stop server (uses mcpfile.yaml to find process)
genmcp stop
# Stop specific server
genmcp stop -f /path/to/mcpfile.yaml
To improve the development experience and prevent configuration errors, this project includes a JSON schema for the mcpfile.yaml
format. This schema enables validation, autocompletion, and inline documentation in compatible code editors like Visual Studio Code, helping you write valid configuration files faster.
To make use of the schema, add a yaml-language-server
comment at the top of your mcpfile.yaml
:
# yaml-language-server: $schema=https://raw.githubusercontent.com/genmcp/gen-mcp/refs/heads/main/specs/mcpfile-schema.json
mcpFileVersion: 0.1.0
name: ...
Intellij IDEs support JSON schema validation natively.
VS Code requires the installation of the YAML extension by Red Hat.
Connect local language models to MCP Clients with gen-mcp in two ways: by wrapping the Ollama CLI, and by wrapping the Ollama http endpoints.
Features:
- β HTTP REST API integration
- β CLI command execution
- β Model management tools
Transform any REST API into MCP tools automatically:
# 1. Convert OpenAPI spec
genmcp convert http://localhost:9090/openapi.json
# 2. Run the generated MCP server
genmcp run
Demonstrates:
- π Automatic OpenAPI β MCP conversion
- π οΈ Path parameter substitution (
/features/{id}
) - π Schema validation and type safety
- π― Selective endpoint exposure
Expose existing gRPC services to LLMs without modifying service code:
Architecture:
- Uses gRPC-Gateway to create an HTTP/JSON proxy
- Exposes the HTTP proxy as MCP tools via gen-mcp
- Works with any gRPC service using only
.proto
definitions
Perfect for:
- π’ Integrating legacy gRPC services with AI workflows
- π Bridging binary gRPC with JSON-based LLM interfaces
- π Getting started before native gRPC support arrives
Note: This is a workaround pattern until gen-mcp adds native gRPC support.
We welcome contributions! This is an early-stage research project with lots of room for improvement.
git clone https://github.com/genmcp/gen-mcp.git
cd gen-mcp
go test ./...
# Build local binary
make build-cli
Apache 2.0 License - see LICENSE file for details.
- Model Context Protocol - Official MCP documentation
- MCP File Format - gen-mcp configuration reference
- Examples - Real-world integration examples
- gRPC Integration Demo - Pattern for exposing gRPC services via HTTP proxy