AI Guides › Step-by-step guides
By Nigel Guy · 6 min read
Most people hear that Claude Code "needs MCP", paste six install commands from six blog posts, and end up with a session that starts slowly, shows forty tools it never uses, and holds a token with far more access than the job needs. It feels like progress because the tool list grows. It fails because nobody checked what each server could actually do, or who could be talked into misusing it.
The rule: add one server at a time, give it the narrowest access that does the job, and prove it works with one real question before you add the next.
MCP (Model Context Protocol) is the way Claude Code reaches outside your files: a server exposes tools, and Claude Code calls them. Reach matters more than a bigger model because the model already writes decent code; what it lacks is your live pull requests, a real browser, current library documentation, your error tracker and your data.
You need:
The five servers, and what each adds:
| Server | Adds | Auth | Catch |
|---|---|---|---|
| GitHub | PRs, issues, repo search | Personal access token | Token scope is your whole blast radius |
| Playwright | A real browser Claude can drive | None | Runs pages you point it at; "not a security boundary" per its own docs |
| Context7 | Current, version-specific library docs | Optional API key | Only as good as its index of your library |
| Sentry | Errors and performance data | OAuth | Scope it to one project |
| DBHub | Query a database | Connection string | Only safe with a read-only database user |
Three scopes decide where a server lives. Local (the default) loads in the current project only and is private to you. Project writes a .mcp.json in the project root that you can commit for your team. User loads in every project you open. Start with local.
In a terminal, in your project folder:
claude mcp list
Then start claude and type /mcp. That panel shows each server's status, authentication needs and tools, and lets you switch servers off per project. Note what is already there. If you use Claude on the web, connectors you added at claude.ai/customize/connectors also appear here when you are signed in.
Create a fine-grained personal access token at github.com/settings/personal-access-tokens. Grant it one repository and the least it needs; GitHub's own guidance is to enable only the permissions you are comfortable giving an AI tool. Then:
claude mcp add --transport http github https://api.githubcopilot.com/mcp/ --header "Authorization: Bearer YOUR_GITHUB_PAT"
The remote server also supports a read-only mode, but that is set by the server's own configuration flag rather than this command; check the GitHub MCP server README before relying on it, and meanwhile make the token read-only for a first trial.
claude mcp add playwright npx @playwright/mcp@latest
This gives Claude a browser it can open, click and read. Its documentation warns that it is not a security boundary, and that one tool, browser_run_code_unsafe, executes arbitrary JavaScript in the server process, which is equivalent to remote code execution. Point it at your own local dev site, not at pages you do not control.
Context7 pulls current documentation for the library version you are using, which targets the familiar failure of Claude suggesting an API that was renamed or never existed. Its README documents the endpoint https://mcp.context7.com/mcp with an optional API key sent as an Authorization: Bearer header, and a one-command setup:
npx ctx7 setup --claude
That signs you in through OAuth, creates a key and installs the integration. If you prefer to register it yourself, the Claude Code pattern for a remote server is the same as Step 2 with this URL. I could not confirm the exact registration line from the README alone, so check it against the page before copying.
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp/YOUR_ORG_SLUG/YOUR_PROJECT_SLUG
Then run /mcp, choose sentry and complete the browser sign-in; Sentry says all connections use OAuth. The URL scoping is the point: Sentry recommends project-level scoping for tighter access.
Claude Code's own docs use DBHub as the example:
claude mcp add --transport stdio db -- npx -y @bytebase/dbhub --dsn "postgresql://claude_ro:PASSWORD@localhost:5432/yourdb"
The -- is required for stdio servers. Create a database user that can only SELECT, and use that in the connection string. DBHub mentions read-only mode and limits, but I could not find the exact setting in its command-line docs, so do not rely on a flag; rely on the database user. Never put a production connection string here.
Run one question per server, in a fresh session, and watch /mcp for a connected status.
| Server | Test question |
|---|---|
| GitHub | "List my open pull requests in [REPO]. Do not change anything." |
| Playwright | "Open [LOCAL_URL], and tell me the heading on the page." |
| Context7 | "How do I do [TASK] in [LIBRARY] [VERSION]? Check current docs first." |
| Sentry | "What were the three most frequent unresolved errors this week?" |
| Database | "Describe the [TABLE] table. Read only." |
A server that is listed but fails its test question is a configuration fault, not a model fault. Fix it before adding anything else.
Imagine a small shop site. Sentry shows a checkout error. You ask Claude to read the error, find the code, check the library docs for the changed function, reproduce the failure in the browser on your local site, look at the order rows in a test database, and open a draft pull request. Each step uses one server, and each server only had the access you set in Steps 2 to 6. That is what "all five together" means: a chain of narrow tools, not one powerful one.
.mcp.json. Use environment variable expansion there, for example "Authorization": "Bearer ${GITHUB_PAT}", so the file you commit holds no key.MAX_MCP_OUTPUT_TOKENS. Ask narrower questions before raising it.claude mcp remove <name>. To sign out of an OAuth server: claude mcp logout <name>.