Claude Code — MCP server not loading, tools missing from the session (2026) — Fix Guide (2026) | AI Error Hub
Home Providers Claude Code MCP not loading
Claude Claude Code · MCP Severity: Medium HTTP n/a

Claude Code — MCP server not loading, tools missing from session

Claude Code has its own MCP configuration system, distinct from Claude Desktop. Servers configured for Desktop do not automatically load in Code — and vice versa.

By Sana K. · Cloud AI Reliability Engineer Published 2026-07-26 Verified 2026-07-26

Quick fix (TL;DR)

Resolution: Claude Code loads MCP servers from three config scopes: project (.mcp.json in the repo root), local (.claude/settings.local.json), and user (~/.claude/settings.json). Fix missing servers by (a) using claude mcp list to see what is actually loaded, (b) using claude mcp add instead of editing files by hand, and (c) approving the project scope on first entry to the directory.

Real error messages you'll see

These are the exact strings returned by the Claude API service and its SDKs when this error occurs. Copy-paste-searching any of them should land on this page.

Server configured but not visible
$ claude mcp list
No MCP servers configured for this project.

(but ~/.claude.json has "mcpServers": {...})
Server appears but tools missing
$ claude mcp list
my-postgres: ✓ connected

$ claude
> what tables are in my database?
(no tools called — Claude answers from parametric knowledge)
Project MCP file present but not activated
$ claude
⚠ New MCP servers found in .mcp.json:
   - my-analytics
   - my-postgres
Do you trust these servers? [y/N]

Reference

MCP config scopes in Claude Code (highest precedence first)

ScopeFileShared?
project.mcp.json at repo rootYes — checked in for the team
local.claude/settings.local.jsonNo — personal to your checkout
user~/.claude/settings.jsonNo — applies to all projects

<code>claude mcp</code> CLI commands

CommandPurpose
claude mcp listList servers loaded in this project
claude mcp add <name> --scope [project|local|user] -- <command>Add a stdio server
claude mcp add-json <name> <json>Add a full config JSON
claude mcp add --transport sse <name> <url>Add an SSE server
claude mcp remove <name> --scope ...Remove a server
claude mcp reset-project-choicesRe-prompt trust decisions for the current project

Root causes, ranked by frequency

Based on developer reports across Claude API forums, GitHub issues, and Anthropic community during 2025–2026.

  • 26%
    Server configured for Claude Desktop, not Claude Code. Claude Desktop reads ~/Library/Application Support/Claude/claude_desktop_config.json; Claude Code does not.
  • 18%
    Project .mcp.json not yet trusted. First entry to the directory prompts for trust; declining leaves the servers unloaded silently.
  • 14%
    Server loads but does not advertise expected tools. Connection succeeds, tools/list returns an empty array — server misconfiguration.
  • 10%
    Wrong scope for the config. Added at user scope; project has its own .mcp.json that overrides.
  • 8%
    Command path wrong or missing. Same PATH issue as Claude Desktop — commands added by hand often lack absolute paths.
  • 7%
    Trust decisions cached but user changed scope. Trust choice was made under user scope; new project scope needs re-approval.
  • 10%
    Environment variables not propagated. Server needs DATABASE_URL or an API key that lives in the user's shell, not in the MCP config.
  • 7%
    Server crashes on startup. Silent — claude mcp list shows connected briefly then disconnects.

Fixes — copy-paste solutions

Fix #1

Add MCP servers using the CLI, not by editing files

The CLI enforces the right shape and picks the right file for each scope.

Use claude mcp add with an explicit --scope. The CLI writes to the correct file, tests the config, and updates the trust registry.

add_mcp_servers.sh
# Add a stdio server at PROJECT scope (checked into .mcp.json)
claude mcp add postgres \
  --scope project \
  -- /opt/homebrew/bin/uvx mcp-server-postgres \
     --connection-string "postgres://user:pass@localhost/mydb"

# Add a stdio server at USER scope (all projects, personal)
claude mcp add filesystem \
  --scope user \
  -- /opt/homebrew/bin/uvx mcp-server-filesystem /Users/me/projects

# Add an SSE remote server
claude mcp add company-tools \
  --scope project \
  --transport sse \
  https://mcp.internal.example.com/sse

# Add with a full JSON blob (env vars, args)
claude mcp add-json postgres '{
  "command": "/opt/homebrew/bin/uvx",
  "args": ["mcp-server-postgres"],
  "env": {"DATABASE_URL": "postgres://..."}
}' --scope project

# Verify
claude mcp list
# postgres: ✓ connected (project scope)
# filesystem: ✓ connected (user scope)

# Test each server's tools directly
claude mcp inspect postgres    # opens the Inspector for that server
Project scope writes to .mcp.json at the repo root and is meant to be checked in. Local scope writes to .claude/settings.local.json. User scope writes to ~/.claude.json.
Fix #2

Handle project-scope trust prompts intentionally

First-time entry prompts once; declining silently skips the servers.

When a project ships .mcp.json, Claude Code prompts on first entry: "Do you trust these servers?" The answer is stored and never asked again for that project. If you missed the prompt (or misclicked), reset with claude mcp reset-project-choices.

trust_flow.sh
# On first cd into a repo with .mcp.json:
$ cd my-repo
$ claude
⚠ New MCP servers found in .mcp.json:
   - postgres
   - github
Do you trust these servers? They will run with your file access. [y/N]

# If you answered "y" — trust is recorded, servers load on every future entry.
# If you answered "N" — servers stay unloaded silently until you re-prompt.

# Re-prompt for the current project:
claude mcp reset-project-choices
claude    # you will be asked again on next start

# Check current trust status
cat ~/.claude.json | jq '.projects."/absolute/path/to/my-repo".trustedMcpServers'
For CI or headless environments, set the environment variable CLAUDE_TRUST_ALL_MCP=1 to auto-accept trust prompts. Do this only in disposable containers — it accepts arbitrary servers a repo happens to ship.
Fix #3

Diagnose loading failures with the Inspector and verbose logs

Same debugging tools as Claude Desktop, different log paths.

Use claude mcp inspect to open the MCP Inspector against a specific server. Read Claude Code's per-server log to see startup errors. Cross-check that the server advertises tools.

debug_claude_code_mcp.sh
# 1) List loaded servers and their status
claude mcp list

# postgres: ✓ connected
# github: ✗ startup failed (see log)
# custom: ✓ connected (0 tools)   ← connected but useless

# 2) Read the per-server log
ls ~/.claude/logs/mcp/
# mcp-server-github-2026-07-30.log
tail -f ~/.claude/logs/mcp/mcp-server-github-*.log

# 3) Inspect a specific server (interactive)
claude mcp inspect github
# opens the MCP Inspector UI at localhost:5173

# 4) Run the server manually to see stderr directly
/opt/homebrew/bin/uvx mcp-server-github
# (typically errors are clearer here than through the client wrapper)

# 5) Enable verbose logging for the whole session
CLAUDE_MCP_LOG_LEVEL=debug claude

# 6) Confirm the server is advertising tools
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | \
  /opt/homebrew/bin/uvx mcp-server-github
A server that "connects" but advertises zero tools is the sneakiest failure mode — Claude appears to have the tool but silently answers from parametric knowledge. Always check tools/list returns a non-empty array.

Prevention checklist

Ship these seven safeguards once and this error stops appearing in your logs.

  • Configure MCP with claude mcp add; do not hand-edit config files.
  • Use project scope (.mcp.json) for team-wide servers and check the file in.
  • Use absolute command paths — never rely on the shell PATH inherited by the CLI.
  • Verify with claude mcp list after every config change.
  • For CI/headless runs, set CLAUDE_TRUST_ALL_MCP=1 only in disposable containers.
  • When a server advertises no tools, run it through claude mcp inspect to confirm the manifest.
  • Document required env vars in the .mcp.json comments so teammates set them before first run.

Frequently asked questions

No. Claude Desktop reads claude_desktop_config.json; Claude Code reads .mcp.json and settings.json files. Servers must be configured separately for each. You can copy the JSON between them but the file locations differ.
Project .mcp.json is checked into a repo. A malicious repo could ship an MCP server that reads your files or exfiltrates data. The trust prompt is a one-time gate ensuring you consciously accept servers a repo brings.
Add them at user scope: claude mcp add --scope user .... Written to ~/.claude.json, applies to every project. Project scope overrides user scope for the same server name.
Use claude mcp remove <name> --scope [project|local|user]. Without --scope the CLI removes from local scope by default. Verify with claude mcp list afterwards.
Put env var references in the config and set the actual values in your shell profile or a .env loaded by your shell. Claude Code inherits the shell environment when launched, so MY_KEY defined in ~/.zshrc is available to server processes.

Get the weekly AI-error digest

New fixes, provider status recaps, and one deep tutorial — every Tuesday. 8,400+ engineers.