Add MCP servers to Claude Code with claude mcp add or to Cursor by editing mcp.json — both take about five minutes for a first GitHub or filesystem server. MCP tools only appear in Cursor Agent mode; Claude Code exposes them in every session after connect.
Prerequisites
- Node.js 18+ (most official MCP servers are TypeScript/npm packages)
- Claude Code installed (
npm i -g @anthropic-ai/claude-code) or Cursor with Agent mode enabled - API keys for remote services (GitHub PAT, etc.) in environment variables — never in committed config
Claude Code Setup
Claude Code has the simplest flow:
# List configured servers
claude mcp list
# Add GitHub MCP (example — check official docs for current package name)
claude mcp add github -- npx -y @modelcontextprotocol/server-github
# Add project-scoped server via .mcp.json in repo root
Example .mcp.json at project root:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_PERSONAL_ACCESS_TOKEN}"
}
}
}
}
Use claude mcp add when possible — it validates config. Remote HTTP servers with OAuth use --transport http and browser auth flows documented in Claude Code MCP docs.
Cursor Setup
- Open Cursor Settings → MCP or edit
~/.cursor/mcp.jsondirectly - Add server entries matching the MCP schema (
command,args,env) - Restart Cursor
- Open Agent mode (not regular chat) and confirm tools appear in the tool list
Project-level: .cursor/mcp.json overrides or extends global config for that repo only.
Recommended First Servers
Start with low-risk, high-value servers:
- Filesystem — scoped read/write under project directories
- GitHub — issues, PRs, code search
- Playwright — browser automation for E2E checks
- Your database — read-only staging replica with tight credentials
Add one server at a time. Verify tool calls work before stacking more — each server increases context cost.
OAuth and Remote Servers
Enterprise MCP servers often run as remote HTTP endpoints with OAuth 2.0. Claude Code walks browser login; tokens stay in the client credential store. For teams, use a shared gateway with audit logging rather than personal PATs on every laptop.
Troubleshooting
| Symptom | Fix |
|---|---|
| Tools missing in Cursor | Switch to Agent mode; restart IDE |
command not found | Use full path to npx/node; check Node version |
| Auth errors | Rotate token; confirm env var names match server docs |
| Session feels slow | Too many servers — disable unused ones |
For token usage when MCP is connected, read Why Does MCP Use So Many Tokens?.
What Is MCP and Why Set It Up?
MCP (Model Context Protocol) is an open standard that lets AI assistants like Claude Code and Cursor interact with external tools and data sources. Instead of copying code manually or pasting API responses, you connect servers that provide structured tools — like reading files, querying databases, or managing GitHub issues. Setting up MCP servers turns your AI from a chat partner into an autonomous agent that can act on your codebase.
In 2026, MCP has become the default way to extend AI capabilities in development workflows. Every major IDE and CLI tool supports it. The setup is straightforward: define a server with a command and environment variables, and the AI discovers available tools automatically.
How Does MCP Work in Claude Code and Cursor?
Both tools implement the MCP specification but differ in how you configure and use servers.
Claude Code uses a global config file at ~/.claude/settings.json or a project-level .mcp.json. When you start a session, Claude Code loads all configured servers and exposes their tools in every conversation. You can add servers via CLI (claude mcp add) or by editing the JSON directly. The CLI validates your configuration before saving.
Cursor uses ~/.cursor/mcp.json for global servers and .cursor/mcp.json for project-specific ones. MCP tools are only available in Agent mode (not regular chat). After adding a server, you must restart Cursor. Agent mode shows available tools in a dropdown — you can see which functions the AI can call.
Both tools support the same MCP schema: command, args, env, and optional transport for HTTP servers. The key difference is that Claude Code is CLI-first, while Cursor is IDE-first with a visual settings panel.
Best Practices for MCP Server Setup
- Use environment variables for secrets — never hardcode tokens in config files. Claude Code and Cursor both support
${VAR_NAME}interpolation from your shell environment. - Scope filesystem servers — restrict read/write to specific directories. A filesystem server with access to your entire home directory is a security risk.
- Start with one server — each server adds context tokens. Too many servers can slow down responses and increase costs.
- Use official packages — prefer
@modelcontextprotocol/*servers from npm. Community servers may have security issues. - Test tool calls — after setup, ask the AI to perform a simple action (e.g., "list files in current directory") to verify the server works.
- Keep Node.js updated — MCP servers rely on Node.js 18+ features. Older versions may fail silently.
Cost of MCP Servers in 2026
MCP servers themselves are free and open source. The cost comes from token usage: each tool call consumes input and output tokens. For example, a GitHub server that fetches a list of issues might use 500-1000 tokens per call. If you have 5 servers active, the AI may call multiple tools per query, multiplying token consumption.
Typical monthly costs:
- Personal use (1-2 servers, occasional calls): $5-15 in API tokens
- Team use (3-5 servers, daily calls): $50-200 in API tokens
- Enterprise (10+ servers, heavy automation): $500+ in API tokens
To reduce costs, disable unused servers and use read-only replicas for databases. Some teams implement token budgets per server.
Is MCP Worth It in 2026?
Absolutely — if you use AI for development. MCP transforms AI from a text generator into an autonomous coding assistant that can read your codebase, run tests, create PRs, and manage infrastructure. The setup cost is minimal (5 minutes per server), and the productivity gains are significant.
However, MCP is not magic. It works best when:
- You have well-defined tasks (e.g., "fix this bug" or "add a new endpoint")
- Your codebase is modular and testable
- You use servers that match your workflow (GitHub, filesystem, database)
For ad-hoc questions or one-off scripts, MCP adds unnecessary overhead. Use it where automation saves time.
Keep Reading
- LLM Token Optimization in 2026 — model routing, caching, MCP audit
- Claude Code Complete Setup Guide — install, CLAUDE.md, MCP, skills
- Claude Code vs Cursor: Token Cost (2026) — dollar math on identical tasks
- AI Model Sprint — June 2026 — frontier model benchmarks
Pristren builds AI-powered software for teams. Zlyqor is our all-in-one workspace — chat, projects, time tracking, AI meeting summaries, and invoicing.