In plain English
A coding agent like Claude Code or Cursor is impressively capable, but out of the box it lives in a small box: your source files and a terminal. It can read code, edit code, and run shell commands. That covers a lot — but the instant a task needs something outside the repo, the agent is stuck guessing. "Is that column actually in the production database?" It doesn't know. "Did my change break the login page in the browser?" It can't look.

MCP — the Model Context Protocol — is the standard plug that lets the agent reach those outside things. You connect an MCP server (a small program that exposes some capability, like querying a database or driving a browser), and the agent gains a new set of tools it can call on its own. You don't write glue code; you just register the server, and the agent discovers what it can now do.
Here's the everyday analogy. A bare coding agent is a brilliant contractor who can only work inside one room with the tools already on the bench. MCP is the universal tool belt: clip on the "database" attachment and they can inspect your data; clip on the "browser" attachment and they can click through your app; clip on the "issue tracker" attachment and they can read the ticket they're supposed to fix. Same contractor, dramatically wider reach — and every attachment uses the same standard clip.
Why it matters
The reason MCP matters for coding specifically is that most real engineering tasks are not just "edit this file." They reach into systems the agent can't see from the filesystem alone, and without help the agent has to assume. Assumptions are exactly where agents hallucinate.
Think about what a bare agent cannot do, and how each gap turns into a guess:
- It can't see your live schema. Asked to write a query, it infers table and column names from your code or your prompt — and invents the rest. A database MCP server lets it run a read-only query and check what's really there.
- It can't run your app like a user. Asked to fix a broken page, it edits CSS and hopes. A browser-automation server lets it open the page, click through the flow, and read the actual error in the console.
- It can't read the ticket or PR. The full context of why you're making a change often lives in an issue tracker, not the repo. A server for your tracker lets the agent pull the requirements before it writes a line.
- It can't look up current library docs. Its training has a cutoff, so it may use an API that changed. A documentation server fetches the current, correct usage at the moment it's needed.
The payoff is a shift in what you can delegate. Without MCP, you hand the agent self-contained, file-only tasks and verify everything yourself. With the right servers connected, you can hand it tasks that span the whole loop: "read this Jira ticket, reproduce the bug in the browser, find the bad query against the staging database, fix it, and confirm the page renders." The agent does more of the work and checks its own results instead of guessing — which is the whole point of using an agent rather than autocomplete.
How it works
MCP follows a simple client–server split. Your coding agent is the MCP client (also called the host). Each capability you add runs as a separate MCP server — a tiny process the agent talks to over a standard protocol. The agent doesn't care how the server fetches data; it only sees a clean list of tools with names and descriptions.
When the agent starts, it asks every connected server, "what can you do?" Each replies with its tool list — for example a Postgres server might offer list_tables, describe_table, and query. The agent merges all of these into the toolbox it can choose from while it works. From then on, the flow on any task looks like this:
Crucially, the agent decides whether and when to call a tool — you don't script it. You describe the goal in plain language; the model reasons that it needs to look something up, picks the right tool, and feeds the result back into its own work. That self-directed tool use is what separates an MCP-equipped agent from a fixed pipeline.
How you connect a server
Connecting a server is configuration, not coding. Most agents read a JSON (or similar) config that says how to launch each server. A local server typically runs as a command on your machine; the agent spawns it and talks to it over standard input/output. A minimal Claude Code config for a filesystem and a Postgres server looks like this:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "./"]
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": { "DATABASE_URL": "postgres://readonly@localhost/app" }
}
}
}Which servers unlock which tasks
It helps to think in classes of server rather than individual products. Each class removes a specific blind spot and so unlocks a specific kind of delegation. Here are the ones that matter most for everyday coding work.
| Server class | What the agent gains | Task it now handles well |
|---|---|---|
| Database (Postgres, SQLite, etc.) | Read the real schema; run read-only queries | "Write the report query" — verified against live tables, not guessed |
| Browser automation (Playwright, etc.) | Open pages, click, read the DOM and console | "Reproduce and fix this UI bug" — confirmed in a real browser |
| Issue tracker / project (GitHub, Jira, Linear) | Read tickets, PRs, and comments | "Implement the change described in TICKET-412" — with full context |
| Documentation / search | Fetch current, correct library docs on demand | "Use the new API correctly" — even if it changed after the model's cutoff |
| File / cloud storage | Reach files outside the repo (designs, data dumps) | "Match the component to this Figma spec" or load a sample dataset |
The pattern is consistent: a server turns a guess into a lookup. The agent stops saying "the column is probably named created_at" and starts saying "let me check" — then writes code against the truth. For a bug fix, browser automation lets it close the loop entirely: change code, reload the page, confirm the symptom is gone, all without you in the middle.
The tradeoffs: cost, security, and context bloat
MCP is not free power. Every server you add has three costs, and ignoring them is how teams end up with an agent that is slower, less reliable, and a security risk. Weigh each before wiring anything up.
1. Setup and maintenance cost
Each server is another moving part: something to install, configure, give credentials to, and keep updated. A server that breaks or hangs can stall the whole agent. The rule of thumb is to add a server only when you have a recurring task that genuinely needs it — not because it exists. A database server you query every day earns its keep; one you used once does not.
2. Security and permissions
There is a second, subtler danger: untrusted content can carry instructions. If your agent reads a GitHub issue or a web page through an MCP server, and that text contains hidden commands aimed at the model, the agent might follow them — a form of prompt injection. Treat everything a server returns as data to consider, not orders to obey, and keep a human approving anything destructive. Many coding agents already ask you to confirm tool calls; leave that confirmation on for anything that writes or deletes.
3. Context bloat from too many tools
Every connected server's tools and descriptions get loaded into the model's context. Connect a dozen servers exposing eighty tools and you've done two harmful things at once: you've eaten a big chunk of the context window before the task even starts, and you've given the model so many similar options that it picks the wrong tool more often. Fewer, sharper tools beat a sprawling toolbox. If a server offers tools you never use, don't connect it.
- 3–4 servers you actually use
- Read-only / scoped credentials
- Each tool has a clear, distinct job
- Agent picks the right tool reliably
- Most context left for the real work
- A dozen servers "just in case"
- Broad, write-capable access
- Many overlapping, vague tools
- Agent picks the wrong tool more
- Context half-full before you start
Going deeper
Once the basics click, a few nuances separate a toy setup from a dependable one.
Local vs remote servers. The examples above launch servers locally over standard input/output, which is perfect for personal tools touching your own machine. MCP also supports remote servers reached over HTTP, which is how a team shares one hosted server (say, an internal docs or analytics service) across many developers. Remote servers raise the authentication stakes — now you're handing network-accessible credentials to an agent — so scope tokens tightly and prefer providers that support proper auth flows.
Project-scoped vs global config. Most agents let you register servers globally (available everywhere) or per-project (checked into the repo so the whole team gets the same tools). Project scope pairs naturally with context files like AGENTS.md and CLAUDE.md: the config says what tools exist, and the instructions file says how and when to use them. Together they make an agent's behavior reproducible across a team instead of depending on each person's local setup.
MCP is client-agnostic by design. The same Postgres or Playwright server works with Claude Code, Cursor, and any other MCP-aware host, because they all speak the one protocol. That portability is the real win over the old world of bespoke, per-tool plugins: you build or adopt a server once, and every agent that supports MCP can use it. Picking between agents (see Claude Code vs Cursor) no longer locks you out of a tool ecosystem.
Build your own when nothing fits. If your team has an internal system — a deployment tool, a custom data warehouse, a proprietary API — you can write a small MCP server that exposes exactly the operations you want the agent to perform, with exactly the guardrails you want. Because the protocol is fixed and well-documented, a focused server is often a short afternoon's work, and it turns your in-house systems into things you can safely delegate. Start narrow: expose the few read operations you trust, watch how the agent uses them, and widen access only once you're confident.
The durable lesson is the same one that applies to any agent tooling: capability and risk grow together. Every server you add makes the agent more useful and gives it more ways to do harm or waste context. The teams that get the most out of MCP are not the ones with the most servers — they're the ones who connected the few that matter, scoped them tightly, and kept a human on the destructive actions.
FAQ
What MCP servers are best for coding agents?
The highest-value classes are: a database server (so the agent checks your real schema instead of guessing), a browser-automation server like Playwright (so it can reproduce and verify UI bugs), an issue-tracker server for GitHub/Jira/Linear (so it reads the full requirements), and a documentation server (so it uses current library APIs). Start with whichever matches your most common task and add others only as needed.
How do I set up MCP in Claude Code?
Add an mcpServers entry to your config (for example a project-level .mcp.json) giving each server a name, the command to launch it, and any environment it needs — such as a read-only DATABASE_URL. Claude Code spawns the server, asks it which tools it offers, and the agent can then call them on its own. The exact file and keys are documented in the Claude Code docs.
Does Cursor support MCP?
Yes. Cursor is an MCP client, so the same servers you'd use with Claude Code work in Cursor too — that portability is the point of the protocol. The configuration UI and file location differ, but the shape is identical: a server name, a launch command, and its credentials or environment.
Is it safe to give a coding agent database access through MCP?
It can be, if you scope it. Connect with a read-only user and point at staging rather than production whenever possible, since the agent can call tools autonomously. Also treat any content the agent reads (issues, web pages) as untrusted, because hidden instructions in that text can attempt prompt injection. Keep a human confirming any action that writes or deletes.
Why is my coding agent slower or worse after adding MCP servers?
Likely context bloat. Every connected server loads its tool list and descriptions into the model's context, so a dozen servers can eat a large slice of the context window and give the model too many similar tools to choose between, making it pick wrong more often. Disconnect servers you don't actually use; a lean set of three or four sharp tools usually performs better.
Do I need MCP to use a coding agent?
No. A coding agent works fine with just your files and terminal for self-contained editing tasks. MCP matters when the work reaches outside the repo — into a database, a browser, a ticket, or live docs — where the agent would otherwise have to guess. Add a server when you have a recurring task that genuinely needs that outside access.