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 for Relace — AI-powered instant code merging and agentic codebase search.
Prerequisites
uv — Python package manager
git — for
cloud_syncto respect.gitignoreripgrep (
rg) — recommended forfast_search(falls back to Python regex if unavailable)
Platform Notes
Platform | Status | Notes |
Linux | ✅ Fully supported | Primary development platform |
macOS | ✅ Fully supported | All features available |
Windows | ⚠️ Partial |
tool unavailable; use WSL for full functionality |
Windows users: The
bashtool requires a Unix shell. Install WSL for full feature parity, or use other exploration tools (view_file,grep_search,glob).
Quick Start
Get your API key from Relace Dashboard, then add to your MCP client:
~/.cursor/mcp.json
~/.codeium/windsurf/mcp_config.json
.vscode/mcp.json
~/.codex/config.toml
Note:
RELACE_BASE_DIRis optional. If not set, the server auto-detects via MCP Roots or Git. If set, it must be an absolute path.
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
Environment Variables
Variable | Required | Description |
| ✅ | API key from |
| ❌ | Absolute path to project root (auto-detected via MCP Roots if not set) |
| ❌ | Force file encoding (e.g.,
,
) for legacy repos |
| ❌ | Max files for auto-detecting encoding (default:
) |
Note: When
RELACE_BASE_DIRis not set, the server automatically detects your project root using:
MCP Roots (workspace info from your editor)
Git repository root (if found)
Current working directory (fallback)
⚠️ Warning: Fallback to CWD/Git can be unstable if MCP Roots fail. Explicit
RELACE_BASE_DIRis recommended.
For advanced settings, see docs/advanced.md.
Tools
Tool | Description |
| Apply code edits at 10,000+ tokens/sec |
| Agentic codebase search with natural language |
| Upload local codebase to Relace Cloud |
| Semantic search over cloud-synced repos |
| List cloud repositories |
| Get sync status |
| Delete cloud repo and local state |
For detailed parameters and examples, see docs/tools.md.
Logging
Note: File logging is opt-in. Enable with
RELACE_LOGGING=1.
Operation logs are written to a cross-platform state directory:
Linux:
~/.local/state/relace/relace.logmacOS:
~/Library/Application Support/relace/relace.logWindows:
%LOCALAPPDATA%\relace\relace.log
For log format and advanced options, see docs/advanced.md.
Troubleshooting
Common issues:
RELACE_API_KEY is not set: Set the key in your environment or MCP config.RELACE_BASE_DIR does not exist/INVALID_PATH: Ensure the path exists and is withinRELACE_BASE_DIR.NEEDS_MORE_CONTEXT/APPLY_NOOP: Include 1–3 real anchor lines before and after the target block.FILE_TOO_LARGE: File exceeds the 1MB size limit; split large files or increase limit.ENCODING_ERROR: Cannot detect file encoding; setRELACE_DEFAULT_ENCODINGexplicitly.FILE_NOT_WRITABLE/PERMISSION_ERROR: Check file and directory write permissions.AUTH_ERROR: Verify yourRELACE_API_KEYis valid and not expired.RATE_LIMIT: Too many requests; wait and retry later.TIMEOUT_ERROR/NETWORK_ERROR: Check network connectivity; increase timeout viaRELACE_TIMEOUT_SECONDS.
Windows users: The
bashtool infast_searchis unavailable on Windows. Use WSL or rely on other exploration tools.