Code Contractor MCP Server
Provides linting capabilities for JavaScript and TypeScript code using ESLint, allowing validation of code strings before writing to files.
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., "@Code Contractor MCP ServerAnalyze the error handling in app.js"
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.
Code Contractor MCP Server
Professional MCP Server with AST-powered code intelligence, high-performance search, and smart file operations.
Overview
Code Contractor is a powerful Model Context Protocol (MCP) server that provides AI assistants with advanced code manipulation capabilities.
Key Features
🌳 AST-Powered Analysis - Tree-sitter based code understanding (JS/TS/Python/Go/Java)
🔍 High-Performance Search - ripgrep integration with semantic classification
🔧 Smart File Operations - 10+ patching methods with automatic backups
🛡️ Multi-Layer Linting - AST + ESLint/flake8/pylint integration
📦 Batch Operations - Execute multiple operations atomically
🌐 Bridge Architecture - Works with local files AND remote SSH connections!
Related MCP server: java-jdtls-mcp-server
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Cursor IDE │
│ (local or connected via Remote SSH) │
└─────────────────────┬───────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ MCP Server (Docker) │
│ • AST Parsing (Tree-sitter) │
│ • Code Search (ripgrep) │
│ • Linting │
│ • Heavy processing │
└─────────────────────┬───────────────────────────────────────────┘
│ HTTP Request
▼
┌─────────────────────────────────────────────────────────────────┐
│ Bridge (runs on YOUR machine) │
│ • Read/Write files │
│ • Has YOUR permissions │
│ • Access to everything YOU can access │
└─────────────────────┬───────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ File System │
│ • Local files │
│ • Remote SSH files (when using Cursor Remote SSH) │
│ • Network mounts │
└─────────────────────────────────────────────────────────────────┘Why Bridge Architecture?
Heavy processing (AST parsing, search, linting) runs in Docker for isolation
File operations run on YOUR machine with YOUR permissions
Works seamlessly with Cursor Remote SSH connections!
Quick Start
Prerequisites
Docker Desktop installed and running
Cursor IDE or any MCP-compatible client
Installation
One-Click Install (Recommended)
# Clone the repository
git clone https://github.com/binacshera-ui/code-contractor-mcp.git
cd code-contractor-mcp
# Run the installer
./install.sh # macOS/Linux
install.bat # WindowsThe installer will:
Build the Docker image
Install Node.js dependencies
Configure Cursor's
mcp.jsonSet up the Bridge to auto-start
Start the Bridge
Manual Installation
# 1. Clone and build
git clone https://github.com/binacshera-ui/code-contractor-mcp.git
cd code-contractor-mcp
docker build -t code-contractor-mcp .
npm install
# 2. Start the bridge (keep running in background)
node bridge.js
# 3. Configure mcp.json (see below)Configuration
Add to your MCP client configuration file (~/.cursor/mcp.json or %USERPROFILE%\.cursor\mcp.json):
With Bridge (Recommended):
{
"mcpServers": {
"code-contractor": {
"command": "docker",
"args": ["run", "-i", "--rm", "--add-host=host.docker.internal:host-gateway", "code-contractor-mcp"]
}
}
}macOS (host.docker.internal works natively):
{
"mcpServers": {
"code-contractor": {
"command": "docker",
"args": ["run", "-i", "--rm", "code-contractor-mcp"]
}
}
}Starting the Bridge
The Bridge must be running for file operations to work.
Windows:
start-bridge.batmacOS/Linux:
./start-bridge.sh
# Or in background:
nohup node bridge.js > bridge.log 2>&1 &The installer sets up auto-start on login, but you can also start manually.
Tools Reference
Note: This server provides tools that complement Cursor's built-in tools.
For basic operations like Read, Write, Delete, Grep, use Cursor's native tools.
Code Intelligence (AST-powered)
Tool | Description |
| Get function/class definitions with line numbers |
| Extract specific function/class with context |
| Find all usages of a symbol across project |
| Find files exceeding line threshold |
Advanced Search
Tool | Description |
| Semantic code search with modes: |
• | |
• | |
• | |
• | |
• | |
• | |
• | |
• |
Code Validation
Tool | Description |
| Validate code string before writing to file |
Smart Patching
Tool | Description |
| Replace specific line (exact match) |
| Insert content at line number |
| Replace range of lines |
| Insert before/after marker text |
| Replace content between markers |
| Add content to end of file |
| Add content to start of file |
| Apply unified diff patch |
AST Refactoring
Tool | Description |
| Replace function/class by name |
| Rename variable/function/class |
| Add import at correct location |
Backup & Recovery
Tool | Description |
| List all backups for a file |
| Show diff between current and backup |
| Restore file from backup |
Batch & Sandbox
Tool | Description |
| Execute multiple operations in sequence |
| Execute command in isolated Docker sandbox |
Path Handling
The server accepts both Windows and Linux style paths:
C:\Users\user\project\file.js → Works!
c:/Users/user/project/file.js → Works!
Users/user/project/file.js → Works!All paths are automatically normalized and routed through the Bridge.
Supported Languages
Language | AST Parsing | Linting | Search |
JavaScript/TypeScript | ✅ Tree-sitter | ✅ ESLint | ✅ |
Python | ✅ Tree-sitter | ✅ flake8/pylint | ✅ |
Go | ✅ Tree-sitter | ⚠️ Basic | ✅ |
Java | ✅ Tree-sitter | ⚠️ Basic | ✅ |
Other | ⚠️ Regex fallback | ⚠️ Basic | ✅ |
Backup System
All file modifications are automatically backed up to .mcp-backups/ directories:
project/
├── src/
│ ├── app.js
│ └── .mcp-backups/
│ ├── app.js.1699999999999
│ └── app.js.1699999888888Use list_backups, show_diff, and restore_backup to manage backups.
Troubleshooting
Bridge not responding
# Check if bridge is running
curl -X POST http://localhost:9111 -d '{"operation":"ping"}'
# Start bridge manually
node bridge.jsDocker can't connect to bridge (Linux)
Make sure you have --add-host=host.docker.internal:host-gateway in the Docker args.
Permission errors
The Bridge runs with YOUR permissions. If you can't access a file normally, the Bridge can't either.
File not found
Check the path is correct
Ensure the Bridge is running
Try with full absolute path
Security
Docker Isolation: Heavy processing (AST, search, lint) runs in Docker
Bridge Permissions: File operations use YOUR user permissions
Sensitive Files: Automatic blocking of
.env, credentials, keysNo Network: Docker container has no network access by default
Backups: All modifications backed up automatically
Development
# Install dependencies
npm install
# Run bridge locally
node bridge.js
# Test tools
node test-all.jsLicense
MIT License - see LICENSE file.
Contributing
Fork the repository
Create a feature branch
Make your changes
Submit a pull request
Made with ❤️ for AI-assisted development
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
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/binacshera-ui/code-contractor-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server