← Alle Recipes
Phase 2 · Connectivity·5 min·5 steps

Your first MCP server — claude mcp add

Install your first MCP server in Claude Code or Codex in under two minutes. We pick context7 (library docs) — small, useful, no API key.

5 steps0%
Du liest ohne Account. Mit Login speichern wir Step-Fortschritt + Notes.

Your first MCP server

MCP (Model Context Protocol) is how Claude Code, Codex, and Cursor talk to external tools. An MCP server runs as a subprocess (stdio) or remote HTTP endpoint and exposes a list of "tools" the AI can call. Installing one is two commands.

We start with context7 because it's the lowest-friction win — it gives Claude up-to-date library docs (React, Next.js, Prisma, you name it) without any API keys. Once you've done this once, every other MCP server installs the same way.

Step 1: Pick the client (Claude Code or Codex)

Claude Code uses claude mcp add ... which writes ~/.claude.json.

Codex uses ~/.codex/config.toml directly (or codex mcp add ... if you have CLI 0.x+).

If you have both, do both — they share most servers but the config file differs.

Step 2: Install context7 in Claude Code

claude mcp add context7 -s user -- npx -y @upstash/context7-mcp

Breakdown:

  • claude mcp add — register a new server
  • context7 — the local name (whatever you want)
  • -s user — user-scope (vs project-scope .mcp.json)
  • -- npx -y @upstash/context7-mcp — the command that starts the server (npx auto-installs from npm)

npx -y is the magic — first call downloads the package, subsequent calls run from npm cache. No global install pollution.

Step 3: Same in Codex (optional)

Edit ~/.codex/config.toml:

[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]

Restart Codex (Cmd+Q on macOS, then reopen — VS Code Extension also needs a window reload).

Step 4: Verify

Run aiguide_validate_step. The validator runs claude mcp list and checks that at least one server is registered. To verify context7 specifically:

claude mcp list | grep context7

Or open a fresh Claude Code session and ask "what does the latest Next.js docs say about server actions?" — Claude will call context7's query-docs tool and you'll see the citation.

Step 5: The next servers worth installing

These three are all zero-config (no API keys) and pay off fast. Add them now or save them for later phases:

  • sequential-thinking — multi-step reasoning. Tiny, helps on hard problems. claude mcp add sequential-thinking -s user -- npx -y @modelcontextprotocol/server-sequential-thinking
  • filesystem — local file operations from a sandboxed root. claude mcp add filesystem -s user -- npx -y @modelcontextprotocol/server-filesystem /path/you/want/sandboxed
  • fetch — fetch web pages and parse them as text. claude mcp add fetch -s user -- npx -y @modelcontextprotocol/server-fetch

After this recipe you have a working MCP setup. The next four recipes layer in memory, web research, code intelligence, and GitHub — the four servers that turn Claude Code from "smart autocomplete" into "second engineer".

Client check · run on your machine
claude mcp list 2>&1 | head -20
Expect: At least one MCP server in the output (not "No MCP servers configured").
If stuck: Add a server with `claude mcp add <name> -s user -- npx -y <package>`.
settings.json + Permissions — Memory layer — give your AI pe