AI agents · OpenClaw · self-hosting · automation

Quick Answer

How MCP Servers Work With Coding Agents, and Which to Use

Published:

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

  1. 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.
  2. Discover. The agent calls tools/list and receives each tool’s name, description and JSON schema.
  3. Offer. Those definitions go into the model’s context alongside your prompt.
  4. Call. When the model decides to use a tool, the agent sends tools/call with arguments, usually after asking your permission.
  5. 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

AgentRemote serverLocal serverWhere config lives
Claude Codeclaude mcp add --transport http notion https://mcp.notion.com/mcpclaude 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>]
CursorMarketplace one-click install with OAuth, or a URL in mcp.jsonCommand in mcp.jsonmcp.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

ServerMaintainerWhat it gives the agentVersion / status (Oct 2026)Use when
GitHub MCP ServerGitHubIssues, 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 MCPMicrosoftDrives a real browser via accessibility snapshotsv0.0.83 (Sep 28, 2026)Verifying UI changes, reproducing bugs end to end
Context7UpstashCurrent, 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 monitorLinear, Atlassian, SentryTicket context, stack tracesVendor-hosted remote servers”Fix the bug in ENG-4521” workflows
Database (read-only)Your DB vendor or communitySchema and query accessVariesDebugging data issues; never give write access by default
Reference servers (Git, Filesystem, Fetch, Memory)MCP projectBasic building blocksActive in modelcontextprotocol/serversAgents 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 --toolsets flag 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.

Sources