mcp-gateway

A gateway demo for MCP SSE Server

GitHub Stars

143

User Rating

Not Rated

Favorites

0

Views

54

Forks

14

Issues

6

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Node.js: 18.0.0以上
npm: 8.0.0以上
+1 more

Installation

Installation

Prerequisites

Please specify required software and versions:
Node.js: 18.0.0 or higher
npm: 8.0.0 or higher
Claude Desktop: Latest version

Installation Steps

1. Install Globally

bash
npm install -g @mcphub/gateway

2. Find the Gateway Path

bash
npm root -g

3. Verify Installation

bash
npm list -g @mcphub/gateway

Troubleshooting

1If you can't find the gateway path:
bash
   npm list -g
   
2Verify your Node.js installation:
bash
   node --version
   npm --version
   

Configuration

Configuration

Claude Desktop Setup

Edit ~/Library/Application Support/Claude Desktop/config.json (macOS) or %APPDATA%\Claude Desktop\config.json (Windows):
json
{
  "mcpServers": {
    "server-name": {
      "command": "node",
      "args": ["/opt/homebrew/lib/node_modules/@mcphub/gateway/dist/src/mcphub-gateway.js"]
    }
  }
}

MCP Server Connection Configuration

Set the MCP server URL using an environment variable:
bash
export MCP_SERVER_URL=https://your-mcp-server.com/api/mcp
By default, it connects to https://server.mcphub.ai/api/mcp.

Examples

Examples

Using with Claude Desktop

1Verify MCP Server Startup
Open Claude Desktop and confirm that the configuration has been loaded correctly.
2Execute Basic Commands

   Available tools from this MCP server:
   - tool1: Description of tool1
   - tool2: Description of tool2
   

Programmatic Usage

javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');

const client = new MCPClient();
await client.connect();

// Execute tool
const result = await client.callTool('toolName', {
  parameter1: 'value1',
  parameter2: 'value2'
});

console.log(result);

Use Cases

Use as a gateway to connect Claude Desktop with HTTP/SSE-based MCP servers.
Create automation scripts that send requests to multiple MCP servers simultaneously and receive responses.
Access HTTP/SSE-based APIs uniformly using the MCP protocol for AI tools under development.
Easily connect new MCP servers without modifying the existing Claude Desktop environment.