Summary
mantis setup succeeds with a fresh live developer key: it can list accessible Spaces, select an owned Space, create a new thread, and persist the active context. Immediately afterward, every MCP-backed command (mantis use get_space_context, mantis tools) fails with:
Streamable HTTP error: Error POSTing to endpoint: {"error":"Invalid or expired MCP bearer token"}
Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76
This looks like an auth-contract mismatch between the REST endpoints used by setup and /mcp_integrated/ rather than a bad developer key, because the same key successfully authenticates REST operations during setup.
Environment
- Windows PowerShell
- Node v24.13.1
mantisai-cli / mantis v3.7.0
- API base:
https://kellis-h200-1.csail.mit.edu
- Owned Space selected successfully
- New thread created successfully
Reproduction
npm install -g mantisai-cli
mantis setup
- Enter the default API base.
- Enter a newly generated
live_... developer key.
- Browse Spaces, select an owned Space.
- Create a new thread.
- Setup reports success and
mantis status shows the selected Space/thread.
- Run
mantis use get_space_context.
- Observe
Invalid or expired MCP bearer token.
- Run
mantis tools and observe the same auth error plus the libuv assertion on Windows.
Why this appears inconsistent with the documented/client contract
Current CLI/docs say the developer key is sent to <api-base>/mcp_integrated/ as Authorization: Bearer <key> with X-Space-State-ID. The same key is accepted by /api/v1/me/spaces/ and /api/v1/me/space-states/ during setup, but rejected by the MCP endpoint.
Expected
A valid developer key that succeeds during setup should also authenticate MCP calls, so mantis use get_space_context and mantis tools work immediately after setup.
Additional issue
The Windows process also hits:
Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76
after the MCP HTTP auth failure. That looks like a cleanup/double-close issue in the failure path and may merit a separate guard/test.
No API keys or secrets are included in this report.
Summary
mantis setupsucceeds with a fresh live developer key: it can list accessible Spaces, select an owned Space, create a new thread, and persist the active context. Immediately afterward, every MCP-backed command (mantis use get_space_context,mantis tools) fails with:This looks like an auth-contract mismatch between the REST endpoints used by setup and
/mcp_integrated/rather than a bad developer key, because the same key successfully authenticates REST operations during setup.Environment
mantisai-cli/mantisv3.7.0https://kellis-h200-1.csail.mit.eduReproduction
npm install -g mantisai-climantis setuplive_...developer key.mantis statusshows the selected Space/thread.mantis use get_space_context.Invalid or expired MCP bearer token.mantis toolsand observe the same auth error plus the libuv assertion on Windows.Why this appears inconsistent with the documented/client contract
Current CLI/docs say the developer key is sent to
<api-base>/mcp_integrated/asAuthorization: Bearer <key>withX-Space-State-ID. The same key is accepted by/api/v1/me/spaces/and/api/v1/me/space-states/during setup, but rejected by the MCP endpoint.Expected
A valid developer key that succeeds during setup should also authenticate MCP calls, so
mantis use get_space_contextandmantis toolswork immediately after setup.Additional issue
The Windows process also hits:
after the MCP HTTP auth failure. That looks like a cleanup/double-close issue in the failure path and may merit a separate guard/test.
No API keys or secrets are included in this report.