Back to Documentation
Cursor logo

Cursor Integration

Configure ContextFS MCP server for Cursor IDE

Prerequisites

  • 1.Python 3.9+ - Required for running ContextFS
  • 2.Cursor IDE - Version 0.40+ with MCP support
  • 3.uv (recommended) or pip - Python package manager

Installation

Install ContextFS

pip install contextfs

Or use uv for on-demand execution: uvx contextfs

Cursor Configuration

1. Open Cursor Settings

Go to Cursor Settings → Features → MCP Servers

2. Create MCP config file

Create a .cursor/mcp.json file in your project:

{
  "mcpServers": {
    "contextfs": {
      "command": "uvx",
      "args": ["contextfs"]
    }
  }
}

3. Alternative: Global configuration

For system-wide configuration, add to your Cursor settings:

// settings.json
{
  "mcp.servers": {
    "contextfs": {
      "command": "uvx",
      "args": ["contextfs"]
    }
  }
}

4. Restart Cursor

Reload Cursor window or restart the IDE to load the MCP server.

Environment Variables

Optional: Configure ContextFS behavior:

{
  "mcpServers": {
    "contextfs": {
      "command": "uvx",
      "args": ["contextfs"],
      "env": {
        "CONTEXTFS_DATA_DIR": "~/.contextfs",
        "CONTEXTFS_LOG_LEVEL": "INFO"
      }
    }
  }
}

Using ContextFS in Cursor

Once configured, ContextFS tools are available in Cursor's AI features:

  • Composer: Ask to save or search memories
  • Chat: Reference past decisions and context
  • Command Palette: MCP tools appear as available actions

Example prompts:

"Search my memories for authentication patterns"
"Save this architecture decision to memory"
"What did we decide about the API structure?"

Next Steps

Get started with ContextFS in Cursor:

  • • Initialize your project: contextfs index index init
  • • Index your codebase: contextfs index index
  • • Start saving decisions as you code