MCP Servers
Extending AI capabilities with external tools
Model Context Protocol (MCP)
MCP is a standard that allows AI agents to connect to external data and tools. It turns your AI from a text generator into a capable assistant that can do things.
What can MCP do?
- Read Docs: Connect to a documentation server to read latest API reference.
- Access Database: Query your PostgreSQL or Supabase database directly to understand your schema.
- Manage Projects: Create Linear tickets or GitHub issues.
- Design: Read Figma files to generate code that matches the design pixel-perfectly.
Setting up MCP in Cursor
You can add MCP servers to Cursor to give your AI new capabilities.
- Open Cursor Settings (
Cmd + ,orCtrl + ,). - Go to General > MCP.
- Click "Add new MCP server".
Example: Adding a Local File Server
This allows the AI to read files outside the current project (e.g., a shared library).
- Name:
shared-lib - Type:
command - Command:
npx -y @modelcontextprotocol/server-filesystem /path/to/shared/lib
Example: Adding a Database Inspector
Allows the AI to run read-only queries against your SQLite database.
- Name:
sqlite-inspector - Type:
command - Command:
uvx mcp-server-sqlite --db-path ./my-database.db
Example: Adding a Server in Claude Code
Claude Code reads MCP servers from a config file rather than a settings UI. Add them under an mcpServers key, where each entry names the command and arguments used to launch the server:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/shared/lib"]
},
"sqlite-inspector": {
"command": "uvx",
"args": ["mcp-server-sqlite", "--db-path", "./my-database.db"]
}
}
}Restart the agent after editing the config so it spawns the new servers on startup.
Verifying a Server Works
Once a server is connected, confirm the agent can actually see its tools before you rely on it:
- Ask the agent to list its available tools. The MCP server's tools should appear by name.
- Give it a read-only task first — "describe the schema of the
userstable" — so you can sanity-check the connection without risking a write. - If nothing shows up, check the command runs in your own shell. Most failures are a missing binary (
npx,uvx) or a wrong path, not the protocol itself.
Security Notes
MCP servers run with the permissions of whatever command launches them. Two rules keep this safe:
- Prefer read-only access. Connect database servers with a read-only role so the agent can inspect schema and data but cannot mutate it.
- Scope filesystem servers tightly. Point them at a specific directory, never your home folder or the root of your machine.
- Review the source of any third-party MCP server before running it, the same way you would any other dependency.
How it fits into Learning
Integrating MCP servers is the ultimate "Context Engineering". Instead of manually pasting schema definitions into the chat, you give the AI direct access to the database to "see" for itself. The payoff is concrete: the model stops guessing at your column names and starts generating code against the schema you actually have — which is the single biggest source of avoidable AI hallucinations in a real project.