Skip to main content

English | 简体中文

Unofficial Relace MCP Server

PyPI Python 3.11+ License: MIT 100% AI-Generated OpenSSF Scorecard

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_search is deprecated alias, removed in 0.2.5)
  • Agentic Retrieval — Two-stage semantic + agentic code retrieval (requires RELACE_CLOUD_TOOLS=1 and MCP_SEARCH_MODE=indexed or both)
  • 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

Metadata

Release files for relace-mcp 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for relace-mcp 0.2.4
File Size Uploaded
relace_mcp-0.2.4.tar.gz 131.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for relace-mcp 0.2.4
File Interpreter ABI Platform
relace_mcp-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 293.8 kB

Release files / relace_mcp-0.2.4.tar.gz

Download URL relace_mcp-0.2.4.tar.gz
Size 131.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bbd9af74e56d70ed39edf4f8f5ac2d734d853766172a9d751a35682879c72532
BLAKE2b-256 checksum
How to use checksums
24fed3e0646c78176efb58da09f87efb6255db553442c50600618714299d5332
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 21, 2026.

Transparency log

Release files / relace_mcp-0.2.4-py3-none-any.whl

Download URL relace_mcp-0.2.4-py3-none-any.whl
Size 162.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b4205f4705809d52cfe5c97068cfea55af3c04162abe61f8d75c874a587d540
BLAKE2b-256 checksum
How to use checksums
43a8a57c55fab064e2579651ac6006375acb40704641a6f99bac51c816585b75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 21, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page