Relace MCP Server
The Relace MCP Server provides AI-powered code editing and intelligent codebase search through Relace's API, integrating with MCP-compatible editors like Cursor, Claude Code, Windsurf, VS Code, and Codex CLI.
Core Capabilities:
Fast Code Editing (
fast_apply) - Apply code changes at 10,000+ tokens/sec to existing or new files with intelligent context-aware merging and smart truncation placeholdersAgentic Local Search (
fast_search) - Explore codebases using natural language queries with an autonomous agent that uses grep, ls, and file viewing tools
Cloud Capabilities (requires RELACE_CLOUD_TOOLS=1):
Cloud Synchronization (
cloud_sync) - Upload local codebases to Relace Cloud for semantic indexing with incremental, safe full, and mirror full sync modesSemantic Search (
cloud_search) - Perform AI-powered semantic code search using embeddings and reranking to find conceptually related code without exact keyword matchesRepository Management - List repositories (
cloud_list), check sync status (cloud_info), and delete repositories with local state cleanup (cloud_clear)
Key Features:
Automatic project root detection via MCP Roots or Git
Cross-platform support (Linux, macOS, Windows via WSL for full features)
Respects
.gitignoreduring cloud syncConfigurable via environment variables or
.envfilesOptional file logging to platform-specific directories
Custom encoding support for legacy repositories
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., "@Relace MCP Serversearch for authentication middleware in the codebase"
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.
Unofficial Relace MCP Server
Unofficial — Personal project, not affiliated with Relace.
Built with AI — Developed entirely with AI assistance (Antigravity, Codex, Cursor, Github Copilot, Windsurf).
MCP server providing AI-powered code editing and intelligent codebase exploration tools.
Without | With |
Manual grep, misses related files | Ask naturally, get precise locations |
Edits break imports elsewhere | Traces imports and call chains |
Full rewrites burn tokens | Describe changes, no line numbers |
Line number errors corrupt code | 10,000+ tokens/sec merging |
Features
Fast Apply — Apply code edits at 10,000+ tokens/sec via Relace API
Agentic Search — Agentic codebase exploration with natural language queries
Agentic Retrieval — Hybrid semantic hints + live code exploration, with stale-hint support and explicit cloud maintenance (enable with
MCP_SEARCH_RETRIEVAL=1; choose the backend withMCP_RETRIEVAL_BACKEND)Cloud Search — Semantic code search over cloud-synced repositories
Related MCP server: GraphHub
Quick Start
Prerequisites: uv, git, ripgrep (recommended)
Using the relace backend (default): get your API key from Relace Dashboard, then add to your MCP client:
~/.cursor/mcp.json
{
"mcpServers": {
"relace": {
"command": "uv",
"args": ["tool", "run", "relace-mcp"],
"env": {
"RELACE_API_KEY": "rlc-your-api-key",
"MCP_BASE_DIR": "/absolute/path/to/your/project"
}
}
}
}claude mcp add relace \
--env RELACE_API_KEY=rlc-your-api-key \
--env MCP_BASE_DIR=/absolute/path/to/your/project \
-- uv tool run relace-mcp~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"relace": {
"command": "uv",
"args": ["tool", "run", "relace-mcp"],
"env": {
"RELACE_API_KEY": "rlc-your-api-key",
"MCP_BASE_DIR": "/absolute/path/to/your/project"
}
}
}
}.vscode/mcp.json
{
"mcp": {
"servers": {
"relace": {
"type": "stdio",
"command": "uv",
"args": ["tool", "run", "relace-mcp"],
"env": {
"RELACE_API_KEY": "rlc-your-api-key",
"MCP_BASE_DIR": "${workspaceFolder}"
}
}
}
}
}~/.codex/config.toml
[mcp_servers.relace]
command = "uv"
args = ["tool", "run", "relace-mcp"]
[mcp_servers.relace.env]
RELACE_API_KEY = "rlc-your-api-key"
MCP_BASE_DIR = "/absolute/path/to/your/project"Configuration
Variable | Required | Description |
| ✅* | API key from Relace Dashboard; required for Relace providers and cloud tools |
| ❌ | Set to |
| ❌ | Semantic retrieval backend: |
| ❌ | Retrieval hint policy: |
| ❌ | Opt-in periodic refresh monitor for local indexes; requires a pinned |
| ❌ | Periodic local index monitor interval in seconds (default: |
| ❌ | Initial delay before the first periodic local index check in seconds (default: |
| ❌ | Turn-status user message policy: |
| ❌ | Enable |
| ❌ | Enable LSP-assisted search: |
| ❌ | Project root override (auto-detected via MCP Roots → Git → workspace storage → CWD) |
| ❌ | File logging: |
| ❌ | Path to |
* Optional if both: (1) APPLY_PROVIDER and SEARCH_PROVIDER are non-Relace providers, and (2) MCP_RETRIEVAL_BACKEND is codanna, chunkhound, or none.
For .env usage, encoding settings, custom LLM providers, and more, see docs/advanced.md.
Tools
Always available: fast_apply, agentic_search. agentic_retrieval requires MCP_SEARCH_RETRIEVAL=1. Cloud tools are available only when MCP_RETRIEVAL_BACKEND=relace. index_status is available for relace, codanna, and chunkhound, and hidden when MCP_RETRIEVAL_BACKEND=none.
Use MCP-native discovery surfaces: list_tools() for tools and list_resources() for resources.
For detailed parameters, see docs/tools.md.
Language Support
LSP tools use external language servers installed on your system.
Language | Language Server | Install Command |
Python | basedpyright | (bundled) |
TypeScript/JS | typescript-language-server |
|
Go | gopls |
|
Rust | rust-analyzer |
|
Dashboard
Real-time terminal UI for monitoring operations.
pip install relace-mcp[tools]
relogsFor detailed usage, see docs/dashboard.md.
Benchmark
Evaluate agentic_search performance using the Loc-Bench code localization dataset.
git clone https://github.com/possible055/relace-mcp.git
cd relace-mcp
uv sync --extra benchmark
# Build dataset from Hugging Face
uv run --extra benchmark python -m benchmark.cli.build_locbench --output artifacts/data/raw/locbench_v1.jsonl
# Run evaluation
uv run --extra benchmark python -m benchmark.cli.run --dataset artifacts/data/raw/locbench_v1.jsonl --limit 20All benchmark artifacts are written under benchmark/.data/.
For grid search, analysis tools, and metrics interpretation, see docs/benchmark.md.
Platform Support
Platform | Status | Notes |
Linux | ✅ Fully supported | Primary development platform |
macOS | ✅ Fully supported | All features available |
Windows | ⚠️ Partial |
|
Troubleshooting
Error or message | Solution |
| Set |
| Include 1-3 unique anchor lines near the target block |
| Verify the path exists and is inside |
| File exceeds 10MB; split the change into smaller files or edits |
| Set |
| Verify the API key and provider configuration |
| Retry later or reduce request volume |
| Check network access and retry |
| Add more specific anchors or concrete new lines so the merge can produce a diff |
| Ensure placeholder markers are used only as placeholders, not expected literal output |
| Split large deletion-heavy edits or use explicit remove directives |
| Break the change into smaller, more local edits |
Development
git clone https://github.com/possible055/relace-mcp.git
cd relace-mcp
uv sync --extra dev --extra benchmark
uv run pytest
uv run --extra dev --extra benchmark pytest benchmark/tests -qLicense
MIT
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/possible055/relace-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server