MODULE 07 / 12
MCP: The Connector Layer
Model Context Protocol is the open standard for connecting AI applications to external tools through a single consistent interface. In Cursor, MCP is what turns the agent from "a text-only assistant inside the editor" into "an agent that can read Slack, query Postgres, open GitHub issues, and check Datadog logs." This is the longest module in the masterclass because MCP is also the surface where most users hit walls — context limits, security CVEs, and silent tool failures.
You will leave this module able to:
- Configure
.cursor/mcp.json with stdio and Streamable HTTP servers
- Manage the 40-tool ceiling without losing access to your stack
- Harden MCP security against MCPoison-class attacks and credential leaks
7.1 The architecture
MCP defines three moving pieces:
- Hosts — the application that uses MCP. Cursor is the host.
- Clients — connectors inside the host that handle individual server connections.
- Servers — the lightweight programs on the other end. They expose tools via JSON-RPC 2.0. Each server exposes a set of named tools (e.g.,
github.create_issue, postgres.query).
When you open Cursor, the agent scans your enabled MCP servers, loads the tools they expose, and the agent decides which tools to call as part of any given task.
7.2 The two transports
- stdio — server runs locally on your machine as a child process. Cursor communicates over stdin/stdout. The most common setup for individual developers. Does NOT work over remote SSH.
- Streamable HTTP — server runs as an independent process (locally or remotely). Cursor connects over HTTP. The right choice for team environments, remote servers, and SSH workflows.
7.3 Configuration: .cursor/mcp.json
Two locations:
- Project —
.cursor/mcp.json in the repo root. Applies only to that project. Commit it (without secrets).
- Global —
~/.cursor/mcp.json. Applies everywhere. Personal API keys go here.
Same server in both files? Project config wins.
{
"mcpServers": {
"github": {
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${env:GITHUB_PAT}"
}
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "${env:DATABASE_URL}"]
},
"linear": {
"type": "http",
"url": "https://mcp.linear.app/sse",
"headers": {
"Authorization": "Bearer ${env:LINEAR_TOKEN}"
}
},
"sentry": {
"command": "npx",
"args": ["-y", "@sentry/mcp-server"],
"env": {
"SENTRY_AUTH_TOKEN": "${env:SENTRY_TOKEN}",
"SENTRY_ORG": "your-org"
}
}
}
}
7.4 The 40-tool ceiling
Cursor has a hard practical ceiling of roughly 40 active tools across all your MCP servers combined. Exceed it and two things happen: you get a warning, and the agent silently loses access to some tools. It just cannot see them anymore.
The limit exists for a reason: each tool definition burns context tokens. Once you stack 40+ tool descriptions into the system prompt, the LLM's ability to pick the right one for any given task deteriorates noticeably.
What to do:
- Open Cursor Settings > Tools & MCP. Each server shows its tools.
- Toggle off tools you are not actively using. Most MCP servers expose 5-20 tools; you rarely need all of them.
- Prefer servers exposing 5-10 well-defined tools over mega-servers trying to do 30 things.
- Use project-level config to limit each repo's MCP stack to what that project actually needs.
7.5 The 12 essential MCP servers
Twelve MCP servers most working developers benefit from. Pick 4-6 to start; the 40-tool ceiling will stop you before the full list.
| Server |
What it does |
Best for |
Transport |
| GitHub | Manage repos, PRs, issues, code review | Every developer | stdio (Docker) |
| Git | Local repo operations — diffs, commits, blame | Every developer | stdio |
| Postgres | Natural language queries against any Postgres DB | Backend, data work | stdio |
| Linear | Issue tracking, sprint planning, cross-issue context | Product teams | HTTP (official) |
| Sentry | Pull error stack traces, breadcrumbs into context | Production debugging | stdio |
| Playwright | Browser automation, E2E tests, screenshots | Frontend, QA | stdio |
| Context7 | Up-to-date version-specific library docs | Every developer (no API key) | stdio |
| Figma | Read Figma designs, frames, design tokens | Design-to-code work | HTTP |
| Stripe | Read products, prices, payments; build integrations | E-commerce, billing | HTTP (official) |
| Vercel | Deployments, env vars, logs, project config | Frontend deployment | HTTP (official) |
| AWS | S3, Lambda, CloudWatch, IAM read operations | Cloud infrastructure | HTTP (official) |
| Brave Search | Real-time web search using Brave's index | Research, fresh info | stdio |
7.6 Security: the CVEs that matter
MCP servers run with your credentials
Every MCP server is, for all practical purposes, a fully trusted integration. Whatever permissions you hand a server — database access, GitHub tokens, API keys — it will use them. If a server is compromised or malicious, it has everything you gave it. Treat each one like you would treat a production credential.
The CVEs you should know about:
- CVE-2025-54136 (MCPoison) — Check Point Research found that Cursor pinned trust to the MCP server's key name in the config file, not to the actual command being run. An attacker who could modify
.cursor/mcp.json (e.g., via a malicious PR) could swap the command behind a trusted-looking name. Cursor patched this; the lesson stands.
- Multiple 2025 CVEs targeting MCP server trust models. Snyk and others have published research throughout 2025-2026 on supply-chain attacks targeting MCP servers, skills marketplaces (including the ClawHub incident in January 2026), and plugin distributions.
7.7 Hardening checklist
- Never commit secrets in
.cursor/mcp.json. Use ${env:VAR_NAME} references; set env vars in your shell.
- Check security scores on the MCP Marketplace before installing. Every listing includes a security report.
- Review the
command field every time .cursor/mcp.json changes. A malicious PR can swap a binary.
- Limit credentials to read-only where possible. A GitHub PAT with full repo write access is a much bigger blast radius than a read-only one.
- For team environments, prefer the HTTP transport with a centrally-managed MCP gateway. Easier audit, easier rotation.
- Run
npm audit on stdio servers periodically. They are npm packages with all the usual supply-chain risks.
7.8 Troubleshooting the silent failures
The most frustrating MCP problem: Cursor shows no error, no warning, and tools just are not showing up. Nine times out of ten, it is one of these:
- Missing
mcpServers root key. Cursor silently ignores the entire file.
- Node.js or Python not on PATH. The stdio command fails to launch.
- Package version doesn't exist.
@some-org/mcp-server@9.9.9 when only 0.1.0 exists.
- Forgetting
-y with npx. The process hangs forever waiting for "y" at the install prompt with no interactive terminal.
- Empty or missing environment variable.
${env:GITHUB_PAT} resolves to empty and the server can't auth.
Fastest debug path: copy the command from mcp.json verbatim and run it in a terminal. Whatever error Cursor was swallowing prints to your screen.
Portability dividend
MCP servers are not Cursor-specific. The same server that works in Cursor also works in Claude Code, Windsurf, VS Code Copilot, and any other MCP-compliant host. Configure once, use everywhere. This portability is why investing time in your MCP stack pays back even if you eventually switch primary IDEs.