🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@nimbletools/mcp-http-bridge

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nimbletools/mcp-http-bridge

Bridge MCP stdio protocol to HTTP-based MCP services

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
8
60%
Maintainers
1
Weekly downloads
 
Created
Source

MCP HTTP Bridge

Bridge the Model Context Protocol (MCP) stdio interface to HTTP-based MCP services. This allows MCP clients like Claude Code to seamlessly connect to remote MCP servers running over HTTP.

Requirements

  • Node.js 24.0.0 or higher
  • npm 10.0.0 or higher

Installation

npm install -g @nimbletools/mcp-http-bridge

Or use directly with npx:

npx @nimbletools/mcp-http-bridge --endpoint "https://..." --token "..."

Usage

Command Line

mcp-http-bridge \
  --endpoint "https://api.example.com/mcp" \
  --token "your-bearer-token" \
  --timeout 15000 \
  --retries 2

With Claude Code

Add to your Claude Code configuration:

{
  "mcpServers": {
    "my-remote-server": {
      "command": "npx",
      "args": [
        "@nimbletools/mcp-http-bridge",
        "--endpoint", "https://api.example.com/mcp",
        "--token", "your-bearer-token"
      ]
    }
  }
}

With Environment Variables

For better security, use environment variables:

{
  "mcpServers": {
    "my-remote-server": {
      "command": "mcp-http-bridge",
      "args": [
        "--endpoint", "https://api.example.com/mcp"
      ],
      "env": {
        "MCP_BEARER_TOKEN": "your-bearer-token"
      }
    }
  }
}

Options

OptionAliasDefaultDescription
--endpoint-erequiredHTTP endpoint for the MCP service
--token-trequiredBearer token for authentication
--timeout30000Request timeout in milliseconds
--retries3Number of retry attempts
--verbose-vfalseEnable verbose logging

How It Works

The bridge acts as a protocol translator:

  • Input: Accepts MCP JSON-RPC messages via stdin
  • Translation: Forwards them as HTTP POST requests to your endpoint
  • Output: Returns responses via stdout in MCP format
Claude Code ↔ stdio/JSON-RPC ↔ MCP HTTP Bridge ↔ HTTP/JSON ↔ Your MCP Service

Authentication

The bridge adds Bearer token authentication to all HTTP requests:

POST /mcp HTTP/1.1
Authorization: Bearer your-token-here
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "method": "tools/list",
  "id": 1
}

Error Handling

  • 4xx Client Errors: Returned immediately (no retries)
  • 5xx Server Errors: Retried with exponential backoff
  • Network Errors: Retried with exponential backoff
  • Timeouts: Configurable per request

Examples

Basic Usage

mcp-http-bridge \
  --endpoint "https://mcp.example.com/api" \
  --token "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

With Custom Timeout

mcp-http-bridge \
  --endpoint "https://slow-service.com/mcp" \
  --token "abc123" \
  --timeout 60000 \
  --retries 5

Testing Connectivity

echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | \
  mcp-http-bridge --endpoint "https://api.com/mcp" --token "token"

Development

# Clone the repository
git clone https://github.com/nimbletools/mcp-http-bridge.git
cd mcp-http-bridge

# Install dependencies
npm install

# Build TypeScript
npm run build

# Run locally
npm run dev -- --endpoint "https://..." --token "..."

Contributing

  • Fork the repository
  • Create a feature branch
  • Make your changes
  • Add tests if applicable
  • Submit a pull request

License

MIT License - see LICENSE file for details.

Support

Keywords

mcp

FAQs

Package last updated on 02 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts