Skip to main content

Unofficial Relace MCP Server - Fast code merging via Relace API

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

relace_mcp-0.2.4.tar.gz (131.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

relace_mcp-0.2.4-py3-none-any.whl (162.0 kB view details)

Uploaded Python 3

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

Hashes for relace_mcp-0.2.4.tar.gz
Algorithm Hash digest
SHA256 bbd9af74e56d70ed39edf4f8f5ac2d734d853766172a9d751a35682879c72532
MD5 959a3f8bad2e87e2d8ec49d979738c45
BLAKE2b-256 24fed3e0646c78176efb58da09f87efb6255db553442c50600618714299d5332

See more details on using hashes here.

Provenance

The following attestation bundles were made for relace_mcp-0.2.4.tar.gz:

Publisher: publish.yml on possible055/relace-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for relace_mcp-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1b4205f4705809d52cfe5c97068cfea55af3c04162abe61f8d75c874a587d540
MD5 f29748dd3b882896b4f2834a55c19f09
BLAKE2b-256 43a8a57c55fab064e2579651ac6006375acb40704641a6f99bac51c816585b75

See more details on using hashes here.

Provenance

The following attestation bundles were made for relace_mcp-0.2.4-py3-none-any.whl:

Publisher: publish.yml on possible055/relace-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page