[Bug for MCP&API]: minimax-coding-plan-mcp fails to start when invoked via uvx with environment variables
まだ誰も着手していません。
評価
調査の方向性
minimax_mcp/server.py の33~35行付近から始め、既存の修正案である PR #34 を確認します。ドキュメントに記載された環境変数を使って、提供されている MCP クライアントテストを実行し、その後、修正がリリース済みのバージョンで利用できること、および README にサポートされている呼び出し方法が記載されていることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Basic Information - Models Used
MiniMax M2.7 and the Coding-Plan-MCP
Basic Information - Scenario Description
When attempting to use minimax-coding-plan-mcp as an MCP server via the uvx command with environment variables (MINIMAX_API_KEY and MINIMAX_API_HOST), the server fails to start with a ValueError: MINIMAX_API_KEY environment variable is required error, even when the environment variable is properly set.
Is this bug known and solvable?
- I have followed the GitHub READMEs for
Minimax-MCPandMinimax-MCP-JS. - I have checked the official Minimax documentation and existing GitHub issues,but found no solution.
Information about environment
| Component | Version |
|---|---|
| OS | Linux (Ubuntu) |
| Python | 3.14.3 |
| uv | 0.11.8 |
| minimax-coding-plan-mcp | latest from uvx |
Trace-ID in the request head
N/A
Description
Steps to Reproduce
-
Set environment variables:
export MINIMAX_API_KEY="sk-cp-YOUR_KEY_HERE" export MINIMAX_API_HOST="https://api.minimax.io" -
Run the MCP server via uvx:
uvx minimax-coding-plan-mcp -y -
Expected: Server starts and listens for MCP requests
Actual: Server crashes immediately withValueError: MINIMAX_API_KEY environment variable is required
Attempted Fixes
Approach 1: StdioServerParameters env dict
server_params = StdioServerParameters(
command="uvx",
args=["minimax-coding-plan-mcp", "-y"],
env={"MINIMAX_API_KEY": api_key, "MINIMAX_API_HOST": api_host},
)
Result: Fails with same error.
Approach 2: os.environ before subprocess spawn
os.environ["MINIMAX_API_KEY"] = api_key
os.environ["MINIMAX_API_HOST"] = api_host
server_params = StdioServerParameters(command="uvx", args=["minimax-coding-plan-mcp", "-y"])
Result: Fails - subprocess doesn't inherit modified os.environ.
Approach 3: Inline env in shell command
MINIMAX_API_KEY="sk-cp-..." MINIMAX_API_HOST="https://api.minimax.io" uvx minimax-coding-plan-mcp -y
Result: Fails with ValueError: MINIMAX_API_HOST environment variable is required
Even though MINIMAX_API_HOST is explicitly set inline!
Root Cause
In minimax_mcp/server.py (line ~33-35):
if not os.environ.get("MINIMAX_API_KEY"):
raise ValueError("MINIMAX_API_KEY environment variable is required")
The check uses os.environ.get() evaluated at module import time, not at server startup/runtime. When uvx spawns the server:
uvxdownloads and extracts the package- Python starts executing
minimax-coding-plan-mcpas__main__ - Import of
minimax_mcp.serverhappens - At this point, the subprocess may not yet have inherited the environment properly
- Check fails even though env vars were passed to
StdioServerParameters
Note: This is the working hypothesis. A definitive fix would require testing with the actual server code to confirm import timing.
Impact
| Use Case | Impact |
|---|---|
| MCP Python SDK programmatic access | ❌ Blocked |
| AI coding applications (Claude Code, Cursor, OpenCode) | ❌ Blocked |
| Direct CLI with env vars | ❌ Blocked |
Other MCP servers (e.g., open-code, filesystem) work correctly with the same StdioServerParameters pattern. The issue appears specific to how minimax-coding-plan-mcp handles environment variables at import time.
Expected Behavior
- Accept
MINIMAX_API_KEYandMINIMAX_API_HOSTenvironment variables - Start successfully when provided via standard methods (shell export,
env:in StdioServerParameters) - Not crash before beginning to accept connections
Existing Fix
PR #34 adds CLI argument support (--api-key, --api-host) to work around this issue. This PR is open but not yet merged.
The workaround after PR #34 merges:
{
"command": "uvx",
"args": [
"minimax-coding-plan-mcp",
"-y",
"--api-key=your-key",
"--api-host=https://api.minimax.io"
]
}
What We Need
- Merge PR #34 - The fix already exists and addresses this issue
- Release new version - After merge, publish to uvx so users can update
- Documentation - Update README to show CLI arg usage as primary method
Test Script
import asyncio
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async def test_mcp():
params = StdioServerParameters(
command="uvx",
args=["minimax-coding-plan-mcp", "-y"],
env={
"MINIMAX_API_KEY": "YOUR_KEY_HERE",
"MINIMAX_API_HOST": "https://api.minimax.io",
},
)
async with stdio_client(params) as (stdio, write):
session = ClientSession(stdio, write)
await session.initialize()
result = await session.list_tools()
print(f"Connected! Tools: {[t.name for t in result.tools]}")
asyncio.run(test_mcp())
Additional Context
- This affects sn2md's ability to use MiniMax's vision model for OCR/image conversion
- sn2md has implemented MCP client code (
sn2md/mcp_vision.py) that is waiting on this fix - Related: sn2md issue with MiniMax not supporting Anthropic-style image blocks (
type="image")
Security Note
This is a bug report for a server startup issue, not a security vulnerability. The server fails to start rather than exposing data improperly. If there are security concerns related to this bug, please disclose responsibly.
- 主要言語
- Python
- スター
- 101
- フォーク
- 31
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MiniMax-AI/MiniMax-Coding-Plan-MCP のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
MiniMax-AI/MiniMax-Coding-Plan-MCP#22 · コメント 1 件 ·
-
Awareness: OpenClaw gateway MCP process pool never cleans up uvx processes, causing memory leakオープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
MiniMax-AI/MiniMax-Coding-Plan-MCP の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
aws-samples/sample-per-model-bedrock#191 ·
メンテナーはふだん 1 日以内に返信
-
Docs viewer: inverted grey colormap, Phantom CT window -20 to 35 HU, smoothing up to 40 mm対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea: docs enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
PyTomography/PyTomography#331 ·
メンテナーはふだん 1 日以内に返信
-
effort: low prio: low ready
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
digitalfabrik/integreat-cms#4616 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
FuRongJun-1999/dsh-memory#226 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug difficulty:2 good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
MakazhanAlpamys/Soup#1865 ·
メンテナーはふだん 1 日以内に返信