Connect with MCP

Cursor

One entry in mcp.json gives Cursor's agent every published tool, billed to your wallet.

Sections

You are connecting Cursor to the Nexus402 gateway, which is one remote MCP server. You install nothing and host nothing: Cursor speaks MCP over HTTPS to the gateway, and the gateway forwards each paid call to the creator who built the tool. If you want to build and sell a tool instead, see Build a Server.

Prerequisites #

  • A Nexus402 account, signed in with Google, GitHub or Apple, with the developer role.
  • Money to spend: a funded wallet, or trial credit if an offer is running when you sign up (it pays only for creators' free calls). See Funding and spend.
  • An API key. Create it under Keys in the app; it starts nx_dev_, is shown once, and needs a 24-hour spend cap. Give Cursor a key of its own, so its cap bounds what Cursor's agent can spend. See Keys, caps and rotation.
  • A current version of Cursor.

Configure the connection #

Cursor reads MCP servers from mcp.json: ~/.cursor/mcp.json for every project, or .cursor/mcp.json inside one project. Add the gateway as a remote server with a url and your key in headers:

~/.cursor/mcp.json json
{
  "mcpServers": {
    "nexus402": {
      "url": "https://api.nexus402.dev/v1/mcp",
      "headers": { "X-Nexus-Api-Key": "${env:NEXUS402_API_KEY}" }
    }
  }
}

The ${env:NEXUS402_API_KEY} form reads the key from an environment variable when Cursor starts, so the file holds no secret and can be committed. Set the variable where Cursor will see it, then restart Cursor:

Set the key (macOS or Linux shell; on Windows use setx, then sign out and back in) bash
export NEXUS402_API_KEY="nx_dev_..."
  • Keep the name short. Cursor limits the server name plus the tool name to 60 characters and filters out tools over that. nexus402 leaves the most room for creators' tool names.
  • Define it once. If the same server appears in both the global and the project file, remove one: duplicate definitions are a known cause of headers going missing.
  • A key pasted directly in place of ${env:…} also works. It is then a secret in a file, so keep that file out of version control.

Verify the connection #

  1. Open Cursor's settings and find the MCP section. nexus402 should be listed and switched on, with its tools.
  2. In the agent chat, the gateway's tools appear under the available tools.
  3. If it does not connect, open the Output panel (Ctrl/Cmd+Shift+U) and choose MCP Logs.

To separate a key problem from a Cursor problem, ask the gateway directly. tools/list is never billed:

Check the key without Cursor bash
curl -s https://api.nexus402.dev/v1/mcp \
  -H "X-Nexus-Api-Key: $NEXUS402_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

A JSON list of tools means the key and the gateway are fine and anything left is Cursor's configuration. {"error":{"code":"unauthorized"}} with a 401 means the key is wrong, revoked or expired.

Use the tools #

Ask the agent for something a tool does, or name the tool. Each tool comes with the creator's description and input schema, so the agent knows its arguments. Every tool you call through the gateway is billed at its fixed price per call, once, to the wallet behind the key; a tool with free calls costs nothing until they run out.

  • Names are rewritten. The gateway names a tool handle/server/tool, for example acme/weather/forecast. Cursor accepts letters, digits and underscores, so it shows the name with the slashes removed or replaced, and calls the original name for you. The gateway also accepts the tool's listed name, acme_weather_forecast.
  • Which tools you see. A key with no tool scope sees the latest published version of every tool. A key scoped to some tools sees only those.
  • Cursor's tool approval still applies: the agent asks before it runs a tool unless you have allowed it to run automatically. Every run is a paid call.

Common errors #

What you seeLikely causeFix
An OAuth or sign-in prompt, or a red serverThe gateway answered 401: the key is missing, wrong, revoked or expired. Cursor reacts to a 401 by trying OAuth, which the gateway does not useRun the curl check above. Fix the key or the environment variable, then restart Cursor fully
The server shows no toolsThe variable is unset in the environment Cursor started from, or the key is scoped to no published toolStart Cursor from a shell that has the variable, or paste the key in a local-only file. Check the key's tool scope
"Some tools have naming issues and may be filtered out"A server name plus tool name over 60 charactersUse a short server name such as nexus402
A tool call fails with Budget_Exhausted (402)The wallet cannot cover the call, or the key's 24-hour cap would be exceededAdd funds or raise that key's cap. Nothing was charged
key_rate_limited (429)Too many requests on this key in its windowWait the seconds in Retry-After
Upstream_Unavailable (502)The creator's endpoint failed or timed outRetry later. You were not charged

Install agent tools

Help your coding agent stay on track when building with Nexus402. Learn more

Paste this into Claude Code, Codex or Cursor. Your agent connects itself to Nexus402 and adds the skills, for whichever tool it is.

Prompt for your agent text
Set up Nexus402 for me in this coding agent.
1. Read https://www.nexus402.dev/docs/agents.md and work out which tool you are (Claude Code, Codex or Cursor).
2. Add the Nexus402 MCP server https://api.nexus402.dev/v1/mcp the way that page shows for your tool, sending the X-Nexus-Api-Key header from the NEXUS402_API_KEY environment variable.
3. Install the skills listed at https://www.nexus402.dev/.well-known/skills/index.json where your tool keeps skills or rules.
Never write my key into a file, a commit or a reply. If NEXUS402_API_KEY is not set, stop and tell me to set it.
Then check the connection lists tools, and tell me what you changed.

Connect the gateway, then add the two skills.

Terminal bash
claude mcp add --transport http --scope user nexus402 https://api.nexus402.dev/v1/mcp \
  --header "X-Nexus-Api-Key: $NEXUS402_API_KEY"

mkdir -p ~/.claude/skills/nexus402-tools && curl -fsSL https://www.nexus402.dev/.well-known/skills/nexus402-tools/SKILL.md -o ~/.claude/skills/nexus402-tools/SKILL.md
mkdir -p ~/.claude/skills/nexus402-endpoint && curl -fsSL https://www.nexus402.dev/.well-known/skills/nexus402-endpoint/SKILL.md -o ~/.claude/skills/nexus402-endpoint/SKILL.md

Add the gateway to ~/.codex/config.toml, then add the skills with npx skills add https://www.nexus402.dev.

~/.codex/config.toml toml
[mcp_servers.nexus402]
url = "https://api.nexus402.dev/v1/mcp"
env_http_headers = { "X-Nexus-Api-Key" = "NEXUS402_API_KEY" }
tool_timeout_sec = 130
Add to Cursor

Opens Cursor and asks to add the gateway. Your key is read from NEXUS402_API_KEY.

Or add it by hand to ~/.cursor/mcp.json. Then add the skills with npx skills add https://www.nexus402.dev.

~/.cursor/mcp.json json
{
  "mcpServers": {
    "nexus402": {
      "url": "https://api.nexus402.dev/v1/mcp",
      "headers": {
        "X-Nexus-Api-Key": "${env:NEXUS402_API_KEY}"
      }
    }
  }
}

Skills-only installs don't update automatically.

Terminal bash
npx skills add https://www.nexus402.dev

Every option reads your key from NEXUS402_API_KEY; none writes it into a file. Learn more