No project description provided
Project description
概要
MCPクライアントがSTDIO方式にしか対応していない場合に、MCPサーバがStreamableHTTP方式だった場合に使用するアダプタツールです。
利用方法
インストール
uv add mcp-transcoder
クライアントのMCP設定例
{
"mcpServers": {
"lf-agents": {
"command": "uvx",
"args": [
"mcp-transcoder",
"--insecure",
"--timeout",
"300",
"--headers",
"x-api-key",
"YOUR_API_KEY",
"https://your_mcp_domain/mcp"
]
}
}
}
前提条件
MCPサーバはStreamableHTTPである必要があります。 SSEには対応しておりません。
補足:
- APIキーが必要なサーバの場合は
--headers KEY VALUEを複数回指定できます。 - CA証明書が必要な場合、
--ssl-cert-file /path/to/cacert.pemを指定してください(MCP 接続時のみ適用)。テスト用に簡易実行したい場合、--insecureをセットすると HTTPS 検証をスキップします。環境変数SSL_CERT_FILEも利用可能ですが、ツール全体へ波及させないため--ssl-cert-fileの使用を推奨します。
タイムアウト設定
- 各リクエスト(initialize / list_tools / call_tool など)の「全体タイムアウト」は既定で 120 秒です。
- 変更する場合は
--timeout 秒数を指定します。- 例:
uvx mcp-transcoder --timeout 300 https://example/mcp
- 例:
- この値は HTTP 通信(httpx)のタイムアウトにも適用され、長い処理に対する疎通を安定化させます。
コマンドラインオプション一覧(表)
| オプション | 意味 | 既定値 | 設定例 |
|---|---|---|---|
url |
接続先の StreamableHTTP MCP エンドポイント(必須) | なし(必須) | https://your_mcp_streamable_http_endpoint/mcp |
-H KEY VALUE / --headers KEY VALUE |
追加のHTTPヘッダーを付与(APIキーなど)。 | なし | --headers x-api-key YOUR_API_KEY、--headers Authorization "Bearer YOUR_TOKEN" |
--insecure / --no-insecure |
TLS証明書検証を無効化/有効化 | 検証有効(--no-insecure) |
無効化: --insecure/推奨: SSL_CERT_FILE=/path/to/cacert.pem uvx mcp-transcoder ... |
--timeout SECONDS |
各リクエストの全体タイムアウト秒(initialize/list_tools/call_tool等) | 120(または MCP_PROXY_TIMEOUT 環境変数) |
--timeout 300、MCP_PROXY_TIMEOUT=300 uvx mcp-transcoder ... |
--ssl-cert-file PATH |
MCP 接続時のみ使用する CA バンドル | なし(システム/既定の信頼ストア) | --ssl-cert-file /path/to/cacert.pem |
--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL} |
ログ出力の詳細度 | INFO |
--log-level DEBUG |
TLS 検証(社内CA / 自己署名対応)
--insecureを付与すると、リモートへのTLS証明書検証を無効化します。- 例:
uvx mcp-transcoder --insecure --headers x-api-key YOUR_API_KEY https://example/mcp
- 例:
- 推奨: 検証無効ではなく、CA証明書を指定して検証を有効のままにする
- 例:
uvx mcp-transcoder --ssl-cert-file /path/to/cacert.pem https://example/mcp - 補足:
--ssl-cert-fileは MCP 接続の httpx クライアントにのみ適用され、uvxの依存解決(PyPI への接続)には影響しません。
- 例:
テスト
uv run pytest -q
uvx でキャッシュ対策
uvxコマンドに、 --isolated --no-cache を付けるとキャッシュが古いエラーを回避できますので、テスト時には付与してください
url
pypi
https://pypi.org/project/mcp-transcoder/
git
Project details
Release history Release notifications | RSS feed
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.0.tar.gz
(11.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_transcoder-0.1.0.tar.gz.
File metadata
- Download URL: mcp_transcoder-0.1.0.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
697b325e5a55f7d3cd097f5f110da92811fc02d0ab608526ebba52424c44e819
|
|
| MD5 |
b0b48e38d4c5d58ce8106cf80aaed31f
|
|
| BLAKE2b-256 |
0958a0ae8f434fd19c0010e410b6bf1875b392cce8633989c36fd4d5dc7f4f49
|
File details
Details for the file mcp_transcoder-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_transcoder-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
008e82a9ca927452feb111ba1cdb26c98303d62c7ffc30fed920a6e42434cfe5
|
|
| MD5 |
73912d506e3e31759cd4412c155d3b87
|
|
| BLAKE2b-256 |
946bac667c985a1a916de7cef916529e8a449ec23a89121322b0a58a8cfec7fa
|