Skip to main content

Bridge STDIO-based MCP clients to StreamableHTTP MCP servers with header, TLS, and timeout options.

Project description

Overview

This tool is an adapter for situations where your MCP client only supports the STDIO protocol, but the target MCP server speaks StreamableHTTP.

Usage

Install

uv add mcp-transcoder

Example MCP client configuration

{
  "mcpServers": {
    "lf-agents": {
      "command": "uvx",
      "args": [
        "mcp-transcoder",
        "--insecure",
        "--timeout",
        "300",
        "--headers",
        "x-api-key",
        "YOUR_API_KEY",
        "https://your_mcp_domain/mcp"
      ]
    }
  }
}

Prerequisites

  • The MCP server must support StreamableHTTP.
  • Server-Sent Events (SSE) is not supported.

Notes

  • If the server requires an API key, you can pass --headers KEY VALUE multiple times.
  • If a custom CA certificate is required, specify --ssl-cert-file /path/to/cacert.pem (applies only to the MCP connection). For quick testing, you can set --insecure to skip HTTPS verification. The environment variable SSL_CERT_FILE is also supported, but --ssl-cert-file is recommended so the setting does not affect the entire process.

Timeout settings

  • The overall timeout for each request (initialize / list_tools / call_tool, etc.) is 120 seconds by default.
  • To change it, specify --timeout SECONDS.
    • Example: uvx mcp-transcoder --timeout 300 https://example/mcp
  • The same value is applied to the HTTP client (httpx) timeouts to improve stability for long-running operations.

Command-line options

Option Description Default Example
url The target StreamableHTTP MCP endpoint (required) none (required) https://your_mcp_streamable_http_endpoint/mcp
-H KEY VALUE / --headers KEY VALUE Add extra HTTP headers (e.g., API keys) none --headers x-api-key YOUR_API_KEY, --headers Authorization "Bearer YOUR_TOKEN"
--insecure / --no-insecure Disable/enable TLS certificate verification verification enabled (--no-insecure) Disable: --insecure / Recommended: SSL_CERT_FILE=/path/to/cacert.pem uvx mcp-transcoder ...
--timeout SECONDS Overall timeout per request (initialize/list_tools/call_tool, etc.) 120 (or MCP_PROXY_TIMEOUT env var) --timeout 300, MCP_PROXY_TIMEOUT=300 uvx mcp-transcoder ...
--ssl-cert-file PATH CA bundle used only for MCP connections system/default trust store --ssl-cert-file /path/to/cacert.pem
--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL} Log verbosity INFO --log-level DEBUG

TLS verification (enterprise CA / self-signed)

  • Adding --insecure disables certificate verification to the remote server.
    • Example: uvx mcp-transcoder --insecure --headers x-api-key YOUR_API_KEY https://example/mcp
  • Recommended: Keep verification enabled and provide a CA certificate instead.
    • Example: uvx mcp-transcoder --ssl-cert-file /path/to/cacert.pem https://example/mcp
    • Note: --ssl-cert-file is applied only to the httpx client used for the MCP connection. It does not affect uvx dependency resolution (e.g., connections to PyPI).

Tests

uv run pytest -q

uvx cache precautions

To avoid issues caused by stale caches, pass --isolated --no-cache to the uvx command when testing.

URLs

PyPI

https://pypi.org/project/mcp-transcoder/

GitHub

https://github.com/post-class/mcp-transcoder/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_transcoder-0.1.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_transcoder-0.1.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file mcp_transcoder-0.1.1.tar.gz.

File metadata

  • Download URL: mcp_transcoder-0.1.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.12

File hashes

Hashes for mcp_transcoder-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f4fd814a3d07f020b4b99747afe62edfa49632d3e48864b87cb477651202507e
MD5 3f3435780a2e62d3d2beb5bfa466983a
BLAKE2b-256 5a60f25ecf27482743f5270c7e437bccbdb768a4d4c9af589a540136baae6639

See more details on using hashes here.

File details

Details for the file mcp_transcoder-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_transcoder-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 48c872a6a2dfd5f888177b7c062669563fee00fa53ef6c6cdb06398806288d86
MD5 ef6184b9d8bbd49fda5388d43d22a96c
BLAKE2b-256 b42b0c16a0bac0f67f1fa1e2a641466f084f903da10ccfe4c35e1c8e7df84513

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page