Install Hadron in VS Code¶
This guide covers the OAuth-based install path for VS Code's built-in MCP support: paste the Hadron MCP URL, walk through the browser-based sign-in + consent, and VS Code has access to your Hadron memories. No copy-paste of API keys.
For the AppKey-based path (download a config file from the portal's Client tab), see Connecting an MCP host to Hadron. OAuth is the recommended path for interactive editor sessions because each issued token is tied to a clear audit-trail row in your portal API-keys page and revoking it disconnects VS Code in one click.
What you'll have at the end¶
- A
hadronMCP server listed in VS Code's MCP-servers view with theh-*tools available. - A row in your portal API-keys page with a source badge reading
OAuth: dcr_…<client>— the token VS Code is using.
What you need¶
- A Hadron portal account at hadronmemory.com.
- VS Code with MCP support enabled.
- For local development only:
cloudflared(Homebrew:brew install cloudflared) + a running localhadron-server.
Production install¶
- Open VS Code → Command Palette (
⌘/Ctrl + Shift + P) → run MCP: Add Server. - Choose the HTTP transport.
- Paste the Hadron MCP URL:
https://srv.hadronmemory.com/mcp. - VS Code performs the OAuth discovery handshake automatically (PRM → AS metadata → DCR) and opens a browser window to Hadron's sign-in page.
- Sign in via GitHub if you haven't already; the consent screen then renders.
- Review the consent screen — it shows the client name
("Visual Studio Code"), the requested scope (
mcp), and the resource (Hadron's MCP endpoint). - Click Approve.
- VS Code redeems the authorization code for an access token and stores it.
- The
hadronMCP server appears in the MCP-servers view with theh-*tools listed.
Test it: open the Copilot Chat panel and ask "List my Hadron
memories" — if the wiring is right, Copilot calls h-list-memories
and shows the result.
Local development install (cloudflared tunnel)¶
VS Code's OAuth client requires HTTPS, so to test against a local
hadron-server, expose it through Cloudflare's free quick-tunnel.
1. Start the server¶
2. Open the tunnel¶
cloudflared tunnel --url http://localhost:4000
# Copy the printed https://<random>.trycloudflare.com URL
3. Add the server in VS Code¶
MCP: Add Server → HTTP → paste
https://<random>.trycloudflare.com/mcp. The OAuth dance runs the
same way as in production; the sign-in browser window opens against
the tunnel URL.
4. Verify¶
Open Copilot Chat and confirm the h-* tools are listed under
MCP servers.
Verifying + revoking¶
Each successful OAuth install creates a row on your
API keys page with a source badge like
OAuth: dcr_abc123…. The suffix is the client identifier VS Code
registered.
To disconnect VS Code:
- Open the portal → Account → API keys (sidebar).
- Find the row with the matching
OAuth:source badge. - Click Revoke → confirm.
The next time VS Code tries to use that token, /mcp returns
401 Unauthorized and VS Code's MCP UI will prompt you to
re-authenticate.
Troubleshooting¶
VS Code's MCP OAuth implementation closely mirrors Claude Desktop's. If something goes wrong, the Claude Desktop troubleshooting section covers the same failure modes — AS-metadata fields, HTTPS in advertised URLs, CSRF on the consent screen.
The two VS-Code-specific gotchas:
"Add Server" command isn't in the palette¶
VS Code's MCP support ships behind a setting in some recent releases.
In Settings, search for mcp and confirm the relevant feature flag
is on. The exact setting name varies by VS Code minor version.
Tools don't appear after Approve¶
VS Code caches the MCP server list; the new connection may not show up until you reload the window (Command Palette → Developer: Reload Window) or restart VS Code.
What's actually happening¶
Same OAuth 2.1 dance as the
Claude Desktop install —
PRM → AS metadata → DCR → PKCE-protected /authorize → /token
exchange. VS Code and Claude Desktop both implement the
MCP OAuth 2.1 specification,
so the user experience is intentionally near-identical.
See Authentication for the conceptual overview of why Hadron uses a single credential format at the server layer.