Building AI Systems
November 20, 2026•9 min read

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
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.

1-Click Install via AIStoreHub CLI
$ aihub mcp install community/postgres-mcp --client cursor
Requires: pip install aistorehubCLI Docs

Where is .cursor/mcp.json Located? (Windows & Mac)

Quick Answer: Where to find .cursor/mcp.json

  • 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)
  • Project / Workspace Level (All OS): <your-project-root>/.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).

ScopeWindows PathmacOS / Linux PathBest Used For
Global%USERPROFILE%\.cursor\mcp.json~/.cursor/mcp.jsonUniversal tools: Filesystem, GitHub, Brave Search, AIStoreHub Vault
Workspace./.cursor/mcp.json./.cursor/mcp.jsonProject-specific tools: local PostgreSQL, Docker, internal API servers

Global vs. Project-Level .cursor/mcp.json

When setting up MCP servers in Cursor, you can choose between global availability and project-level isolation:

  1. 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.
  2. 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.

Valid .cursor/mcp.json Schema & Templates

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:

json
{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "C:\\Users\\YourUsername\\Projects"
      ]
    },
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_yourPersonalAccessTokenHere"
      }
    },
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://postgres:password@localhost:5432/mydb"
      ]
    }
  }
}

JSON Syntax Rule: In Windows paths, remember to escape backslashes (C:\\Users\\...) inside JSON strings.


Adding Local Stdio vs. Remote SSE MCP Servers

Cursor supports both Local Stdio Process and Remote Server-Sent Events (SSE) transports:

1. Local Process Server (Standard + )

Local servers spawn a subprocess via npx, python, or uvx:

json
{
  "mcpServers": {
    "local-python-server": {
      "command": "python",
      "args": ["-m", "my_mcp_server"],
      "env": {
        "DATABASE_URL": "sqlite:///local.db"
      }
    }
  }
}

2. Remote SSE Server (HTTP / Server-Sent Events)

For cloud-hosted or remote team servers, Cursor connects over HTTP without launching a local binary:

json
{
  "mcpServers": {
    "aistorehub-vault": {
      "url": "https://www.aistorehub.in/api/v1/mcp/vault/sse?vault_id=default"
    }
  }
}

How to Configure a Local KB-Server in Cursor

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.

Step 1: Install the KB-Server Package

bash
# Install via AIStoreHub CLI
aihub mcp install @community/kb-server --client cursor

Step 2: Add Definition to .cursor/mcp.json

Add the server entry with your local documentation directory:

json
{
  "mcpServers": {
    "kb-server": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-memory"
      ]
    }
  }
}

Step 3: Verify in Cursor Settings

  1. Open Cursor Settings (press Ctrl + , or Cmd + ,).
  2. Navigate to Features → MCP Servers.
  3. Confirm that kb-server displays a green status light.

How to Fix MCP Error -32000: Connection Closed

If Cursor displays mcp error -32000: connection closed or fails with exit code 1, check these four primary root causes:

1. Missing Absolute Path for Node/Python (spawn ENOENT)

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.

  • Fix: Specify the absolute binary path:
    • Windows: "command": "C:\\Program Files\\nodejs\\npx.cmd"
    • macOS: "command": "/usr/local/bin/npx" or "/opt/homebrew/bin/npx"

2. Standard Output Pollution (stdout vs stderr)

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().

3. Missing Environment Variables

If your server requires an API key or database password and fails during startup, the process exits before sending its initialization handshake.

  • Fix: Verify all credentials inside the "env" block in mcp.json.

4. Windows CMD Extension

On Windows, executing npx requires npx.cmd when spawned outside a shell:

json
"command": "cmd.exe",
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-github"]

1-Click Cursor MCP Setup via AIStoreHub CLI

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

Explore over 747 verified open-source MCP servers in the AIStoreHub MCP Registry.

Interactive Registry Preview

Featured Systems in the AIStoreHub Registry

Verified packages installable directly via terminal into Cursor, Claude Desktop, and Python runtimes.

Browse all 143 systems
MCP Server
PostgreSQL & SQLite Inspector

Inspect schema, explain queries, and generate zero-downtime migrations in Cursor.

Autonomous Agent
Harvey 24/7 AI Sales Agent

Autonomous prospecting, cold emails, and meeting booking with zero API token bills.

Claude Skill
Day Trader Skills: 11 Claude Skills

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.
AIStoreHub
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.

Topics:#Cursor#Model Context Protocol#Cursor Settings#mcp.json#Developer Tools#Troubleshooting
Sponsored AdvertisementAds by Google

Related Engineering Guides

Continue learning how to build, monetize, and operate AI systems effectively.

Building AI Systems11 min read

claude_desktop_config.json Location: Windows & Mac [Copy Config]

Press Win+R and run: notepad %APPDATA%\Claude\claude_desktop_config.json. Exact config paths for Windows & Mac, valid MCP JSON templates, spawn ENOENT fixes, and 1-click Cursor & Claude setup.

#Claude Desktop#Model Context Protocol#Anthropic
November 3, 2026
Read