How to Add MCP in .cursor/mcp.json (Cursor MCP Settings Guide 2026)
Where is .cursor/mcp.json? Complete Windows, Mac & Linux paths, valid JSON schemas for stdio and SSE servers, and instant fix for MCP error -32000.
AIStoreHub
Open AI Registry & Developer Platform
Executive Blueprint & Summary (BLUF)
Cursor IDE supports Anthropic's Model Context Protocol (MCP) through both global and workspace-level configuration files. By creating or editing `.cursor/mcp.json`, developers can connect external database inspectors, local knowledge bases (kb-server), git automation agents, and web research tools directly into Cursor Composer. This guide provides exact Windows, macOS, and Linux file paths, fully validated JSON templates for stdio and SSE servers, and troubleshooting fixes for MCP error -32000: connection closed.
Windows (Global):%USERPROFILE%\.cursor\mcp.json (Full path: C:\Users\<YourUsername>\.cursor\mcp.json) Quick open shortcut: Press Win + R, paste notepad %USERPROFILE%\.cursor\mcp.json, and press Enter.
macOS (Global):~/.cursor/mcp.json (Full path: /Users/<username>/.cursor/mcp.json) Terminal command:code ~/.cursor/mcp.json or open -a TextEdit ~/.cursor/mcp.json
Linux (Global):~/.cursor/mcp.json (Terminal command: nano ~/.cursor/mcp.json)
Cursor reads MCP tool configurations from two distinct levels: Global Configuration (shared across all projects) and Workspace Configuration (isolated to your current project repository).
When setting up MCP servers in Cursor, you can choose between global availability and project-level isolation:
Global Configuration (~/.cursor/mcp.json or %USERPROFILE%\.cursor\mcp.json):
Any server defined here is automatically available in every window and workspace you open in Cursor Composer. This is ideal for personal productivity tools, web scrapers, and universal search servers.
Project-Level Configuration (<project-root>/.cursor/mcp.json):
Create a .cursor folder in the root of your project and place mcp.json inside. This allows your team to commit verified tool dependencies into Git so that all collaborators share the same database and testing servers without manual setup.
Cursor expects a standard top-level mcpServers object containing key-value definitions for each server. Below is a validated, production-ready mcp.json configuration template:
One of the most frequent developer queries on Bing is "how to configure local kb-server in cursor". A local knowledge-base server (kb-server) indexes documentation and codebases for instant semantic retrieval in Cursor Composer.
On Windows and macOS, GUI applications like Cursor may not inherit your terminal's shell PATH. If npx or python is not found, the connection closes immediately with error -32000.
MCP uses standard input/output (stdio) strictly for structured JSON-RPC 2.0 messages. If your server or startup script prints debug text (e.g., console.log("Connected to DB") or Python print("Server started")), Cursor cannot parse the JSON and terminates the connection with error -32000.
Fix: Redirect all logging to console.error() or Python sys.stderr.write().
Manually editing JSON files can lead to missing comma errors and syntax breaks. The open-source AIStoreHub CLI automatically detects your operating system, locates .cursor/mcp.json, and registers verified servers with one command:
bash
# Install any verified MCP server into Cursor automatically
aihub mcp install @community/github --client cursor
# List and verify all active Cursor MCP connections
aihub mcp status --client cursor
Scan charts, calculate risk/reward brackets, and backtest setups via Claude Code.
Frequently Asked Questions
Essential clarifications for developers and engineering teams building and operating AI systems.
On Windows, the global configuration file is located at %USERPROFILE%\.cursor\mcp.json (typically C:\Users\<username>\.cursor\mcp.json). You can open it directly by pressing Win + R, typing 'notepad %USERPROFILE%\.cursor\mcp.json', and pressing Enter.
Written by AIStoreHub
Open AI Registry & Developer Platform
AIStoreHub is the open registry and 1-click CLI for discovering, running, and installing production-grade AI systems, Model Context Protocol (MCP) servers, and autonomous agents.
Learn how to connect any Model Context Protocol server to Cursor IDE, fix common mcp.json syntax errors, and automate tool injection using the 1-click AIStoreHub CLI.
Discover the top 10 essential open-source Model Context Protocol (MCP) servers in 2026 for database querying, browser automation, Git intelligence, and memory retention.
Master the Model Context Protocol (MCP). Learn how to expose production tools, handle SSE vs stdio transports, implement schema validation, secure access tokens, and distribute via AIStoreHub.