fix(mcp): correct /api/me/* paths, claim host, env var, surface agent_action#6
Merged
Merged
Conversation
…_action
Wave FIX-E findings. The MCP shipped four tools wired to /api/me/*
paths that the router never registered — every call returned a generic
"instanode.dev error (404)" and the LLM had no path forward. This PR
rewires those tools to the canonical routes, plus three smaller
contract drifts:
* /api/me/resources → GET /api/v1/resources (list)
* /api/me/claim → POST /claim (now takes jwt + email)
* /api/me/resources/{token} → DELETE /api/v1/resources/{token}
* /api/me/token → POST /api/v1/auth/api-keys (mint)
The list endpoint returns {ok, items, total}; client now unwraps to
items[] so the tool can iterate naturally. The claim flow primitive
is identity-bound — there is no "claim a token to an existing team"
route — so claim_token's schema is now (upgrade_jwt, email), matching
the dashboard's flow. The mint route returns a plaintext key that's
shown exactly once; get_api_token's wording was updated to reflect
revocation-based (not time-bound) keys. #C5
* claim_resource built https://instanode.dev/start?t=<jwt>. /start is a
route on the API host, NOT the dashboard host — the dashboard
domain's path is /claim. /start is what issues the 302 to /claim.
Now builds api.instanode.dev/start?t=<jwt>; configurable via
INSTANODE_API_URL same as every other request. #C6
* MCP discarded `agent_action` from API error envelopes. The API
copy-edits these sentences specifically for the LLM to read aloud
("Tell the user they've hit the hobby tier storage limit — have them
upgrade at https://instanode.dev/pricing"). formatError now appends
Action + Upgrade + Claim lines below the headline so the user gets
the platform's canonical CTA instead of a generic "API error 402".
client.ApiError carries the new agentAction + claimURL fields. #C7
* server.json + smithery.yaml declared INSTANODE_API_BASE while
client.ts always read INSTANODE_API_URL. The registry-side name
never took effect — users who set it via Smithery silently got the
default base URL. Standardized on INSTANODE_API_URL (the name the
client honors today). #C8
* Bumped 0.9.0 → 0.9.1. The previous 0.9.0 npm publish failed and
`npx instanode-mcp@latest` 404'd; this version closes both. The npm
publish step is documented in PUBLISHING.md and must be run manually
(no NPM_TOKEN was available in the env where this PR was produced).
#C4 #C106
test.sh extended: two new gates assert the claim host is the API host
and that claim_token rejects the old (token-only) shape.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Master shipped v0.10.0 (private + allowed_ips on create_deploy). This branch's 0.9.1 collides on the version field; rolled to 0.10.1 so npm publish can take it cleanly. test.sh picks up master's new #5c/#5d tests for private deploys alongside this branch's #7/#8 tests for the claim host + claim_token schema.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wave FIX-E findings against the MCP server. The MCP shipped four tools wired to
/api/me/*paths that the router never registered — every call returned a generic "instanode.dev error (404)" and the LLM had no path forward. This PR rewires those tools to the canonical routes, plus three smaller contract drifts./api/me/*paths. Rewired:/api/me/resources→GET /api/v1/resources/api/me/claim→POST /claim(now takesjwt + email)/api/me/resources/{token}→DELETE /api/v1/resources/{token}/api/me/token→POST /api/v1/auth/api-keysclaim_resourcebuilthttps://instanode.dev/start?t=<jwt>./startis a route on the API host, not the dashboard. Nowapi.instanode.dev/start?t=<jwt>.agent_actionfrom API error envelopes.formatErrornow appendsAction / Upgrade / Claimlines below the headline so the LLM reads the platform's canonical CTA verbatim instead of guessing from a generic "API error 402".client.ApiErrorcarries newagentAction+claimURLfields.server.json+smithery.yamldeclaredINSTANODE_API_BASEwhileclient.tsalways readINSTANODE_API_URL. The registry-side name never took effect. Standardized onINSTANODE_API_URL.0.9.0 → 0.9.1. The previous 0.9.0 publish to npm failed andnpx instanode-mcp@latest404'd; this version closes both once the npm publish step runs (see below).npm publish — MANUAL STEP REQUIRED
The PR producer did not have
NPM_TOKENavailable in the env. After merge, run from a machine logged in asinstanode:See
PUBLISHING.mdfor the full registry-chain (MCP registry, Smithery, mcp.so, Cursor).Cross-references
fix(api): OpenAPI contract corrections — servers URL, resource_type/status/tier enums, provisioning envelope— same wave.fix(sdk-go): correct DefaultBaseURL + add Deploy() method— same wave.Test plan
npm run build→ cleantest.shextended with two new gates (claim host == API host; old claim_token shape rejected)bash test.shagainst the local k8s clusternpm publishfrom a machine with credentials, thennpx instanode-mcp@0.9.1smoke testclaim_resourcevia Claude Code to confirm the agent_action surfacesGenerated with Claude Code