Token导航 LogoToken导航TokenDH.com
Sarukas MCP logo
AI代理stdio官方级别未说明来源级核验

Sarukas MCP

MCP Server

一个Python桥接工具,使Claude Desktop能够通过stdio传输连接到基于HTTP的MCP(模型上下文协议)服务器。

工具数

4

提示词数

0

GitHub Stars

0

资源数

0
协议转换开发工具PythonClaudeClaude DesktopClaude

安装说明

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

作者 / 组织

sarukas

提供方

sarukas

最后核验

2026/5/17 20:19

快速接入

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

命令预览

pip install mcp-http-to-stdio

详细介绍

MCP HTTP-to-STDIO Bridge

A Python bridge utility that enables Claude Desktop to connect to HTTP-based MCP (Model Context Protocol) servers via stdio transport.

Overview

Claude Desktop uses stdio (stdin/stdout) to communicate with MCP servers, but many MCP servers expose HTTP endpoints. This bridge translates between the two protocols, allowing Claude Desktop to use HTTP-based MCP servers.

Architecture:

Claude Desktop (stdio/JSON-RPC) ←→ mcp-http-to-stdio (bridge) ←→ HTTP MCP Server

Features

  • Protocol Translation: Converts stdio JSON-RPC to HTTP POST requests
  • Authentication: Supports custom header-based authentication
  • Connection Pooling: Optimized HTTP connections with keep-alive and retry logic
  • Error Handling: Comprehensive error responses for network, auth, and server errors
  • Logging: File and stderr logging for debugging
  • Performance: Tracks request timing and logs slow requests

Prerequisites

  • Python 3.8+
  • An HTTP-based MCP server to connect to
  • Claude Desktop

Installation

From PyPI (Recommended)

pip install mcp-http-to-stdio

This installs the package globally and makes the mcp-http-to-stdio command available system-wide.

From Source

git clone https://github.com/your-org/agentic-enterprise.git
cd agentic-enterprise/packages/mcp-http-to-stdio
pip install -e .

Configuration

Claude Desktop Config File Location

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Basic Configuration

{
  "mcpServers": {
    "my-http-mcp-server": {
      "command": "mcp-http-to-stdio",
      "args": [
        "--url",
        "http://localhost:8080/mcp"
      ],
      "env": {
        "AUTH_TOKEN": "your-auth-token-here"
      }
    }
  }
}

Remote Server Configuration

{
  "mcpServers": {
    "remote-mcp-server": {
      "command": "mcp-http-to-stdio",
      "args": [
        "--url",
        "https://mcp-server.example.com/mcp"
      ],
      "env": {
        "AUTH_TOKEN": "your-auth-token-here"
      }
    }
  }
}

Configuration with Timeout

{
  "mcpServers": {
    "my-http-mcp-server": {
      "command": "mcp-http-to-stdio",
      "args": [
        "--url",
        "http://localhost:8080/mcp",
        "--timeout",
        "600"
      ],
      "env": {
        "AUTH_TOKEN": "your-auth-token-here"
      }
    }
  }
}

Command Line Arguments

mcp-http-to-stdio --help

Required Arguments

  • --url: HTTP MCP server endpoint URL (e.g., http://localhost:8080/mcp)

Optional Arguments

  • --share-key: Authentication key (alternative to environment variable)
  • --timeout: Request timeout in seconds (default: 300 = 5 minutes)

Authentication

Authentication tokens can be passed via:

  1. Environment variable (recommended): Set in the env section of Claude Desktop config
  2. Command line argument: Use --share-key flag

The bridge adds the authentication token to the x-ally-share-key HTTP header when making requests to the MCP server.

Usage

  1. Install the bridge: pip install mcp-http-to-stdio
  2. Configure Claude Desktop with your HTTP MCP server URL
  3. Restart Claude Desktop to load the new MCP server
  4. Verify: Ask Claude "What MCP tools are available?"

Logging

Logs are written to two locations:

  1. Log file: mcp_http_to_stdio.log (in the current directory)
  2. stderr: Visible in Claude Desktop's developer console

View Logs

# Follow log file
tail -f mcp_http_to_stdio.log

# View Claude Desktop logs
# Enable developer mode in Claude Desktop settings
# Open developer console and look for MCP-related messages

Troubleshooting

"Connection refused" or "Failed to connect"

Cause: HTTP MCP server is not running or URL is incorrect

Solution:

  1. Verify the MCP server is running
  2. Check the URL in your configuration
  3. Test the endpoint with curl: curl http://localhost:8080/mcp

"Authentication failed" or 401/403 errors

Cause: Authentication token is missing, incorrect, or expired

Solution:

  1. Verify the auth token is correct in the env section
  2. Check if the token has expired
  3. Regenerate the token if necessary

Claude Desktop doesn't see the MCP server

Cause: Configuration file is malformed or in wrong location

Solution:

  1. Validate JSON syntax at https://jsonlint.com
  2. Verify file location matches your operating system
  3. Restart Claude Desktop after making changes
  4. Check Claude Desktop logs for MCP initialization errors

Slow response times

Cause: MCP server queries can take time, especially for complex operations

Expected behavior:

  • Simple queries:

Content-Type: application/json

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


### Connection Pooling

The bridge uses optimized HTTP connection pooling:

- **Keep-alive**: Connections are reused
- **Retry logic**: Automatic retry on transient errors (429, 500-504)
- **Pool size**: 10 cached connections
- **Backoff**: Exponential backoff (1s, 2s, 4s)

## Example: MyAlly Share Server

This bridge was originally created for MyAlly's workspace sharing feature. Here's an example configuration:

{ "mcpServers": { "myally-workspace": { "command": "mcp-http-to-stdio", "args": [ "--url", "http://localhost:8081/share/mcp" ], "env": { "ALLY_SHARE_KEY": "ally_share_xxxxxxxxxxxxxxxx" } } } }


For MyAlly-specific documentation, see the [MyAlly repository](https://github.com/your-org/agentic-enterprise).

## Security Considerations

- **Protect authentication tokens**: Treat them like passwords
- **Use environment variables**: Don't hardcode tokens in config files
- **Use HTTPS**: For production deployments, always use HTTPS URLs
- **Rotate tokens**: Regularly regenerate authentication tokens
- **Don't commit tokens**: Never commit tokens to version control

## Contributing

Contributions are welcome! This is a simple bridge utility, but improvements to error handling, logging, or protocol support are always appreciated.

## License

MIT License - See LICENSE file for details

## Links

- **PyPI**: https://pypi.org/project/mcp-http-to-stdio/
- **GitHub**: https://github.com/your-org/agentic-enterprise
- **MCP Specification**: https://modelcontextprotocol.io/

目录标签

目录标签

协议转换开发工具PythonClaude本地部署HTTP桥接MCP协议Python工具

支持客户端

Claude DesktopClaude

接入字段

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

stdio

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

token

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

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

0

权限和风险

stdiotoken部署方式未说明

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

安装前确认

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

来源信息

继续浏览同类 MCP