gen-mcp

module
v0.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2025 License: Apache-2.0

README ΒΆ

gen-mcp: Zero-Code MCP Server Generation

Transform any API into an MCP server in seconds, not hours

Go Version License MCP Compatible

⚠️ Early Preview: This is a research project in active development. APIs and features may change.

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

gen-mcp System Diagram

✨ Key Features

  • πŸš€ 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

πŸš€ Quick Start

1. Install gen-mcp

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
go build -o genmcp ./cmd/genmcp

# Add to PATH (recommended)
sudo mv genmcp /usr/local/bin
2. Choose Your Own Adventure

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
3. See It In Action

πŸ“– Documentation

πŸ’» Usage

Core Commands
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
Starting Your Server
# 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
Converting Existing APIs
# 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
Managing Running Servers
# Stop server (uses mcpfile.yaml to find process)
genmcp stop

# Stop specific server
genmcp stop -f /path/to/mcpfile.yaml

πŸ“š Examples & Tutorials

πŸ€– Ollama Integration

πŸ“Ή Watch Demo | View Code

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
πŸ”— HTTP API Conversion

πŸ“Ή Watch Demo | View Code

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

🀝 Contributing

We welcome contributions! This is an early-stage research project with lots of room for improvement.

Development Setup
git clone https://github.com/genmcp/gen-mcp.git
cd gen-mcp
go test ./...

# Build local binary
go build -o genmcp ./cmd/genmcp

πŸ“„ License

Apache 2.0 License - see LICENSE file for details.


Made with ❀️ for the AI development community

Directories ΒΆ

Path Synopsis
cmd
genmcp command
genmcp-server command
examples
pkg
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL