Relace MCP Server
Enables AI-powered instant code merging at 10,000+ tokens/sec and agentic codebase search with natural language queries through the Relace API.
README
<p align="right"> <strong>English</strong> | <a href="README.zh-CN.md">简体中文</a> </p>
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 fast_search + fast_apply |
|---|---|
| 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
- Fast Search — Agentic codebase exploration with natural language queries
- Cloud Sync — Upload local codebase to Relace Cloud for semantic search
- Cloud Search — Semantic code search over cloud-synced repositories
- Dashboard — Real-time terminal UI for monitoring operations
Quick Start
Prerequisites: uv, git, ripgrep (recommended)
Get your API key from Relace Dashboard, then add to your MCP client:
<details> <summary><strong>Cursor</strong></summary>
~/.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"
}
}
}
}
</details>
<details> <summary><strong>Claude Code</strong></summary>
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
</details>
<details> <summary><strong>Windsurf</strong></summary>
~/.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"
}
}
}
}
</details>
<details> <summary><strong>VS Code</strong></summary>
.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}"
}
}
}
}
}
</details>
<details> <summary><strong>Codex CLI</strong></summary>
~/.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"
</details>
Configuration
| Variable | Required | Description |
|---|---|---|
RELACE_API_KEY |
✅ | API key from Relace Dashboard |
RELACE_CLOUD_TOOLS |
❌ | Set to 1 to enable cloud tools |
MCP_BASE_DIR |
❌ | Project root (auto-detected via MCP Roots → Git → CWD) |
MCP_LOGGING |
❌ | Set to 1 to enable file logging |
MCP_DOTENV_PATH |
❌ | Path to .env file for centralized config |
For .env usage, encoding settings, custom LLM providers, and more, see docs/advanced.md.
Tools
Core tools (fast_apply, fast_search) are always available. Cloud tools require RELACE_CLOUD_TOOLS=1.
For detailed parameters, see docs/tools.md.
Dashboard
Real-time terminal UI for monitoring operations.
pip install relace-mcp[tools]
relogs
For detailed usage, see docs/dashboard.md.
Platform Support
| Platform | Status | Notes |
|---|---|---|
| Linux | ✅ Fully supported | Primary development platform |
| macOS | ✅ Fully supported | All features available |
| Windows | ⚠️ Partial | bash tool unavailable; use WSL for full functionality |
Troubleshooting
| Error | Solution |
|---|---|
RELACE_API_KEY is not set |
Set the key in your environment or MCP config |
NEEDS_MORE_CONTEXT |
Include 1–3 anchor lines before/after target block |
FILE_TOO_LARGE |
File exceeds 1MB; split or increase limit |
ENCODING_ERROR |
Set RELACE_DEFAULT_ENCODING explicitly |
AUTH_ERROR |
Verify API key is valid and not expired |
RATE_LIMIT |
Too many requests; wait and retry |
Development
git clone https://github.com/possible055/relace-mcp.git
cd relace-mcp
uv sync --extra dev
uv run pytest
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.