Token导航 LogoToken导航TokenDH.com
And Gw logo
开发工具stdio官方级别未说明来源级核验

And Gw

MCP Server

mcp-server-and-gw

An MCP stdio to HTTP SSE transport gateway with example server and MCP client

工具数

0

提示词数

0

GitHub Stars

89

资源数

0
远程连接JavaScriptClaudeClaude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

boilingdata

提供方

boilingdata

最后核验

2026/5/18 03:27

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx mcp-server-and-gw http://localhost:8808/

详细介绍

MCP网关、服务器和客户端

只要Claude Desktop不支持连接到远程服务器,您就可以使用此脚本运行从stdio到HTTP SSE(服务器发送事件)端点的网桥。

安装mcp服务器和gw

# 1. install
npm install -g mcp-server-and-gw
# 2. Or run directly with npx
npx mcp-server-and-gw http://localhost:8808/
# ...you can use environment variables too
MCP_HOST=localhost MCP_PORT=8808 npx mcp-server-and-gw

将配置添加到Claude中

桥脚本是node-javasscript,但您的服务器代码可以是您使用的任何代码。

A. 模型上下文协议 网关 src/mcp-server和gw.ts标准输入输出HTTP SSE 运输。

## 1. Build
yarn install
yarn build

## 2. Copy the code or update the claude_desktop_config.json
##    NOTE: Ensure that npx is in the PATH, or use full path like /opt/homebrew/bin/npx
echo '{
  "mcpServers": {
    "Claude Gateway Example": {
      "command": "npx",
      "args": [
        "mcp-server-and-gw", "http://localhost:8808/"
      ]
    }
  }
}' > ~/Library/Application\ Support/Claude/claude_desktop_config.json

## 3. Start server so that claude can connect to it for discoverying its resources, tools, etc.
PORT=8808 node examples/server.js

## 4. Start Claude Desktop

服务器和客户端示例

您还可以独立于Claude Desktop开发SSE服务器,从而获得更快的迭代。例如,运行 src/server.ts 并使用 src/client.ts 作为客户。

启动服务器,在另一个终端上启动客户端后,您将看到服务器输出。

% node examples/server.js
Server is running on port 8808

--> Received connection: /sse
New SSE connection.
--> Received message (post)
{
  jsonrpc: '2.0',
  id: 0,
  method: 'initialize',
  params: {
    protocolVersion: '2024-11-05',
    capabilities: {},
    clientInfo: { name: 'example-client', version: '1.0.0' }
  }
}
 Received message (post)
{ jsonrpc: '2.0', method: 'notifications/initialized' }
 Received message (post)
{ jsonrpc: '2.0', id: 1, method: 'resources/list' }
 Received message (post)
{ jsonrpc: '2.0', id: 2, method: 'tools/list' }
 Received message (post)
{
  jsonrpc: '2.0',
  id: 3,
  method: 'tools/call',
  params: { name: 'query', arguments: { sql: 'SELECT 42;' } }
}
<-- 202 Accepted

启动客户端

% node examples/client.js
Connecting...
Connected: { resources: {}, tools: {}, templates: {} }
{ resources: [] }
{
  tools: [
    {
      name: 'query',
      description: 'Run a read-only SQL query on a DuckDB database',
      inputSchema: { type: 'object', properties: { sql: { type: 'string' } } }
    },
    {
      name: 'visualise',
      description: 'Visualise SQL query results as an Apache ECharts chart. Provide the SQL clause that produces the data for the visualisation. Provide chart JSON configuration for Apache ECharts.',
      inputSchema: {
        type: 'object',
        properties: { sql: { type: 'string' }, chart: { type: 'string' } }
      }
    }
  ]
}
{
  content: [ { type: 'text', text: '[\n  {\n    "42": 42\n  }\n]' } ],
  isError: false
}

MCP检验员测试

在一个终端上启动示例服务器

node examples/server.js

…以及另一个终端上的网关

npx @modelcontextprotocol/inspector node ./build/mcp-server-and-gw.js

目录标签

目录标签

远程连接JavaScriptClaudedeveloper-toolsMCP协议本地部署网关服务HTTPSSE

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

mcp-server-and-gw

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP