Cursor MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Cursor MCP ServerShow me the file tree of the project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Cursor MCP Server – AI Coding Assistant for Claude Desktop
Turn Claude Desktop into a Cursor‑like assistant that can browse, search, edit, lint, format, and version‑control your entire codebase – all through a single MCP server.
Directory Tree cursor-mcp-server/ ├── README.md ├── .gitignore ├── requirements.txt ├── mcp_server.py # main server – entry point ├── config.py # global configuration ├── tools/ │ ├── init.py │ ├── file_tools.py # file read/write/diff/tree │ ├── search_tools.py # grep, semantic search, find files │ ├── command_tools.py # safe command execution │ ├── git_tools.py # git status/diff/log/branch │ ├── code_quality_tools.py # linting & formatting │ └── rag.py # ChromaDB indexing & semantic search └── claude_desktop_config.json # ready-to-paste configuration
🚀 Overview
This project provides a Model Context Protocol (MCP) server written in Python. Once connected to Claude Desktop, it gives Claude the ability to:
Explore the file tree and read/write files
Search code with regex (
grep) and semantic search (ChromaDB + embeddings)Apply unified diffs safely (with optional backups)
Run terminal commands inside the project (sandboxed)
Inspect Git status, diff, log, and branch
Lint and format code (detects Python / JavaScript projects)
Build and query a semantic code index (fully local)
Everything runs offline after installing dependencies – no API keys needed.
Related MCP server: Claude Code Connector MCP
📋 Prerequisites
Python 3.10 or higher
pip(Python package manager)Git (optional, for Git‑related tools)
Linters / formatters are optional – the tools will detect them if installed:
Python:
flake8andblackJavaScript/TypeScript:
eslintandprettier
📦 Installation
Clone or download this repository into a directory of your choice.
Create and activate a virtual environment (recommended):
python3 -m venv .venv source .venv/bin/activateInstall the required Python packages:
pip install -r requirements.txtNote: The first time you run the semantic search tools,
sentence-transformerswill download a small embedding model (~80 MB). This is only needed once and works completely offline afterwards.
⚙️ Setup
1. Build the semantic code index (recommended)
The semantic search tool needs an index. You can build it by running the server and calling the rebuild_index tool, or by running the indexing script manually:
python -m tools.ragThis will walk the entire project, chunk files, and store embeddings inside .chroma_db/.
2. Configure Claude Desktop
Open Claude Desktop settings:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Replace or merge the
mcpServerssection with the content ofclaude_desktop_config.jsonfrom this project. Edit the paths to match your setup:{ "mcpServers": { "cursor-assistant": { "command": "/path/to/your/project/.venv/bin/python3", "args": [ "/path/to/your/project/mcp_server.py", "--project-root", "/path/to/your/project" ], "env": { "PROJECT_ROOT": "/path/to/your/project", "PYTHONPATH": "/path/to/your/project" } } } }Replace
/path/to/your/projectwith the absolute path to the project you want to work on.The
commandshould point to the Python binary inside your virtual environment.
Restart Claude Desktop completely (quit and reopen).
Once restarted, you’ll see an integration named cursor-assistant. Enable it and start using the assistant.
🧠 Usage
In Claude Desktop, start a conversation. The tools are automatically available.
You can ask in natural language:
“Show me the file tree”
“Find where authentication logic is”
“Search for all places where we use the
requestslibrary”“Apply this diff to login.py”
“What’s the git status?”
“Run tests and show me the output”
All destructive actions (writing files, running commands) are described clearly. Always review the proposed actions before Claude executes them. You have full control.
🔧 Tools Reference
Workspace
get_workspace_info– project root and top‑level entries
Files
read_file(path)– read a fileread_multiple_files(paths)– read several files at oncewrite_file(path, content)– overwrite/create a file ⚠️list_directory(path=".")– list non‑hidden contentsget_file_tree(path=".", max_depth=4)– recursive tree as JSONapply_diff(path, diff, create_backup=True)– apply a unified diff
Search
grep(pattern, path=".", include=None)– regex search (respects.gitignore)semantic_search(query, n_results=5)– semantic (embedding‑based) searchfind_files(pattern, path=".")– glob‑based file search
Commands
execute_command(command, cwd=".")– run a shell command (⚠️ use with approval)
Git
git_status()– short statusgit_diff(staged=False)– working directory diffgit_log(max_count=10)– recent commitsgit_branch()– current branch name
Code Quality
lint_file(path, linter="auto")– run flake8/eslintformat_file(path)– run black/prettier (returns formatted code, does not write)
Indexing
rebuild_index()– rebuild the semantic search index
🛡️ Safety
All file and command operations are restricted to the project root – path traversal is blocked.
write_fileandapply_diffmodify files. Always review the changes before approving.execute_commandruns in a sandboxed directory, but the command itself is not restricted. Claude will ask for your confirmation before calling this tool.Backups are automatically created when applying diffs (can be disabled).
🔍 Offline Capabilities
Semantic search uses a local embedding model (
all-MiniLM-L6-v2) viasentence-transformers. The model is downloaded automatically on first use.ChromaDB storage is local (
.chroma_db/folder).No internet connection is required after the initial model download and dependency installation.
🐛 Troubleshooting
“Module not found: mcp” – Ensure you are using the Python from your virtual environment and have run
pip install -r requirements.txtinside it.rebuild_indexfails / semantic search returns nothing – Ensure the.chroma_db/folder is writable and thatsentence-transformersis installed.Git tools error – Make sure Git is installed and the project is a Git repository.
Linter / formatter not found – Install the required tools (e.g.,
pip install flake8 black,npm install -g eslint prettier) or simply ignore those tools.Path outside project root – You may be trying to access a file outside the configured project root. Adjust
PROJECT_ROOT.Server disconnects immediately – Check the Claude Desktop logs for error messages. A common fix is to run the server manually (
python3 mcp_server.py --project-root .) and see the traceback.
📝 License
https://github.com/tariqnasheed – use it, modify it, share it.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tariqnasheed/CURSOR_MCP_SERVER'
If you have feedback or need assistance with the MCP directory API, please join our Discord server