MCP setup and troubleshooting for Claude Code and Codex
MCP (Model Context Protocol) lets a coding agent call tools on another service. This page lists six setups for Claude Code and Codex. Three were tested on 2026-11-20 against free public servers that need no account and no key. The other three are documentation only: we did not run them.
Each setup has its own page in entries/ with the exact command, the config, and what we saw. Below the
table are three common problems, each with the symptom, the fix and a command that shows the fix worked.
The setups
"Tested" means: Claude Code 2.1.314 connected to the server, and one read-only tool call returned data. "Documentation only" means the facts come from the publisher's docs and we did not run it. Codex CLI is not installed here, so every Codex entry is documentation only.
| Setup | Client | Server | Transport | Authentication | Read or write | Cost and account | Status | Last checked |
|---|---|---|---|---|---|---|---|---|
| Claude Code + DeepWiki | Claude Code 2.1.314 | DeepWiki (Cognition) https://mcp.deepwiki.com/mcp |
Streamable HTTP | None | Read only (3 tools) | Free, no account; public GitHub repos only | Tested | 2026-11-20 |
| Claude Code + Microsoft Learn | Claude Code 2.1.314 | Microsoft Learn https://learn.microsoft.com/api/mcp |
Streamable HTTP | None | Read only (3 tools) | No charge, no account; Microsoft Learn Terms of Use apply | Tested | 2026-11-20 |
| Claude Code + AWS Knowledge | Claude Code 2.1.314 | AWS Knowledge https://knowledge-mcp.global.api.aws |
Streamable HTTP | None | Read only (5 tools) | No cost, no AWS account; rate limited (numbers not published) | Tested | 2026-11-20 |
| Claude Code + GitHub | Claude Code (docs) | GitHub remote, read-only https://api.githubcopilot.com/mcp/readonly |
Streamable HTTP | GitHub personal access token, referenced as ${GITHUB_PAT} in a header |
Read only at this URL; /mcp/ without readonly adds write tools |
GitHub account and token needed; plan needs not stated in the guide | Documentation only | 2026-11-20 |
| Codex + DeepWiki | Codex CLI (docs) | DeepWiki https://mcp.deepwiki.com/mcp |
Streamable HTTP | None | Read only | Free, no account | Documentation only | 2026-11-20 |
| Codex + GitHub | Codex CLI (docs) | GitHub remote, read-only https://api.githubcopilot.com/mcp/readonly |
Streamable HTTP | Token from an environment variable (bearer_token_env_var) |
Read only at this URL; /mcp/ without readonly adds write tools |
GitHub account and token needed | Documentation only | 2026-11-20 |
Sources, all checked 2026-11-20:
- Claude Code MCP docs: https://code.claude.com/docs/en/mcp
- Codex MCP docs: https://developers.openai.com/codex/mcp (now redirects to https://learn.chatgpt.com/docs/extend/mcp?surface=cli)
- DeepWiki MCP: https://docs.devin.ai/work-with-devin/deepwiki-mcp
- Microsoft Learn MCP: https://learn.microsoft.com/en-us/training/support/mcp
- AWS Knowledge MCP: https://awslabs.github.io/mcp/servers/aws-knowledge-mcp-server and the general availability notice https://aws.amazon.com/about-aws/whats-new/2025/10/aws-knowledge-mcp-server-generally-available
- GitHub MCP server: https://github.com/github/github-mcp-server (install guides for Claude and Codex, and
docs/remote-server.md)
Where Claude Code and Codex keep MCP servers
| Claude Code | Codex CLI | |
|---|---|---|
| Add from the shell | claude mcp add --transport http <name> <url> |
codex mcp add <name> --url <url> (remote) or codex mcp add <name> -- <command> (local) |
| Config just for you | ~/.claude.json (local and user scope) |
~/.codex/config.toml, one [mcp_servers.<name>] table per server |
| Config shared with a team | .mcp.json in the project root (project scope) |
.codex/config.toml in the project (trusted projects only) |
| Check status | claude mcp list, claude mcp get <name>, /mcp in a session |
codex mcp list, /mcp in the Codex TUI |
| Remote sign-in (OAuth) | /mcp in a session, or claude mcp login <name> |
codex mcp login <name> |
| Transports | HTTP (recommended), SSE (deprecated), stdio, WebSocket | stdio and streamable HTTP. The docs do not mention SSE |
Try one in two minutes (Claude Code)
This uses DeepWiki: free, no account, no key, read only. It works in a new empty folder and does not change your own Claude Code setup.
mkdir mcp-try && cd mcp-try
cat > mcp.json <<'EOF'
{"mcpServers":{"deepwiki":{"type":"http","url":"https://mcp.deepwiki.com/mcp"}}}
EOF
claude -p --model sonnet \
--setting-sources project \
--strict-mcp-config --mcp-config ./mcp.json \
--tools "" \
--allowedTools "mcp__deepwiki__read_wiki_structure" \
--permission-mode dontAsk \
--no-session-persistence \
"Call the read_wiki_structure tool for the GitHub repo modelcontextprotocol/modelcontextprotocol and reply with the first five topic titles only." \
< /dev/null
What the flags do:
--strict-mcp-config --mcp-config ./mcp.json: load only the server in this file, none of your others.--setting-sources project: skip your user settings for this run.--tools "": no built-in tools (no shell, no file edits). The MCP tools are still there.--allowedTools ...with--permission-mode dontAsk: the one read-only tool is allowed; anything else is refused.< /dev/null: stops Claude Code waiting 3 seconds for piped input.
You should get five topic titles, starting with "Overview". When you are done, delete the folder.
Three common problems
1. ✘ Failed to connect in claude mcp list
Symptom. claude mcp list or claude mcp get <name> shows ✘ Failed to connect, with an Issue: line. When we
pointed DeepWiki at a wrong path we saw:
deepwiki:
Scope: Project config (shared via .mcp.json)
Status: ✘ Failed to connect
Issue: MCP endpoint not found at https://mcp.deepwiki.com. Check the URL in your MCP config.
Type: http
URL: https://mcp.deepwiki.com/not-the-mcp-path
The docs say the Issue: text is the HTTP status or error code plus any text the server sent back. A 401 usually
means a missing, wrong or expired token in the header. A "not found", as above, points to a wrong URL or path. The
status means Claude Code could not reach the server, not that the list
command broke.
Fix. Copy the URL again from the publisher's page. Remove the server and add it again with the right URL:
claude mcp remove deepwiki -s project
claude mcp add --scope project --transport http deepwiki https://mcp.deepwiki.com/mcp
For a token problem, add the header again with a valid token (--header "Authorization: Bearer YOUR_TOKEN").
claude mcp add does not check the token, so a placeholder is accepted and only fails later.
Verify. claude mcp get deepwiki shows Status: ✔ Connected. In a session, /mcp shows a checkmark on the
server's row.
Reproduced in a scratch folder on 2026-11-20 (wrong path, then fixed). Source: Claude Code MCP docs, "Server status" and "Connection failures and unconfigured servers".
2. The server is skipped: "url" but no "type"
Symptom. A server copied from another tool's JSON does not show up, or claude mcp get <name> says
No MCP server named "<name>". claude mcp list prints a warning. We saw:
[Warning] [deepwiki] mcpServers.deepwiki: Skipped — MCP server "deepwiki" has a "url" but no "type"; add "type": "http" (or "sse" / "ws") to this entry
In a claude -p run the same file loaded no server at all, with no message. Claude Code reads an entry with no type
as a local (stdio) server, so a URL entry without a type is a config error.
Fix. Add the transport type to the entry in .mcp.json:
{
"mcpServers": {
"deepwiki": {
"type": "http",
"url": "https://mcp.deepwiki.com/mcp"
}
}
}
Use "http" for a streamable HTTP server, "sse" only where the publisher still offers SSE (Claude Code calls it
deprecated), and "ws" for WebSocket. Or let the CLI write it: claude mcp add --transport http <name> <url>.
Verify. claude mcp list no longer prints the warning, and claude mcp get deepwiki shows Status: ✔ Connected.
Reproduced in a scratch folder on 2026-11-20 (missing type, then fixed). Source: Claude Code MCP docs, "Add a server
from an mcpServers JSON block".
3. A project server waits for approval: ⏸ Pending approval
Symptom. A server in the project's .mcp.json (for example one a teammate checked in) shows:
deepwiki:
Scope: Project config (shared via .mcp.json)
Status: ⏸ Pending approval (run `claude` to approve)
Type: http
URL: https://mcp.deepwiki.com/mcp
Claude Code does not connect to it, and its tools are missing in interactive sessions. This is a safety step, not a
fault: a cloned repo cannot approve its own servers. enableAllProjectMcpServers or enabledMcpjsonServers in a
committed .claude/settings.json is ignored until you trust the folder.
Fix. Check the server before you approve it. Approving lets Claude Code connect to it, or for a stdio server run its command, with your access.
- Read its entry in the project's
.mcp.json: theurl, or thecommandandargs, plus anyenvandheaders. For a remote server, check the domain belongs to the publisher you expect. For a local server, check what the command runs. - Check who publishes the server, on the publisher's own documentation, and what its tools can do (read only, or write too).
- Then run
claudein the project, accept the workspace trust dialog, and approve that one server by name when asked. Don't approve all project servers at once, and don't useenableAllProjectMcpServers.
To undo your choices later, run claude mcp reset-project-choices. For a one-off check without an interactive
session, the docs say approvals passed with --settings also count. Name only the server you checked:
printf '{"enabledMcpjsonServers":["deepwiki"]}' > approve.json
claude --settings ./approve.json mcp get deepwiki
Verify. claude mcp get deepwiki shows Status: ✔ Connected instead of ⏸ Pending approval. With the
--settings file above we saw Status: ✔ Connected.
Reproduced in a scratch folder on 2026-11-20 (pending, then connected with --settings). The interactive approval was
not run. Source: Claude Code MCP docs, "Server status" and "Project server approvals and workspace trust".
How we tested
- Client: Claude Code 2.1.314, model
sonnet(reported asclaude-sonnet-5-5), macOS, 2026-11-20 about 22:30 UTC. - Each server ran in its own empty scratch folder. Nothing was added at user or local scope. The scratch configs were
removed afterwards with
claude mcp remove ... -s projectand by deleting the files. - Connection:
claude mcp get <name>showed✔ Connectedfor all three tested servers (project scope, approved with a--settingsfile). Theclaude -p --output-format stream-json --verboserun also reported"status": "connected"for the server in its first (init) event. - One read-only tool call per server, with only that tool allowed. Each run used one or two model turns and cost between 1 and 4 US cents of model use.
- Only public documentation was queried: a public GitHub repo's wiki, Microsoft docs, and the AWS region list.
Review it locally
Everything here is Markdown. To repeat a test, follow the entry page's "Test record". To check the links and facts, open each source URL above. The checks a reviewer should run, and what we got:
| Check | Command or step | Result on 2026-11-20 |
|---|---|---|
| Claude Code version | claude --version |
2.1.314 (Claude Code) |
| DeepWiki connects | claude mcp get deepwiki in a scratch project |
✔ Connected |
| DeepWiki read-only call | read_wiki_structure on modelcontextprotocol/modelcontextprotocol |
Page list returned, starting "1 Overview, 2 Protocol Specification" |
| Microsoft Learn connects | claude mcp get mslearn |
✔ Connected |
| Microsoft Learn read-only call | microsoft_docs_search "what is the Model Context Protocol" |
First result "Get started with .NET AI and the Model Context Protocol" |
| AWS Knowledge connects | claude mcp get awsknowledge |
✔ Connected |
| AWS Knowledge read-only call | aws___list_regions |
37 regions in the raw result (counted from the JSON), first af-south-1 |
| Problem 1 reproduced | wrong path /not-the-mcp-path |
✘ Failed to connect, then ✔ Connected after the fix |
| Problem 2 reproduced | .mcp.json entry with url and no type |
Skipped with the warning above, then ✔ Connected after adding "type": "http" |
| Problem 3 reproduced | claude mcp add --scope project ..., then claude mcp get |
⏸ Pending approval, then ✔ Connected with --settings |
| Cited links resolve | curl -s -o /dev/null -L -w '%{http_code}' on every <https://...> link in this folder |
12 of 12 returned 200 |
| No secrets in this folder | grep -rnE "ghp_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,}|Bearer [A-Za-z0-9_.-]{20,}" mcp-setup |
No matches; the GitHub examples reference ${GITHUB_PAT} and GITHUB_PAT_TOKEN and never ask for a token in a command |
| GitHub setup stores a reference, not a token | In a scratch folder: claude mcp add --scope project --transport http github https://api.githubcopilot.com/mcp/readonly --header 'Authorization: Bearer ${GITHUB_PAT}', then read .mcp.json |
.mcp.json holds "Authorization": "Bearer ${GITHUB_PAT}" and the /readonly URL. No connection was made. |
Known gaps
- Codex CLI is not installed, so no Codex entry was run. The Codex commands come from OpenAI's docs and GitHub's install guide only.
- The GitHub entries were not run: they need an account and a token, which this test did not use.
- None of the three free servers publish rate-limit numbers. AWS says usage is rate limited; DeepWiki and Microsoft Learn do not mention limits.
- The interactive approval step in problem 3, and OAuth sign-in through
/mcp, were not run, because the tests were non-interactive (claude -p). The docs say aclaude -prun cannot do an OAuth sign-in. - Running
claudein a new folder lets Claude Code record that folder in its own state file. We did not open or edit that file. - Facts can change. Each row says when it was checked.