Skip to content

API-319: Reconcile MCP setup docs — canonical endpoint, API-key URL, and per-client paths - #506

Merged
gulshngill merged 6 commits into
mainfrom
docs/api-319-mcp-setup-reconcile
Aug 20, 2026
Merged

API-319: Reconcile MCP setup docs — canonical endpoint, API-key URL, and per-client paths#506
gulshngill merged 6 commits into
mainfrom
docs/api-319-mcp-setup-reconcile

Conversation

@gulshngill

@gulshngill gulshngill commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Why

MCP setup guidance is inconsistent across surfaces: the README had no MCP section at all, and the public MCP docs use a generic-client snippet that is awkward against the hosted endpoint (--allow-http on an HTTPS URL, and a --header "NANSEN-API-KEY: " form that mcp-remote mis-splits on the space).

This PR establishes the canonical values in the repo and gives every client one unambiguous path.

Canonical values

  • MCP endpoint: https://mcp.nansen.ai/ra/mcp (streamable HTTP, NANSEN-API-KEY header)
  • API-key URL (auth / MCP setup only): https://app.nansen.ai/auth/agent-setup
  • Credit top-up URL (credit warnings only): https://app.nansen.ai/api?tab=api — the credits tab of the billing page

What changed

  • README — new ## MCP section with the canonical endpoint/auth/key URL and per-client paths:
    • Claude Desktop and Cursor: pointed at docs.nansen.ai/mcp/connecting, where the .dxt bundle and the Cursor install deep link are maintained. The README does not duplicate those install artifacts and does not claim either is one-click from here.
    • One-command: Claude Code via claude mcp add --transport http nansen … --header "NANSEN-API-KEY: <your-key>"
    • Manual: native url + headers JSON for any streamable-HTTP client, and a corrected mcp-remote bridge for stdio-only clients (no --allow-http, header passed as a single NANSEN-API-KEY:${NANSEN_API_KEY} arg with the key in env)
    • Claude Tag (Claude in Slack): admin-configured path (plugin .mcp.json + host credential for mcp.nansen.ai), with an explicit per-user fallback to Claude Code / Claude Desktop
  • Credit warnings — README error table + src/response-meta.js: the out-of-credits and low-credit warnings move from the bare app.nansen.ai/api to the credits tab of that same billing page, app.nansen.ai/api?tab=api. auth/agent-setup is not used here — it stays confined to auth and MCP setup.
  • Tests: creditWarning assertions pin the top-up URL and assert auth/agent-setup does not leak into either warning
  • Changeset: patch

Follow-up for the docs site (not in this repo)

The Cursor deep link on docs.nansen.ai/mcp/connecting embeds --allow-http in its base64 config against an HTTPS endpoint. Harmless today (the header form inside it is correct — no space), but worth dropping so the deep link matches the corrected snippet in this README.

Verification

  • npm test — 2033 passed, 2 skipped; npm run lint clean
  • Live check against https://mcp.nansen.ai/ra/mcp: tools/list responds, and a tools/call with the NANSEN-API-KEY header reaches the tool handler
  • claude mcp add --transport http syntax verified against the current Claude Code CLI
  • Deliberately does not reference nansen mcp install (API-285: One-step MCP install (nansen mcp install <client>) #487) so this stands alone on main; the client list and header forms here match that PR so the two compose either way

🤖 Generated with Claude Code

… paths (API-319)

Add a canonical README MCP section (endpoint https://mcp.nansen.ai/ra/mcp,
NANSEN-API-KEY auth) with tiered one-click / one-command / manual setup for
Claude Desktop, Claude Code, Cursor, Claude Tag, and generic or stdio-only
clients, including a corrected mcp-remote bridge snippet. Migrate the two
remaining app.nansen.ai/api top-up links (credit warnings + README error
table) to the canonical app.nansen.ai/auth/agent-setup URL, finishing the
sweep from #313, and pin the canonical URL in the creditWarning tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@nansen-pr-reviewer

nansen-pr-reviewer Bot commented Aug 19, 2026

Copy link
Copy Markdown

pr-reviewer Summary for #bbf2151

No issues found

The code review completed successfully with no findings.

Review effort: 1/5 (Trivial)

Summary

This PR makes three tightly scoped changes: adds a canonical MCP setup section to the README, corrects two credit-warning URLs in src/response-meta.js (from app.nansen.ai/apiapp.nansen.ai/api?tab=api), and pins those URLs with new test assertions. All changes are correct and consistent with the codebase.

  • The src/response-meta.js URL fix is accurate — the old bare /api URL is now properly directed to the credits tab.
  • The new auth/agent-setup negative assertions in the tests correctly guard against URL confusion between MCP setup and credit top-ups.
  • The README MCP section covers Claude Code, Claude Desktop/Cursor (via docs link), the stdio mcp-remote bridge, and Claude Tag; the mcp-remote snippet correctly avoids --allow-http and passes the header as a single colon-delimited arg with the key in env, matching the PR description's stated corrections.
  • The changeset is present, scoped to nansen-cli, and labeled patch — appropriate for a URL fix and docs addition.
  • No schema changes are needed (no commands or options were added or modified).

No issues found.


Token usage: 20 input, 2,453 output, 210,226 cache read, 28,054 cache write | Usage Guide

New pushes are reviewed automatically with a 10-minute cooldown between reviews. To request a review at any time, comment @nansen-pr-reviewer re-review.

nansen-pr-reviewer[bot]
nansen-pr-reviewer Bot previously approved these changes Aug 19, 2026

@nansen-pr-reviewer nansen-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved

This PR was automatically approved because:

  • Claude recommends approval
  • Claude assessed this as a minimal effort change
  • The effort level is within the auto-approval threshold of 2
  • No high or critical issues were detected

If you have any concerns, please request a manual review.

Comment thread src/response-meta.js Outdated
The out-of-credits and low-credit warnings pointed users at
app.nansen.ai/auth/agent-setup, which is where you get an API key — not
where you top up credits. Same for the README CREDITS_EXHAUSTED row.

Replace both with generic top-up wording ("Top up your credits in the
Nansen app"), matching the existing URL-free CREDITS_EXHAUSTED message in
api.js. The URL stays in the MCP setup and auth sections, where it is the
right destination.

Tests now pin the new wording and assert no app.nansen.ai link leaks back
into the warnings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
nansen-pr-reviewer[bot]
nansen-pr-reviewer Bot previously approved these changes Aug 20, 2026

@nansen-pr-reviewer nansen-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved

This PR was automatically approved because:

  • Claude recommends approval
  • Claude assessed this as a minimal effort change
  • The effort level is within the auto-approval threshold of 2
  • No high or critical issues were detected

If you have any concerns, please request a manual review.

The out-of-credits and low-credit warnings link to the credit top-up page,
https://app.nansen.ai/api?tab=api — not the API-key URL. Same for the
README CREDITS_EXHAUSTED row.

auth/agent-setup stays reserved for MCP setup and API-key instructions;
the tests assert it does not leak into the credit warnings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
nansen-pr-reviewer[bot]
nansen-pr-reviewer Bot previously approved these changes Aug 20, 2026

@nansen-pr-reviewer nansen-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved

This PR was automatically approved because:

  • Claude recommends approval
  • Claude assessed this as a minimal effort change
  • The effort level is within the auto-approval threshold of 2
  • No high or critical issues were detected
  • Review comment contains non-blocking feedback

If you have any concerns, please request a manual review.

…eview)

Both "one-click" entries pointed at docs.nansen.ai/mcp/connecting, which is
a docs page, not a one-click install. Replaced with the actual artifacts
from the live docs:

- Claude Desktop: direct .dxt download from nansen-ai/nansen-mcp-dxt
- Cursor: the cursor://anysphere.cursor-deeplink/mcp/install deep link,
  shown as a copyable code block because GitHub strips the cursor://
  scheme from rendered link hrefs

The docs page stays as a reference for screenshots and walkthroughs. Noted
that the Cursor deep link installs the mcp-remote bridge with a placeholder
key, and pointed users at the native JSON below for a bridge-free setup.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gulshngill and others added 2 commits August 20, 2026 06:43
Drop the embedded .dxt download and cursor:// deep link. Both clients now
point at docs.nansen.ai/mcp/connecting, which is the single place those
instructions are maintained, and the wording no longer claims either is a
one-click install from the README.

Changeset reworded to match: per-client paths for Claude Code, Claude Tag,
and generic/stdio clients, plus a docs pointer for Claude Desktop and
Cursor. Credit-warning top-up links are unchanged (app.nansen.ai/api?tab=api).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The changeset called the old warning URL the API-key URL. main actually
has the bare billing URL, https://app.nansen.ai/api — the change is to the
credits tab of that same page, /api?tab=api. Reworded to say that.

No behaviour change: credit warnings keep /api?tab=api, auth/agent-setup
stays confined to MCP setup and API-key instructions.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@gulshngill

Copy link
Copy Markdown
Contributor Author

@kome12 addressed the comments could you have a final look?

@gulshngill
gulshngill merged commit 535559a into main Aug 20, 2026
8 checks passed
@gulshngill
gulshngill deleted the docs/api-319-mcp-setup-reconcile branch August 20, 2026 07:02
@github-actions github-actions Bot mentioned this pull request Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants