Labsco
BrunoKrugel logo

echo-mcp

โ˜… 9

from BrunoKrugel

Automatically convert any Echo API to a MCP Tool

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

MCP Wrapper for Echo Framework

Go Report Card

Wrap any existing Echo API into MCP tools and enable AI agents to interact with your API through Model Context Protocol.

Inspired by gin-mcp but for the Echo framework.

Key Features

  • Zero Configuration: Works with any existing Echo API
  • Multiple Schema Sources: Support for Swaggo, raw OpenAPI YAML/JSON, and manual schemas
  • Filtering: Include/exclude endpoints with wildcard patterns
  • MCP Compatible: Works with any agent that supports MCP.

Schema Generation Methods

Echo-MCP supports four schema generation approaches, with automatic fallback:

MethodUse CasePriority
Raw OpenAPI SchemaUsing OpenAPI libraries like swaggest/openapi-goFirst (if OpenAPISchema is set)
SwaggerProduction APIs with Swaggo annotationsFirst (if EnableSwaggerSchemas is set)
ManualFine-grained control, complex validationSecond
AutomaticQuick prototyping, simple endpointsFallback
// Option 1: Using raw OpenAPI schema (swaggest/openapi-go, etc.)
schema, _ := reflector.Spec.MarshalYAML()
mcp := server.New(e, &server.Config{
    OpenAPISchema: string(schema), // Use raw schema
})

// Option 2: Using Swaggo
mcp := server.New(e, &server.Config{
    EnableSwaggerSchemas: true, // Load from swaggo docs
})

// Option 3: Manual schemas for fine-grained control
mcp.RegisterSchema("POST", "/users", nil, CreateUserRequest{})

// Option 4: Automatic inference (fallback)
// No configuration needed - routes will use basic path/body inference

MCP Client Integration

Once your server is running:

Manual configuration

{
  "mcpServers": {
    "echo-api": {
      "type": "http",
      "url": "http://localhost:8080/mcp",
      "timeout": 120
    },
  }
}

Local Testing

For local testing, use MCP Inspector:

npx @modelcontextprotocol/inspector http://localhost:8080/mcp