Cover image
Try Now
2025-03-31

Crear servidor MCP para cualquier API

3 years

Works with Finder

1

Github Watches

0

Github Forks

1

Github Stars

API Wrapper MCP Server

This is a generic API wrapper server for the Model Context Protocol (MCP). It allows you to easily wrap REST APIs as MCP tools that can be accessed by Claude and other MCP clients.

Features

  • Easy YAML configuration for multiple API endpoints
  • Support for both GET and POST requests
  • Parameter validation and default values
  • Authentication via environment variables
  • Custom timeouts for API calls

Usage

  1. Create a YAML configuration file defining your API endpoints (see example-config.yaml)
  2. Set any required API tokens as environment variables
  3. Run the server with your config file:
# Build the server
go build -o api_wrapper

# Run with your config
./api_wrapper my-apis.yaml

Configuration Format

The configuration file uses YAML format with the following structure:

# Server info
server:
  name: "API Gateway MCP"
  description: "Generic API gateway that wraps REST APIs as MCP tools"
  version: "1.0.0"
  
# Authentication
auth:
  token_env_var: "API_GATEWAY_TOKEN"  # Environment variable for the API token

# Tool definitions
tools:
  - name: "tool-name"
    description: "Tool description"
    endpoint: "https://api.example.com/endpoint"
    method: "POST"  # or "GET"
    timeout: 30  # in seconds
    template: |
      {
        "param1": "{{variable1}}",
        "param2": {{variable2}}
      }
    # For GET requests, use query_params
    query_params:
      param1: "{{variable1}}"
      param2: "{{variable2}}"
    parameters:
      variable1:
        type: "string"
        description: "Description of variable1"
        required: true
      variable2:
        type: "number"
        description: "Description of variable2"
        default: 10

Claude Desktop Integration

To use with Claude Desktop, add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "api-wrapper": {
      "command": "path/to/api_wrapper",
      "args": ["path/to/your-config.yaml"],
      "env": {
        "API_GATEWAY_TOKEN": "your-api-token"
      }
    }
  }
}

Examples

Check out example-config.yaml for sample API configurations.

Environment Variables

  • Set the main authentication token using the environment variable specified in the auth.token_env_var field.
  • You can also reference other environment variables in your templates using {{env:VARIABLE_NAME}} syntax.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • J. DE HARO OLLE
  • Especialista en juegos de palabras en varios idiomas.

  • albert tan
  • Japanese education, creating tailored learning experiences.

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • jae-jae
  • Servidor MCP para obtener contenido de la página web con el navegador sin cabeza de dramaturgo.

  • HiveNexus
  • Un bot de chat de IA para equipos pequeños y medianos, que apoyan modelos como Deepseek, Open AI, Claude y Gemini. 专为中小团队设计的 ai 聊天应用 , 支持 Deepseek 、 Open ai 、 Claude 、 Géminis 等模型。

  • ravitemer
  • Un poderoso complemento Neovim para administrar servidores MCP (protocolo de contexto del modelo)

  • patruff
  • Puente entre los servidores Ollama y MCP, lo que permite a LLM locales utilizar herramientas de protocolo de contexto del modelo

    Reviews

    1 (1)
    Avatar
    user_kxSUCwjq
    2025-04-16

    As a dedicated user of the api-wrapper-mcp, I must say it has significantly streamlined my API interactions. The clear documentation and easy-to-use interface, provided by gomcpgo, make it an essential tool for developers. Its seamless integration and robust functionalities are impressive, aiding in efficient development workflows. Highly recommend checking it out at https://github.com/gomcpgo/api-wrapper-mcp.