How MCP Servers Work With Coding Agents, and Which to Use
The short answer
An MCP server is a small program that offers tools to an AI agent over a standard protocol; your coding agent is the client that lists those tools, hands them to the model, and runs the ones the model picks. For coding, the servers that pay for themselves are GitHub’s official server, Playwright MCP, Context7, your issue tracker or error monitor, and a read-only database connection. Keep the total small: every server’s tool list rides along in every request. Setup commands and versions below were checked October 19, 2026.
How it works, step by step
- Connect. The agent starts a local server as a subprocess (stdio transport) or connects to a remote URL (Streamable HTTP, usually with OAuth). Since the 2026-07-28 revision, MCP is stateless: the client declares its protocol version on every request instead of a one-time handshake.
- Discover. The agent calls
tools/listand receives each tool’s name, description and JSON schema. - Offer. Those definitions go into the model’s context alongside your prompt.
- Call. When the model decides to use a tool, the agent sends
tools/callwith arguments, usually after asking your permission. - Return. The server runs the action — a GitHub API call, a browser click, a SQL query — and the result goes back to the model for its next step.
That is why MCP matters for coding agents: the same GitHub or Playwright server works in Claude Code, Codex, Cursor, VS Code and others, instead of each tool shipping its own integration.
Adding a server in the three main agents
| Agent | Remote server | Local server | Where config lives |
|---|---|---|---|
| Claude Code | claude mcp add --transport http notion https://mcp.notion.com/mcp | claude mcp add playwright npx @playwright/mcp@latest | .mcp.json (project), ~/.claude.json (user) |
| Codex (CLI, IDE, app) | codex mcp add <name> --url <url> (OAuth flags supported) | codex mcp add with a command | ~/.codex/config.toml or .codex/config.toml (trusted projects), [mcp_servers.<name>] |
| Cursor | Marketplace one-click install with OAuth, or a URL in mcp.json | Command in mcp.json | mcp.json; transports stdio, SSE, Streamable HTTP |
Claude Code accepts streamable-http as an alias for http in JSON config and falls back to SSE automatically on v2.1.265 and later.
The most useful servers for coding agents
| Server | Maintainer | What it gives the agent | Version / status (Oct 2026) | Use when |
|---|---|---|---|---|
| GitHub MCP Server | GitHub | Issues, PRs, code search, Actions; remote endpoint api.githubcopilot.com/mcp/ | v2.0.2 (Oct 8, 2026) | Agent should open PRs, read issues, check CI |
| Playwright MCP | Microsoft | Drives a real browser via accessibility snapshots | v0.0.83 (Sep 28, 2026) | Verifying UI changes, reproducing bugs end to end |
| Context7 | Upstash | Current, version-specific library docs (mcp.context7.com/mcp, or npx ctx7 setup) | ctx7 0.8.0 (Oct 16, 2026) | Fast-moving frameworks the model knows badly |
| Issue tracker / error monitor | Linear, Atlassian, Sentry | Ticket context, stack traces | Vendor-hosted remote servers | ”Fix the bug in ENG-4521” workflows |
| Database (read-only) | Your DB vendor or community | Schema and query access | Varies | Debugging data issues; never give write access by default |
| Reference servers (Git, Filesystem, Fetch, Memory) | MCP project | Basic building blocks | Active in modelcontextprotocol/servers | Agents without built-in file or git tools; learning MCP |
Claude Code, Codex and Cursor already read files, edit code and run git themselves, so the reference Filesystem and Git servers add little there. Several older reference servers (GitHub, GitLab, Brave Search) were moved to an archive repository — use the vendors’ official servers instead.
Rules that keep MCP useful and safe
- Fewer tools, better choices. Enable only the toolsets you need; GitHub’s server has a
--toolsetsflag for this. - Trust before install. Anthropic’s docs warn that servers fetching external content expose you to prompt injection. Prefer official, vendor-maintained servers.
- Least privilege. Fine-grained, short-lived tokens; read-only database users; no production write access. See short-lived credentials for AI agents.
- Govern at scale. Teams with many agents put MCP traffic behind a gateway — see vendors extending API gateways into agent governance.
More server picks: best MCP servers, updated registry guide. Building one: how to build an MCP server. How MCP compares with plugins and skills: agent plugins vs MCP vs agent skills.
Last verified: October 19, 2026. Versions are each project’s latest GitHub release on that date.