Commit e1bb4d2
fix(mcp): correct /api/me/* paths, claim host, env var, surface agent_action (#6)
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>1 parent b072154 commit e1bb4d2
7 files changed
Lines changed: 303 additions & 94 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
| |||
272 | 280 | | |
273 | 281 | | |
274 | 282 | | |
275 | | - | |
276 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
277 | 310 | | |
278 | 311 | | |
279 | 312 | | |
280 | 313 | | |
281 | 314 | | |
| 315 | + | |
| 316 | + | |
282 | 317 | | |
283 | 318 | | |
284 | 319 | | |
| |||
305 | 340 | | |
306 | 341 | | |
307 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
308 | 354 | | |
309 | 355 | | |
310 | 356 | | |
| |||
314 | 360 | | |
315 | 361 | | |
316 | 362 | | |
317 | | - | |
| 363 | + | |
318 | 364 | | |
319 | 365 | | |
320 | 366 | | |
| |||
329 | 375 | | |
330 | 376 | | |
331 | 377 | | |
332 | | - | |
| 378 | + | |
333 | 379 | | |
334 | 380 | | |
335 | 381 | | |
| |||
384 | 430 | | |
385 | 431 | | |
386 | 432 | | |
| 433 | + | |
| 434 | + | |
387 | 435 | | |
388 | 436 | | |
389 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
390 | 445 | | |
391 | 446 | | |
392 | 447 | | |
| |||
441 | 496 | | |
442 | 497 | | |
443 | 498 | | |
| 499 | + | |
| 500 | + | |
444 | 501 | | |
445 | 502 | | |
446 | | - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
447 | 511 | | |
448 | 512 | | |
449 | 513 | | |
| |||
479 | 543 | | |
480 | 544 | | |
481 | 545 | | |
482 | | - | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
483 | 554 | | |
484 | | - | |
485 | | - | |
486 | | - | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
487 | 562 | | |
488 | 563 | | |
489 | | - | |
490 | | - | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
491 | 573 | | |
492 | 574 | | |
493 | | - | |
494 | | - | |
495 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
496 | 578 | | |
497 | 579 | | |
498 | 580 | | |
499 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
500 | 589 | | |
501 | 590 | | |
502 | 591 | | |
503 | | - | |
| 592 | + | |
504 | 593 | | |
505 | 594 | | |
506 | 595 | | |
507 | 596 | | |
508 | 597 | | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
514 | 627 | | |
515 | 628 | | |
516 | 629 | | |
| |||
0 commit comments