SpecMatter field notes

Claude Code / MCP connection field notes

Claude Code MCP: add, scope, verify, and debug a server

Short answer: add a remote server with claude mcp add --transport http NAME URL, or add a local process with claude mcp add --transport stdio NAME -- COMMAND ARGS. Choose local, project, or user scope deliberately. Then run claude mcp list and claude mcp get NAME. An Added message proves the configuration was written; only a health status such as Connected proves that Claude Code completed a connection check.

On this Windows machine, Claude Code 2.1.283 connected to a purpose-built stdio server in an isolated local scope. The same server placed in a project .mcp.json stayed at Pending approval. A URL entry with no type was skipped with a precise diagnostic. No Claude login, model request, OAuth flow, third-party server, or credential was used.

Claude Code MCP flow from HTTP or stdio through scope selection and list or get checks to connected, pending approval, or configuration warning states
The tested distinction: the same server can be connected in local scope and pending approval in project scope.

Local test: Windows 11, Claude Code 2.1.283, 2026-09-29. Isolated configuration directory; zero credentials and zero model calls.

Choose the transport from the server shape

Server shapeCommandUse it forImportant detail
Remote HTTPclaude mcp add --transport http NAME URLCloud services and hosted APIsHTTP is the recommended remote transport
Local stdioclaude mcp add --transport stdio NAME -- COMMAND ARGSLocal binaries, scripts, and tools needing machine accessThe double dash keeps server flags out of Claude Code's argument parser
Remote SSE--transport sseLegacy endpoints that expose only SSESSE is deprecated; prefer HTTP when available
WebSocketclaude mcp add-json NAME '{"type":"ws",...}'Persistent bidirectional event streamsConfigure it with JSON; the transport flag does not accept ws
claude mcp add --transport http docs https://mcp.example.com/mcp

claude mcp add --transport stdio local-tools -- \
  node .\server.mjs --mode safe

A URL without a transport type is not a harmless omission. Claude Code treats an entry with no type as stdio, so a bare url is a configuration error rather than an HTTP default.

Scope decides who sees the server

ScopeStored inAudienceObserved or documented behavior
LocalUser configuration, keyed to one projectOne user in one repositoryPrivate project-specific server; highest precedence of the three scopes
Project.mcp.json at the project rootRepository collaboratorsShareable, but interactive sessions require approval before use
User~/.claude.jsonOne user across projectsGood for personal utilities used everywhere
claude mcp add --scope local   --transport stdio demo -- node server.mjs
claude mcp add --scope project --transport stdio demo -- node server.mjs
claude mcp add --scope user    --transport http  demo https://example.com/mcp

If the same name exists in multiple scopes, Claude Code uses one complete definition rather than merging fields. The documented precedence is local, project, then user, followed by plugin-provided servers and claude.ai connectors.

Isolated Windows test: connected versus pending approval

The fixture was a small Node stdio process written for this test. It answered initialize, ping, tools/list, and tools/call, and exposed one tool named echo_probe. Claude Code ran against a task-only CLAUDE_CONFIG_DIR, so the real user configuration was not changed.

claude mcp add --transport stdio --scope local \
  specmatter-echo -- node .\echo-server.mjs

claude mcp list
claude mcp get specmatter-echo
CaseExitObserved status or outputWhat it proves
Add local stdio server0Added stdio MCP server specmatter-echo ... to local configThe local configuration was written
List local server0specmatter-echo ... ConnectedClaude Code started the fixture and completed its health check
Get local server0Scope Local config, status Connected, type stdioThe resolved scope, command, and status were inspectable
Add the same fixture to project scope0Pending approval (run claude to approve)A committed project entry is not automatically trusted
Get an unknown name1No MCP server named "missing-server"A missing name is distinguishable from a failed connection

Download the MCP observations (CSV) Download the minimal stdio fixture

Claim boundary: this test proves CLI configuration, stdio process startup, MCP initialization, tool discovery during the health check, scope reporting, and the approval boundary. It does not prove a model-selected tool call, remote HTTP, OAuth, SSE fallback, WebSocket behavior, or production safety.

Failure matrix: read the status before changing the config

SignalMeaningNext check
ConnectedThe health check reached the serverInspect the tool count and test only the intended tool
Pending approvalA project .mcp.json entry has not been approvedOpen an interactive session in a trusted workspace and review the server
Needs authenticationThe remote endpoint requires an auth flowUse claude mcp login NAME only after verifying the endpoint
Failed to connectThe definition loaded, but the connection failedRead the HTTP status or transport detail from mcp get
No MCP server named ...The requested name did not resolveRun claude mcp list and check spelling and scope
url but no typeThe remote entry was skipped as invalidAdd "type":"http", "sse", or "ws"

In the malformed fixture, claude mcp list itself exited 0 while the diagnostic block said the server was skipped. A successful list command therefore does not mean every entry loaded successfully; read the diagnostics below the list.

A repeatable verification sequence

  1. Verify the server owner, executable, endpoint, and requested credentials before adding anything.
  2. Choose the narrowest scope that matches the audience. Start with local for an evaluation.
  3. Run claude mcp list; do not stop at the earlier Added message.
  4. Run claude mcp get NAME to inspect the resolved scope, transport, command or URL, and failure detail.
  5. For project scope, review and approve the server interactively instead of committing an approval shortcut.
  6. Open /mcp in an authenticated session to inspect tool count and disable a server without deleting its configuration.
  7. Call one low-risk tool with controlled input before granting broader access.

Servers can expose external content to the model, so prompt injection is part of the threat model. Treat tool descriptions, remote data, and server-returned instructions as untrusted input.

FAQ

Does Added mean the MCP server works?

No. It means the configuration was written. Run claude mcp list or claude mcp get NAME and read the health status.

Which scope should I use first?

Use local scope for a project-specific evaluation. Move to project scope only when teammates need the same reviewed definition, or user scope when you need the server across projects.

Why is a project server pending approval?

Claude Code does not let a cloned repository silently approve its own .mcp.json server. An interactive session must review the server in a trusted workspace.

Was a model allowed to call the test tool?

No. There was no Claude login and no model request. The CLI health check connected to the fixture; model-driven invocation remains untested.

Sources and related field notes

Official documentation checked 2026-09-29. Local observations were produced with Claude Code 2.1.283. SpecMatter is not affiliated with Anthropic.