LM

lightconetech/mcp-gateway

API development

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

153 stars 15 forks Качество 67 Тренд 0Apache-2.0

lightconetech/mcp-gateway — это кандидат на MCP-сервер, импортированный из https://github.com/lightconetech/mcp-gateway.

Обзор

lightconetech/mcp-gateway — это кандидат на MCP-сервер, импортированный из https://github.com/lightconetech/mcp-gateway.

Обзор (машинный перевод)

Сервис шлюза, который соединяет реализацию Model Context Protocol (MCP) на основе stdio в Claude Desktop с MCP-серверами на базе HTTP/SSE. Это устраняет разрыв в совместимости протоколов, поскольку Claude Desktop в настоящее время поддерживает только серверы MCP на основе stdio. См. обсуждение здесь.

Почему именно эти ворота?

В настоящее время приложение Claude Desktop поддерживает только протокол stdio для MCP-серверов, в то время как многие MCP-серверы используют HTTP с передачей событий, отправленных сервером (SSE). Этот шлюз выступает в роли транслятора протоколов, позволяя Claude Desktop взаимодействовать с любым сервером HTTP/SSE MCP посредством:

  1. Принятие stdio ввода от Claude Desktop
  2. Преобразование и пересылка запросов на серверы HTTP/SSE MCP
  3. Преобразование ответов SSE обратно в формат stdio для Claude Desktop

Установка

Установите шлюз глобально с помощью npm:

Конфигурация

1. Найдите Тропу Ворот

После установки найдите, где NPM установил шлюз, используя следующие команды:

Общие глобальные места размещения посылок:

  • macOS (Домашний узел): /opt/homebrew/lib/node_modules/@mcphub/gateway/dist/src/mcphub-gateway.js
  • macOS (по умолчанию): /usr/local/lib/node_modules/@mcphub/gateway/dist/src/mcphub-gateway.js

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

MCP Server Gateway

A gateway service that bridges the stdio-based Model Context Protocol (MCP) implementation in Claude Desktop with HTTP/SSE-based MCP servers. This solves the protocol compatibility gap since Claude Desktop currently only supports stdio-based MCP servers. See the discussion here.

Why This Gateway?

Claude Desktop App currently only supports stdio protocol for MCP servers, while many MCP servers use HTTP with Server-Sent Events (SSE) transport. This gateway acts as a protocol translator, allowing Claude Desktop to communicate with any HTTP/SSE MCP server by:

  1. Accepting stdio input from Claude Desktop
  2. Converting and forwarding requests to HTTP/SSE MCP servers
  3. Converting SSE responses back to stdio format for Claude Desktop

Installation

Install the gateway globally using npm:

npm install -g @mcphub/gateway

Configuration

1. Find the Gateway Path

After installation, find where npm installed the gateway using these commands:

# This shows the root directory of global packages
npm root -g

# The gateway will be located at:
/@mcphub/gateway/dist/src/mcphub-gateway.js

Common global package locations:

  • macOS (Homebrew Node): /opt/homebrew/lib/node_modules/@mcphub/gateway/dist/src/mcphub-gateway.js
  • macOS (default): /usr/local/lib/node_modules/@mcphub/gateway/dist/src/mcphub-gateway.js
  • Windows: %AppData%\npm\node_modules\@mcphub\gateway\dist\src\mcphub-gateway.js

Verify the installation and path:

npm list -g @mcphub/gateway

2. Configure Claude Desktop

Create or update your Claude Desktop configuration file:

On macOS

Location: ~/Library/Application Support/Claude Desktop/config.json

On Windows

Location: %APPDATA%\Claude Desktop\config.json

Add this configuration (using the path you found in step 1):

{
  "mcpServers": {
    "server-name": {
      "command": "node",
      "args": ["/opt/homebrew/lib/node_modules/@mcphub/gateway/dist/src/mcphub-gateway.js"]
    }
  }
}

Note: Replace the path in args with your actual path from step 1.

3. Configure MCP Server Connection

The gateway uses an environment variable to specify which MCP server to connect to:

# Set the MCP server URL (optional)
export MCP_SERVER_URL=https://your-mcp-server.com/api/mcp

By default, the gateway connects to the MCP Hub server at https://server.mcphub.ai/api/mcp, which provides access to various pre-configured MCP services.

4. Start Claude Desktop

Start or restart Claude Desktop to apply the changes.

Troubleshooting

  1. If you can’t find the gateway path:

    # List all global packages and look for @mcphub/gateway
    npm list -g
    
    # Or specifically check the gateway
    npm list -g @mcphub/gateway
    
  2. Verify your Node.js installation:

    # Check Node version
    node --version
    
    # Check npm version
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "server-name": { "command": "node", "args": ["/opt/homebrew/lib/node_modules/@mcphub/gateway/dist/src/mcphub-gateway.js"] } } }