[Bug for MCP&API]: minimax-coding-plan-mcp fails to start when invoked via uvx with environment variables
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 30/100
Hướng nghiên cứu
Bắt đầu với minimax_mcp/server.py quanh các dòng 33-35 và xem xét PR #34, vốn là bản sửa lỗi được đề xuất hiện có. Chạy bài kiểm thử MCP client được cung cấp với các biến môi trường đã được ghi lại, sau đó xác minh rằng bản sửa lỗi có trong một phiên bản đã phát hành và README có ghi lại cách gọi được hỗ trợ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 101
- Fork
- 31
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MiniMax-AI/MiniMax-Coding-Plan-MCP
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
MiniMax-AI/MiniMax-Coding-Plan-MCP#22 · 1 bình luận ·
-
Awareness: OpenClaw gateway MCP process pool never cleans up uvx processes, causing memory leakĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Tất cả issue của MiniMax-AI/MiniMax-Coding-Plan-MCP
Issue tương tự
-
area: agents area: docs good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
openapi/gknowledge#23 ·
-
get() for StrEnumCó thể đã có người làm @FeJo5952 đã nhận hôm nay. Đang mởgood first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
collective/icalendar#1921 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Improvement Python Spans
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
getsentry/sentry-python#7994 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
alphagov/notifications-api#5004 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
equinor/radix-flux#3922 ·
Maintainer thường phản hồi trong vòng 1 ngày