
boilingdata/mcp-server-and-gw
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
끓는data/mcp-server-and-gw는 MCP 서버 후보자는 https://github.com/boilingdata/mcp-server-and-gw.]에서 가져온
개요
끓는data/mcp-server-and-gw는 MCP 서버 후보자는 https://github.com/boilingdata/mcp-server-and-gw.]에서 가져온
개요(AI 번역)
Claude 데스크톱이 원격 서버에 연결하지 않으므로 이 스크립트를 사용하여 stdio에서 HTTP SSE (Server-Sent Events) 엔드포인트로 브리지를 실행할 수 있습니다.
mcp-server-and-gw 설치
Claude로 구성 추가
브리지 스크립트는 노드 javasscript이지만, 서버 코드는 당신이 사용하는 것이 무엇이든 할 수 있습니다.
모델 콘텍스 프로토콜 게이트웨이 src/mcp-server-and-gw.ts from stdio to HTTP SSE 수송.
예제 서버 및 클라이언트
또한 Claude Desktop에서 SSE 서버를 독립적으로 개발할 수 있으므로 더 빠른 반복을 얻을 수 있습니다. 예를 들어, src/server.ts]을 실행하고 src/client.ts를 클라이언트로 사용합니다.
서버를 시작하면 다른 터미널에서 클라이언트를 시작하면 서버 출력을 볼 수 있습니다.
고객 시작
MCP Inspector 테스트
1개의 맨끝에 example 서버 시작
다른 맨끝에 … 그리고 출입구
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
MCP Gateway, Server, and Client
As long as Claude Desktop does not support connecting to remote servers, you can use this script to run a bridge from stdio to HTTP SSE (Server-Sent Events) endpoint.
Install mcp-server-and-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
Add Configuration into Claude
The bridge script is node javasscript, but your server code can be whatever you use.
A Model Context Protocol gateway src/mcp-server-and-gw.ts from stdio to HTTP SSE transport.
## 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
Example Server and Client
You can also develop the SSE server independently from Claude Desktop so you get faster iterations. For example, run the src/server.ts and use the src/client.ts as the client.
Start server, once you start the client on another terminal, you see the server output.
% 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' }
}
}
<-- 202 Accepted
--> Received message (post)
{ jsonrpc: '2.0', method: 'notifications/initialized' }
<-- 202 Accepted
--> Received message (post)
{ jsonrpc: '2.0', id: 1, method: 'resources/list' }
<-- 202 Accepted
--> Received message (post)
{ jsonrpc: '2.0', id: 2, method: 'tools/list' }
<-- 202 Accepted
--> Received message (post)
{
jsonrpc: '2.0',
id: 3,
method: 'tools/call',
params: { name: 'query', arguments: { sql: 'SELECT 42;' } }
}
<-- 202 Accepted
Start the client
% 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' } } }
},
{
설치
npx mcp-server-and-gw http://localhost:8808/설정
## 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