Unofficial Relace MCP Server - Fast code merging via Relace API
Project description
English | 简体中文
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 agentic_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
- Agentic Search — Agentic codebase exploration with natural language queries (
fast_searchis deprecated alias, removed in 0.2.5) - Agentic Retrieval — Two-stage semantic + agentic code retrieval (requires
RELACE_CLOUD_TOOLS=1andMCP_SEARCH_MODE=indexedorboth) - 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)
Using Relace (default) or RELACE_CLOUD_TOOLS=1: get your API key from Relace Dashboard, then add to your MCP client:
Cursor
~/.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 Code
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
Windsurf
~/.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"
}
}
}
}
VS Code
.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 CLI
~/.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 |
|---|---|---|
RELACE_API_KEY |
✅* | API key from Relace Dashboard |
RELACE_CLOUD_TOOLS |
❌ | Set to 1 to enable cloud tools |
MCP_SEARCH_MODE |
❌ | Search mode: agentic (default), indexed, or both |
SEARCH_LSP_TOOLS |
❌ | LSP tools: 1 (all on), auto (detect installed servers), 0 (off, default) |
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 |
* Optional if both: (1) APPLY_PROVIDER and SEARCH_PROVIDER are non-Relace providers, and (2) RELACE_CLOUD_TOOLS=false.
For .env usage, encoding settings, custom LLM providers, and more, see docs/advanced.md.
Tools
Core tools (fast_apply, agentic_search) are always available. fast_search is a deprecated alias for agentic_search (removed in 0.2.5). Cloud tools require RELACE_CLOUD_TOOLS=1. agentic_retrieval requires both RELACE_CLOUD_TOOLS=1 and MCP_SEARCH_MODE=indexed or both.
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 | npm i -g typescript-language-server typescript |
| Go | gopls | go install golang.org/x/tools/gopls@latest |
| Rust | rust-analyzer | rustup component add rust-analyzer |
Dashboard
Real-time terminal UI for monitoring operations.
pip install relace-mcp[tools]
relogs
For detailed usage, see docs/dashboard.md.
Benchmark
Evaluate agentic_search performance using the Loc-Bench code localization dataset.
# Install benchmark dependencies
pip install relace-mcp[benchmark]
# Build dataset from Hugging Face
uv run python -m benchmark.cli.build_locbench --output artifacts/data/raw/locbench_v1.jsonl
# Run evaluation
uv run python -m benchmark.cli.run --dataset artifacts/data/raw/locbench_v1.jsonl --limit 20
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 | 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 10MB; split file |
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file relace_mcp-0.2.4.tar.gz.
File metadata
- Download URL: relace_mcp-0.2.4.tar.gz
- Upload date:
- Size: 131.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbd9af74e56d70ed39edf4f8f5ac2d734d853766172a9d751a35682879c72532
|
|
| MD5 |
959a3f8bad2e87e2d8ec49d979738c45
|
|
| BLAKE2b-256 |
24fed3e0646c78176efb58da09f87efb6255db553442c50600618714299d5332
|
Provenance
The following attestation bundles were made for relace_mcp-0.2.4.tar.gz:
Publisher:
publish.yml on possible055/relace-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
relace_mcp-0.2.4.tar.gz -
Subject digest:
bbd9af74e56d70ed39edf4f8f5ac2d734d853766172a9d751a35682879c72532 - Sigstore transparency entry: 843948267
- Sigstore integration time:
-
Permalink:
possible055/relace-mcp@fe78a2620f32d5cb42f7092407a7b22138433486 -
Branch / Tag:
refs/tags/0.2.4 - Owner: https://github.com/possible055
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fe78a2620f32d5cb42f7092407a7b22138433486 -
Trigger Event:
push
-
Statement type:
File details
Details for the file relace_mcp-0.2.4-py3-none-any.whl.
File metadata
- Download URL: relace_mcp-0.2.4-py3-none-any.whl
- Upload date:
- Size: 162.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b4205f4705809d52cfe5c97068cfea55af3c04162abe61f8d75c874a587d540
|
|
| MD5 |
f29748dd3b882896b4f2834a55c19f09
|
|
| BLAKE2b-256 |
43a8a57c55fab064e2579651ac6006375acb40704641a6f99bac51c816585b75
|
Provenance
The following attestation bundles were made for relace_mcp-0.2.4-py3-none-any.whl:
Publisher:
publish.yml on possible055/relace-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
relace_mcp-0.2.4-py3-none-any.whl -
Subject digest:
1b4205f4705809d52cfe5c97068cfea55af3c04162abe61f8d75c874a587d540 - Sigstore transparency entry: 843948275
- Sigstore integration time:
-
Permalink:
possible055/relace-mcp@fe78a2620f32d5cb42f7092407a7b22138433486 -
Branch / Tag:
refs/tags/0.2.4 - Owner: https://github.com/possible055
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fe78a2620f32d5cb42f7092407a7b22138433486 -
Trigger Event:
push
-
Statement type: