Skip to main content

Configure Claude Code

Claude Code is Anthropic's terminal-based agent. It supports MCP servers via the claude mcp subcommand.

Add the server

claude mcp add onesource -e ONESOURCE_API_KEY=sk_… -- npx -y @one-source/mcp@latest

This registers a stdio MCP server named onesource. Claude Code stores the config in your user-level ~/.claude.json (or per-project .claude/settings.json if run from a project directory).

Verify

In a Claude Code session:

> Call 1s_setup_check.

Expected: a tool-use block showing Status: Configured (API key) and the count of tools registered (30).

Common scopes

  • User-scoped (default with claude mcp add): the server is available in every Claude Code session you start.
  • Project-scoped: prefix with --scope project to write to .claude/settings.json in the current directory. Useful if different projects need different API keys.
claude mcp add onesource --scope project -e ONESOURCE_API_KEY=sk_… -- npx -y @one-source/mcp@latest

Remove or re-add

claude mcp remove onesource
claude mcp list # see what's registered

Windows note

If npx fails to launch on your Windows configuration, wrap the command with cmd /c:

claude mcp add onesource -e ONESOURCE_API_KEY=sk_… -- cmd /c npx -y @one-source/mcp@latest

Troubleshooting

  • "MCP server onesource already exists": run claude mcp remove onesource first, then re-add.
  • 403 / wrong key: a stale ONESOURCE_API_KEY in your shell rc file (.zshrc, .bashrc) can shadow the value Claude Code passed. Run echo $ONESOURCE_API_KEY outside Claude Code to check, then unset it in your shell or rotate the key in the MCP config.
  • npx slow to start: first call downloads the package. Subsequent calls hit npm's local cache and start fast.
  • npx / command not found: confirm Node.js is on PATH (node --version). On Windows, re-run the Node.js installer and make sure "Add to PATH" is checked, or restart your terminal after install.

Next