Logo de OpenAPI到模型上下文协议(MCP)

OpenAPI到模型上下文协议(MCP)

Comunidade
gujord

The OpenAPI-MCP proxy translates OpenAPI specs into MCP tools, enabling AI agents to access external APIs without custom wrappers!

Publicado porgujord
RepositórioOpenAPI-MCP
IdiomaPython
Forks
11
Estrelas
69
Ferramentas disponíveis
0
Tipo de transportestdio, streamable-http
Categorias
LicençaMIT
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    OpenAPI到模型上下文协议(MCP) disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 0 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    69 estrelas e 11 forks no repositório vinculado.

OpenAPI to Model Context Protocol (MCP)

PyPI version License: MIT Repo Size Last Commit Open Issues Python version

The OpenAPI-MCP proxy translates OpenAPI specs into MCP tools, enabling AI agents to access external APIs without custom wrappers!

OpenAPI-MCP

Bridge the gap between AI agents and external APIs

The OpenAPI to Model Context Protocol (MCP) proxy server bridges the gap between AI agents and external APIs by dynamically translating OpenAPI specifications into standardized MCP tools, resources, and prompts. This simplifies integration by eliminating the need for custom API wrappers.

Built with FastMCP following official MCP patterns and best practices, the server provides:

  • ✅ Official FastMCP Integration - Uses the latest FastMCP framework for optimal performance

  • ✅ Proper MCP Transport - Supports stdio, SSE, and streamable HTTP transports

  • ✅ Modular Architecture - Clean separation of concerns with dependency injection

  • ✅ Production Ready - Robust error handling, comprehensive logging, and type safety

  • Repository: https://github.com/gujord/OpenAPI-MCP


If you find it useful, please give it a ⭐ on GitHub!


Key Features

Core Functionality

  • FastMCP Transport: Optimized for stdio, working out-of-the-box with popular LLM orchestrators.
  • OpenAPI Integration: Parses and registers OpenAPI operations as callable tools.
  • Resource Registration: Automatically converts OpenAPI component schemas into resource objects with defined URIs.
  • Prompt Generation: Generates contextual prompts based on API operations to guide LLMs in using the API.
  • Dual Authentication: Supports both OAuth2 Client Credentials flow and username/password authentication with automatic token caching.
  • MCP HTTP Transport: Official MCP-compliant HTTP streaming transport with JSON-RPC 2.0 over SSE.
  • Server-Sent Events (SSE): Legacy streaming support (deprecated - use MCP HTTP transport).
  • JSON-RPC 2.0 Support: Fully compliant request/response structure.

Advanced Features

  • Modular Architecture: Clean separation of concerns with dedicated modules for authentication, request handling, and tool generation.
  • Robust Error Handling: Comprehensive exception hierarchy with proper JSON-RPC error codes and structured error responses.
  • Auto Metadata: Derives tool names, summaries, and schemas from the OpenAPI specification.
  • Sanitized Tool Names: Ensures compatibility with MCP name constraints.
  • Flexible Parameter Parsing: Supports query strings, JSON, and comma-separated formats with intelligent type conversion.
  • Enhanced Parameter Handling: Automatically converts parameters to correct data types with validation.
  • Extended Tool Metadata: Includes detailed parameter information, response schemas, and API categorization.
  • CRUD Operation Detection: Automatically identifies and generates example prompts for Create, Read, Update, Delete operations.
  • MCP-Compliant Streaming: Official MCP HTTP transport for real-time streaming with proper session management.

Developer Experience

  • Configuration Management: Centralized environment variable handling with validation and defaults.
  • Comprehensive Logging: Structured logging with appropriate levels for debugging and monitoring.
  • Type Safety: Full type hints and validation throughout the codebase.
  • Extensible Design: Factory patterns and dependency injection for easy customization and testing.

🚀 Quick Start

Installation

Option 1: Using uvx (Recommended)

bash
# Run directly without installation
uvx openapi-mcp-proxy

# Or with environment variables
OPENAPI_URL="https://api.met.no/weatherapi/locationforecast/2.0/swagger" \
SERVER_NAME="weather" \
uvx openapi-mcp-proxy

Option 2: Using pip

bash
pip install openapi-mcp-proxy

# Then run
OPENAPI_URL="https://api.met.no/weatherapi/locationforecast/2.0/swagger" \
SERVER_NAME="weather" \
openapi-mcp

Option 3: From source

bash
git clone https://github.com/gujord/OpenAPI-MCP.git
cd OpenAPI-MCP
python3.12 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e .

🎯 Simple Usage

Quick Test (Norwegian Weather API)

bash
# Using uvx
OPENAPI_URL="https://api.met.no/weatherapi/locationforecast/2.0/swagger" \
SERVER_NAME="weather" \
uvx openapi-mcp

# Or using installed package
OPENAPI_URL="https://api.met.no/weatherapi/locationforecast/2.0/swagger" \
SERVER_NAME="weather" \
openapi-mcp

HTTP Transport (Recommended for Claude Desktop)

bash
# Start weather API with HTTP transport
OPENAPI_URL="https://api.met.no/weatherapi/locationforecast/2.0/swagger" \
SERVER_NAME="weather" \
MCP_HTTP_ENABLED="true" \
MCP_HTTP_PORT="8001" \
openapi-mcp

🔗 Claude Desktop Setup

1. Copy the provided configuration:

bash
cp claude_desktop_config.json ~/Library/Application\ Support/Claude/claude_desktop_config.json

2. Start the weather server:

bash
OPENAPI_URL="https://api.met.no/weatherapi/locationforecast/2.0/swagger" \
SERVER_NAME="weather" \
MCP_HTTP_ENABLED="true" \
MCP_HTTP_PORT="8001" \
openapi-mcp

3. Test in Claude Desktop:

  • Ask: "What's the weather in Oslo tomorrow?"
  • Claude will use the weather_get__compact tool automatically!

🌐 Multiple API Servers

Run multiple OpenAPI services simultaneously:

bash
# Terminal 1: Weather API
source venv/bin/activate && \
OPENAPI_URL="https://api.met.no/weatherapi/locationforecast/2.0/swagger" \
SERVER_NAME="weather" \
MCP_HTTP_ENABLED="true" \
MCP_HTTP_PORT="8001" \
python src/openapi_mcp/fastmcp_server.py

# Terminal 2: Petstore API  
source venv/bin/activate && \
OPENAPI_URL="https://petstore3.swagger.io/api/v3/openapi.json" \
SERVER_NAME="petstore" \
MCP_HTTP_ENABLED="true" \
MCP_HTTP_PORT="8002" \
python src/openapi_mcp/fastmcp_server.py

🐳 Docker Deployment

Quick start with Docker:

bash
# Start all services (weather + petstore)
./docker-start.sh

# Or manually
docker-compose up --build -d

This automatically runs:

  • Weather API on port 8001
  • Petstore API on port 8002

⚙️ Advanced Configuration

Claude Desktop / Cursor / Windsurf

HTTP Transport (Recommended):

Use the provided configuration file:

bash
cp claude_desktop_config.json ~/Library/Application\ Support/Claude/claude_desktop_config.json

Or create manually:

json
{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": ["mcp-remote", "http://127.0.0.1:8001/sse"]
    },
    "petstore": {
      "command": "npx", 
      "args": ["mcp-remote", "http://127.0.0.1:8002/sse"]
    }
  }
}

Stdio Transport (Alternative):

json
{
  "mcpServers": {
    "weather": {
      "command": "/full/path/to/OpenAPI-MCP/venv/bin/python",
      "args": ["/full/path/to/OpenAPI-MCP/src/openapi_mcp/fastmcp_server.py"],
      "env": {
        "SERVER_NAME": "weather",
        "OPENAPI_URL": "https://api.met.no/weatherapi/locationforecast/2.0/swagger"
      },
      "transport": "stdio"
    }
  }
}

Note: Replace /full/path/to/OpenAPI-MCP with your actual installation path.

With Local Spec and Custom Headers

json
{
  "mcpServers": {
    "local_api": {
      "command": "/full/path/to/OpenAPI-MCP/venv/bin/python",
      "args": ["/full/path/to/OpenAPI-MCP/src/openapi_mcp/fastmcp_server.py"],
      "env": {
        "SERVER_NAME": "local_api",
        "OPENAPI_URL": "./specs/my-api.yaml",
        "MCP_AUTH_HEADERS": "{\"X-API-Key\": \"your-key-here\"}"
      },
      "transport": "stdio"
    }
  }
}

With Username/Password Authentication

json
{
  "mcpServers": {
    "secure_api": {
      "command": "full_path_to_openapi_mcp/venv/bin/python",
      "args": ["full_path_to_openapi_mcp/src/openapi_mcp/fastmcp_server.py"],
      "env": {
        "SERVER_NAME": "secure_api",
        "OPENAPI_URL": "https://api.example.com/openapi.json",
        "API_USERNAME": "your_username",
        "API_PASSWORD": "your_password"
      },
      "transport": "stdio"
    }
  }
}

With OAuth2 Authentication

json
{
  "mcpServers": {
    "oauth_api": {
      "command": "full_path_to_openapi_mcp/venv/bin/python",
      "args": ["full_path_to_openapi_mcp/src/openapi_mcp/fastmcp_server.py"],
      "env": {
        "SERVER_NAME": "oauth_api",
        "OPENAPI_URL": "https://api.example.com/openapi.json",
        "OAUTH_CLIENT_ID": "your_client_id",
        "OAUTH_CLIENT_SECRET": "your_client_secret",
        "OAUTH_TOKEN_URL": "https://api.example.com/oauth/token"
      },
      "transport": "stdio"
    }
  }
}

Multiple API Servers with MCP HTTP Transport

Configure multiple OpenAPI services to run simultaneously:

json
{
  "mcpServers": {
    "weather": {
      "command": "npx",
      "args": [
        "mcp-remote", 
        "http://127.0.0.1:8001/sse"
      ]
    },
    "petstore": {
      "command": "npx", 
      "args": [
        "mcp-remote",
        "http://127.0.0.1:8002/sse" 
      ]
    }
  }
}

This configuration gives Claude access to both weather data AND petstore API tools simultaneously, with clear tool naming like weather_get__compact and petstore_addPet.

Single API Server with MCP HTTP Transport

For a single API service:

Standard SSE Configuration:

json
{
  "mcpServers": {
    "openapi_service": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://127.0.0.1:8001/sse"
      ]
    }
  }
}

Streamable HTTP Configuration:

json
{
  "mcpServers": {
    "openapi_service": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://127.0.0.1:8001/mcp"
      ]
    }
  }
}

With Debugging (for development):

json
{
  "mcpServers": {
    "openapi_service": {
      "command": "npx",
      "args": [
        "mcp-remote", 
        "http://127.0.0.1:8001/sse",
        "--debug"
      ]
    }
  }
}

With Custom Transport Strategy:

json
{
  "mcpServers": {
    "openapi_service": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://127.0.0.1:8001/mcp", 
        "--transport",
        "streamable-http"
      ]
    }
  }
}

With Legacy SSE Streaming (Deprecated)

json
{
  "mcpServers": {
    "streaming_api": {
      "command": "full_path_to_openapi_mcp/venv/bin/python",
      "args": ["full_path_to_openapi_mcp/src/openapi_mcp/fastmcp_server.py"],
      "env": {
        "SERVER_NAME": "streaming_api",
        "OPENAPI_URL": "https://api.example.com/openapi.json",
        "SSE_ENABLED": "true",
        "SSE_HOST": "127.0.0.1",
        "SSE_PORT": "8001"
      },
      "transport": "stdio"
    }
  }
}

Apply this configuration to the following files:

  • Cursor: ~/.cursor/mcp.json
  • Windsurf: ~/.codeium/windsurf/mcp_config.json
  • Claude Desktop: ~/Library/Application Support/Claude/claude_desktop_config.json

Replace full_path_to_openapi_mcp with your actual installation path.

Quick Setup for Multiple APIs

Copy the provided example configuration:

bash
cp claude_desktop_config.json ~/Library/Application\ Support/Claude/claude_desktop_config.json

Start both services:

bash
# Terminal 1
source venv/bin/activate && \
OPENAPI_URL="https://api.met.no/weatherapi/locationforecast/2.0/swagger" \
SERVER_NAME="weather" \
MCP_HTTP_ENABLED="true" \
MCP_HTTP_PORT="8001" \
python src/openapi_mcp/fastmcp_server.py

# Terminal 2  
source venv/bin/activate && \
OPENAPI_URL="https://petstore3.swagger.io/api/v3/openapi.json" \
SERVER_NAME="petstore" \
MCP_HTTP_ENABLED="true" \
MCP_HTTP_PORT="8002" \
python src/openapi_mcp/fastmcp_server.py

Result: Claude gets access to both weather and petstore APIs with prefixed tool names.

Environment Configuration

Core Configuration

VariableDescriptionRequiredDefault
OPENAPI_URLURL or local file path to OpenAPI specificationYes-
SERVER_NAMEMCP server nameNoopenapi_proxy_server

OAuth2 Authentication

VariableDescriptionRequiredDefault
OAUTH_CLIENT_IDOAuth client IDNo-
OAUTH_CLIENT_SECRETOAuth client secretNo-
OAUTH_TOKEN_URLOAuth token endpoint URLNo-
OAUTH_SCOPEOAuth scopeNoapi

Username/Password Authentication

VariableDescriptionRequiredDefault
API_USERNAMEAPI username for authenticationNo-
API_PASSWORDAPI password for authenticationNo-
API_LOGIN_ENDPOINTLogin endpoint URLNoAuto-detected

Custom Authentication Headers

VariableDescriptionRequiredDefault
MCP_AUTH_HEADERSCustom authentication headers (JSON or key=value format)No-

MCP HTTP Transport (Recommended)

VariableDescriptionRequiredDefault
MCP_HTTP_ENABLEDEnable MCP HTTP transportNofalse
MCP_HTTP_HOSTMCP HTTP server hostNo127.0.0.1
MCP_HTTP_PORTMCP HTTP server portNo8000
MCP_CORS_ORIGINSCORS origins (comma-separated)No*
MCP_MESSAGE_SIZE_LIMITMessage size limitNo4mb
MCP_BATCH_TIMEOUTBatch timeout in secondsNo30
MCP_SESSION_TIMEOUTSession timeout in secondsNo3600

Legacy SSE Support (Deprecated)

VariableDescriptionRequiredDefault
SSE_ENABLEDEnable SSE streaming supportNofalse
SSE_HOSTSSE server hostNo127.0.0.1
SSE_PORTSSE server portNo8000

📁 Loading Local OpenAPI Specifications

You can now load OpenAPI specs from your local filesystem instead of requiring remote URLs:

JSON Format

bash
source venv/bin/activate
OPENAPI_URL="./specs/my-api.json" \
SERVER_NAME="local_api" \
python src/openapi_mcp/fastmcp_server.py

YAML Format

bash
source venv/bin/activate
OPENAPI_URL="../shared/api.yaml" \
SERVER_NAME="local_api" \
python src/openapi_mcp/fastmcp_server.py

Absolute Path

bash
source venv/bin/activate
OPENAPI_URL="/Users/myuser/projects/api-spec.json" \
SERVER_NAME="local_api" \
python src/openapi_mcp/fastmcp_server.py

Supported Formats

  • JSON files: .json extension
  • YAML files: .yaml or .yml extension
  • Relative paths: ./path/to/spec.yaml, ../spec.json
  • Absolute paths: /full/path/to/spec.yaml

🔑 API Key and Custom Headers

Support for APIs requiring custom headers (API keys, tokens, etc.):

Using JSON Format

bash
source venv/bin/activate
MCP_AUTH_HEADERS='{"X-API-Key": "your-api-key", "X-Client-ID": "client123"}' \
OPENAPI_URL="https://api.example.com/openapi.json" \
SERVER_NAME="custom_api" \
python src/openapi_mcp/fastmcp_server.py

Using Simple Format

bash
source venv/bin/activate
MCP_AUTH_HEADERS='X-API-Key=your-api-key,X-Client-ID=client123' \
OPENAPI_URL="https://api.example.com/openapi.json" \
SERVER_NAME="custom_api" \
python src/openapi_mcp/fastmcp_server.py

Common API Key Patterns

  • RapidAPI: MCP_AUTH_HEADERS='{"X-RapidAPI-Key": "your-key"}'
  • Custom Bearer: MCP_AUTH_HEADERS='{"Authorization": "Bearer custom-token"}'
  • Multiple Headers: MCP_AUTH_HEADERS='{"X-API-Key": "key", "X-API-Secret": "secret"}'

Local Spec + Custom Headers

Combine both features for development:

bash
source venv/bin/activate
OPENAPI_URL="./test/fixtures/api.json" \
MCP_AUTH_HEADERS='{"X-API-Key": "dev-key"}' \
SERVER_NAME="dev_api" \
python src/openapi_mcp/fastmcp_server.py

🛠️ Examples & Use Cases

Norwegian Weather API

Test with real weather data (no authentication required):

bash
# Start weather server
source venv/bin/activate && \
OPENAPI_URL="https://api.met.no/weatherapi/locationforecast/2.0/swagger" \
SERVER_NAME="weather" \
MCP_HTTP_ENABLED="true" \
MCP_HTTP_PORT="8001" \
python src/openapi_mcp/fastmcp_server.py

Available tools:

  • weather_get__compact - Weather forecast for coordinates
  • weather_get__complete - Detailed weather forecast
  • weather_get__status - Server status

Example usage in Claude:

  • "What's the weather in Oslo tomorrow?" → Uses lat=59.9139, lon=10.7522
  • "Show me detailed weather for Bergen" → Uses lat=60.3913, lon=5.3221

Pet Store API

Test with Swagger's demo API:

bash
# Start petstore server
source venv/bin/activate && \
OPENAPI_URL="https://petstore3.swagger.io/api/v3/openapi.json" \
SERVER_NAME="petstore" \
MCP_HTTP_ENABLED="true" \
MCP_HTTP_PORT="8002" \
python src/openapi_mcp/fastmcp_server.py

Available tools:

  • petstore_addPet - Add a new pet to the store
  • petstore_findPetsByStatus - Find pets by status
  • petstore_getPetById - Find pet by ID

🏗️ Architecture

FastMCP-Based Design

src/
├── fastmcp_server.py      # FastMCP-based main server (recommended)
├── server.py              # Legacy MCP server (fallback)
├── config.py              # Configuration management
├── auth.py                # OAuth authentication handling
├── openapi_loader.py      # OpenAPI spec loading and parsing
├── request_handler.py     # Request preparation and validation
├── schema_converter.py    # Schema conversion utilities
├── exceptions.py          # Custom exception hierarchy
└── __init__.py           # Package initialization

Key Features

✅ FastMCP Integration - Uses latest FastMCP framework
✅ Automatic Tool Registration - Converts OpenAPI operations to MCP tools
✅ Multi-Transport Support - stdio, HTTP, SSE
✅ Parameter Validation - Type conversion and validation
✅ Error Handling - Comprehensive JSON-RPC error responses
✅ Authentication - OAuth2 and username/password support

How It Works

  1. Configuration Loading: Validates environment variables and server configuration.
  2. OpenAPI Spec Loading: Fetches and parses OpenAPI specifications with comprehensive error handling.
  3. Component Initialization: Sets up modular components with dependency injection.
  4. Tool Registration: Dynamically creates MCP tools from OpenAPI operations with full metadata.
  5. Resource Registration: Converts OpenAPI schemas into MCP resources with proper URIs.
  6. Prompt Generation: Creates contextual usage prompts and CRUD operation examples.
  7. Authentication: Handles both OAuth2 and username/password authentication with token caching and automatic renewal.
  8. Request Processing: Advanced parameter parsing, type conversion, and validation.
  9. Error Handling: Comprehensive exception handling with structured error responses.

Resources & Prompts

The server automatically generates comprehensive metadata to enhance AI integration:

Resources

  • Schema-based Resources: Automatically derived from OpenAPI component schemas
  • Structured URIs: Resources are registered with consistent URIs (e.g., /resource/{server_name}_{schema_name})
  • Type Conversion: OpenAPI schemas are converted to MCP-compatible resource definitions
  • Metadata Enrichment: Resources include server context and categorization tags

Prompts

  • API Usage Guides: General prompts explaining available operations and their parameters
  • CRUD Examples: Automatically generated examples for Create, Read, Update, Delete operations
  • Contextual Guidance: Operation-specific prompts with parameter descriptions and usage patterns
  • Server-specific Branding: All prompts are prefixed with server name for multi-API environments

Benefits

  • Enhanced Discoverability: AI agents can better understand available API capabilities
  • Usage Guidance: Prompts provide clear examples of how to use each operation
  • Type Safety: Resource schemas ensure proper data structure understanding
  • Context Awareness: Server-specific metadata helps with multi-API integration

OpenAPI-MCP

📊 Performance & Production

Performance Characteristics

  • Fast Startup: Initializes in ~2-3 seconds
  • Low Memory: ~50MB base memory usage
  • Concurrent Requests: Handles multiple API calls simultaneously
  • Caching: Automatic OpenAPI spec and authentication token caching

Production Deployment

bash
# Docker production deployment
docker-compose up -d

# Or with custom configuration
docker run -d \
  -e OPENAPI_URL="https://your-api.com/openapi.json" \
  -e SERVER_NAME="your_api" \
  -e MCP_HTTP_ENABLED="true" \
  -e MCP_HTTP_PORT="8001" \
  -p 8001:8001 \
  openapi-mcp:latest

Monitoring

  • Health check endpoint: GET /health
  • Metrics via structured logging
  • Error tracking with JSON-RPC error codes

🔍 Troubleshooting

Common Issues

❌ RequestHandler.prepare_request() missing arguments

bash
# Solution: Use fastmcp_server.py instead of server.py
python src/openapi_mcp/fastmcp_server.py  # ✅ Correct

❌ Claude Desktop doesn't see the tools

bash
# Check configuration location
ls ~/Library/Application\ Support/Claude/claude_desktop_config.json

# Restart Claude Desktop after config changes

❌ Connection refused on port 8001

bash
# Check if server is running
lsof -i :8001

# Check server logs for errors

❌ SSL/TLS errors with OpenAPI URLs

bash
# Update certificates
pip install --upgrade certifi httpx

Testing Tools

Test server initialization:

bash
python test_weather_oslo.py

Test with mcp-remote:

bash
npx mcp-remote http://127.0.0.1:8001/sse

Check available tools:

bash
curl http://127.0.0.1:8001/health

Environment Issues

Python version mismatch:

bash
# Ensure Python 3.12+
python --version

# Recreate virtual environment if needed
rm -rf venv && python3.12 -m venv venv

Missing dependencies:

bash
# Reinstall requirements
pip install --upgrade -r requirements.txt

🤝 Contributing

  1. Fork this repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

📄 License

MIT License

Audits

MseeP.ai Security Assessment Badge

Star History

If you find it useful, please give it a ⭐ on GitHub!

Star History Chart

Instalação

TypingMind
{
  "mcpServers": {
    "openapi-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "http://127.0.0.1:8001/sse"
      ]
    }
  }
}

Use o MCP de OpenAPI到模型上下文协议(MCP) com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar OpenAPI到模型上下文协议(MCP), é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. É possível executar o MCP localmente no seu dispositivo ou se conectar à URL de um servidor MCP remoto.

Opção 1: use o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione OpenAPI到模型上下文协议(MCP) como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de OpenAPI到模型上下文协议(MCP).
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "openapi-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de OpenAPI到模型上下文协议(MCP), selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de OpenAPI到模型上下文协议(MCP).
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar OpenAPI到模型上下文协议(MCP) para me ajudar nesta tarefa?
OpenAPI到模型上下文协议(MCP)
Claro. Já li.
Veja o que encontrei usando OpenAPI到模型上下文协议(MCP).

Opção 2: Adicione a URL de um servidor MCP

Use esta opção quando OpenAPI到模型上下文协议(MCP) já estiver hospedado remotamente ou quando sua equipe quiser um conector compartilhado que vários usuários possam acessar.

1

Abra Conectores MCP

No TypingMind, vá até Plugins, abra Conectores MCP e selecione Adicionar URL.

  1. Abra o TypingMind no navegador.
  2. Acesse Plugins.
  3. Abra Conectores MCP.
  4. Clique em Adicionar URL.
Formulário do TypingMind para adicionar a URL de um servidor MCP personalizado
2

Cole a URL do servidor

Insira http://127.0.0.1:8001/sse no campo URL do servidor. Adicione um nome para a conexão, uma descrição, um ícone, cabeçalhos HTTP personalizados ou configurações do cliente OAuth se o servidor exigir.

  1. Cole http://127.0.0.1:8001/sse no campo URL do servidor.
  2. Digite um nome para a conexão de OpenAPI到模型上下文协议(MCP).
  3. Adicione uma descrição e um ícone para facilitar a identificação.
  4. Adicione cabeçalhos HTTP personalizados ou dados do cliente OAuth se o servidor exigir autenticação.
3

Crie a conexão

Clique em Criar conexão, volte à lista de Plugins e confirme que a nova conexão MCP está ativa.

  1. Clique em Criar conexão.
  2. Volte à lista de conectores MCP.
  3. Confirme que a conexão de OpenAPI到模型上下文协议(MCP) aparece como ativa.
  4. Atualize a lista de plugins se a conexão não aparecer imediatamente.
4

Troque de modelo sem reconectar

Inicie um chat com seu modelo preferido, ative as ferramentas de OpenAPI到模型上下文协议(MCP) em Plugins e mude para outro modelo sempre que necessário. A conexão MCP continua disponível no espaço de trabalho do TypingMind.

  1. Inicie um novo chat no TypingMind.
  2. Selecione o modelo de IA que deseja usar.
  3. Ative as ferramentas de OpenAPI到模型上下文协议(MCP) em Plugins.
  4. Peça ao modelo para usar a ferramenta quando necessário.
  5. Mude para outro modelo de IA e reutilize a mesma conexão MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar OpenAPI到模型上下文协议(MCP) para me ajudar nesta tarefa?
OpenAPI到模型上下文协议(MCP)
Claro. Já li.
Veja o que encontrei usando OpenAPI到模型上下文协议(MCP).

Perguntas frequentes

Para que serve o servidor MCP OpenAPI到模型上下文协议(MCP)?

OpenAPI到模型上下文协议(MCP) é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP OpenAPI到模型上下文协议(MCP) com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar OpenAPI到模型上下文协议(MCP) com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP OpenAPI到模型上下文协议(MCP) com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com OpenAPI到模型上下文协议(MCP) conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP OpenAPI到模型上下文协议(MCP) ao TypingMind?

É possível conectar OpenAPI到模型上下文协议(MCP) ao TypingMind com o conector MCP local ou adicionando a URL de um servidor MCP remoto. Use o conector local quando o servidor precisar acessar arquivos, apps ou recursos privados no seu dispositivo, e use uma URL de servidor quando o servidor MCP estiver hospedado remotamente.

Quais ferramentas o MCP OpenAPI到模型上下文协议(MCP) oferece no TypingMind?

OpenAPI到模型上下文协议(MCP) disponibiliza recursos MCP que podem ser ativados na página Plugins do TypingMind e usados no chat ou atribuídos a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP OpenAPI到模型上下文协议(MCP)?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se OpenAPI到模型上下文协议(MCP) exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇