nstantcode-mcp
v0.1.5
Published
stdio MCP bridge to the hosted nstantcode MCP server for clients that require a local command
Maintainers
Readme
nstantcode-mcp
A stdio MCP bridge to the hosted nstantcode MCP server, for clients that cannot perform the remote OAuth flow themselves.
Claude web and Claude Code can add https://nstantcode.com/mcp directly. Codex CLI uses
this package because its supported mcp add syntax launches a local command.
What it does
It is a transparent JSON-RPC proxy. Messages from the client are forwarded verbatim to
https://nstantcode.com/mcp with a Bearer token, and replies are written back unchanged.
Because it does not model individual tools, all nc_* project tools added server-side
show up without updating this package. nTasks is intentionally a separate connector.
Setup
Codex
codex mcp add nstantcode -- npx -y nstantcode-mcp@latestEquivalent config:
# ~/.codex/config.toml
[mcp_servers.nstantcode]
command = "npx"
args = ["-y", "nstantcode-mcp@latest"]Any client that launches a local command
{
"mcpServers": {
"nstantcode": {
"command": "npx",
"args": ["-y", "nstantcode-mcp@latest"]
}
}
}First run
- The bridge finds no cached token and starts a device-authorization session.
- It prints a one-time URL to stderr, which your MCP client surfaces to you.
- Open it, sign in, approve.
- The token is cached at
~/.config/nstantcode-mcp/token.json(mode 0600) and reused.
Your password never reaches the bridge — only the resulting token does.
Sign out or change account
Codex does not currently provide a logout button for a local stdio MCP server. To clear this bridge's cached nstantcode credential, run:
npx -y nstantcode-mcp@latest logoutThen start a new Codex task. The bridge will show a browser approval URL again; sign in to the intended nstantcode account and approve it. This clears the local cache only. It does not revoke an already-issued token at the server.
In MCP clients that expose the tool, nc_logout performs the same local sign-out and
tells the client to start a new MCP session.
nc_login starts a fresh device-authorization flow and returns the approval URL directly
in the tool result. This is preferable in Codex when the local MCP server's stderr output
is not visible.
Configuration
| Variable | Default | Purpose |
| --- | --- | --- |
| NSTANTCODE_BASE_URL | https://nstantcode.com | Backend base URL |
| NSTANTCODE_MCP_TOKEN | (none) | Pre-issued token; skips the browser flow entirely |
| NSTANTCODE_TOKEN_FILE | ~/.config/nstantcode-mcp/token.json | Token cache location |
| NSTANTCODE_CLIENT_NAME | nstantcode-mcp (<platform>) | Name shown on the approval page |
Local development against a backend on port 5001:
NSTANTCODE_BASE_URL=http://localhost:5001 npx nstantcode-mcpTokens
The device flow returns two tokens. This bridge uses mcpToken, which is audience-bound to
{origin}/mcp and carries the mcp_resource claim that endpoint requires. The other one,
token, is the generic agent JWT used by the nstantcode CLI against /api/* routes; it is
not accepted by /mcp.
If authorization fails with a complaint about a legacy agent token, the backend predates the dual-token device flow and needs updating.
On a 401 the bridge clears its cache, re-runs the browser flow once, and replays the
request.
The bridge explicitly requests only mcp:projects. Cached entries record that scope; a
cache created for the previous mixed connector is ignored so nTasks access cannot remain
attached to nstantcode.
The bridge also filters every tools/list response to nc_* and rejects non-project
tool calls locally. This protects the connector if it is temporarily used against an
older backend that still exposes a mixed catalog.
Manual smoke test
(echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"0"}}}'; \
sleep 1; \
echo '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'; \
sleep 3) | npx nstantcode-mcp@latesttools/list should return only the nc_* project tools.
If Codex was already running an older bridge, remove and add it again, then start a new Codex task so the MCP process and its cached tool catalog are replaced:
codex mcp remove nstantcode
codex mcp add nstantcode -- npx -y nstantcode-mcp@latestnTasks is a separate remote connector:
codex mcp add ntasks -- npx -y mcp-remote https://ntasks.nstantcode.com/mcpRelated
- Documentation/MCP_CONNECTOR.md — the server, its tools, and direct remote setup
- apps/NTasksMCP — the separate nTasks-only stdio server
