In this categoryCursor ยท 26
- How to Install Cursor and Import VS Code Settings (6 Minutes)Start
- Cursor Setup Guide: From Install to Your First AI Edit
- How to Set Up Project Rules in the .cursor/rules Folder
- How to Set Up Codebase Indexing in Cursor
- How to Enforce Project Conventions with Cursor Rules
- How to Write a Team Rule That Applies Only to Certain Files
- How to Migrate a Legacy .cursorrules File to the New Rules Folder
- How to Use Cursor Rules to Guide AI Edits
- How to Set Project Rules in Cursor
- How to Add a .cursorrules File to Steer Cursor
- How to Customize Cursor Keyboard Shortcuts
- How to Edit Multiple Files at Once with Cursor Composer
- How to Use Cursor Tab Completion Effectively
- How to Edit Code Inline with Cmd+K in Cursor
- How to Add Context to Cursor Chat with @ Mentions
- How to Choose and Switch AI Models in Cursor
- How to Add Library Docs as Context with @Docs in Cursor
- How to Generate and Maintain Tests with Cursor Composer
- How to Undo a Composer Change with Checkpoints in Cursor
- How to Use Cursor Agent Mode to Build a Feature End to End
- How to Connect an MCP Server to Cursor
- How to Refactor Across Your Whole Codebase in Cursor
- How to Query Your Database from Cursor with a Postgres MCP Server
- How to Let Cursor Run Commands Automatically (and Keep It Safe)
- How to Build a Full Feature Across Frontend and Backend with Composer
- How to Debug an MCP Server That Will Not Connect in Cursor
How to Connect an MCP Server to Cursor
Add a Model Context Protocol server to Cursor so the agent can use external tools like a database or a filesystem.
Model Context Protocol (MCP) lets Cursor's agent call out to external tools: a Postgres database, a browser, a ticketing system, or anything that ships an MCP server. Once a server is connected, its tools show up to the agent automatically, and it can call them while answering you. This guide connects a simple filesystem server end to end.
- Cursor with agent mode available
- Node.js and npx installed (verify with node -v)
- An MCP server you want to add (this guide uses the filesystem server)
Open MCP settings
Go to Cursor Settings, then the MCP section. You can add servers through the UI or by editing the JSON config directly. Editing JSON is more reliable and easy to copy between projects.
Create the config file
Create .cursor/mcp.json in your project root for a project-scoped server, or use the global config in your home directory for a server you want everywhere. Each entry names the command Cursor runs to start the server.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/me/projects"
]
}
}
}Reload and confirm the connection
Save the file and Cursor picks it up. Return to the MCP settings page and look for a green status dot next to the server name, plus the list of tools it exposes. A red or gray dot means the command failed to start.
Use a tool from the agent
Open the agent and ask it to do something only the server can do, such as listing the contents of a directory. The agent will request permission to call the tool, then show you the result inline.
Result: the agent can now read and list files through the MCP server, and you can swap in other servers by adding more entries to the same JSON file.
Watch related tutorials
33:42
41:18
28:05
3:12
26:54
39:10New guides in your inbox
Fresh step-by-step how-to guides as we publish them. One email a week, no more.