Skip to main content
Glama
Relace MCP Server

Relace MCP Server

by possible055

Inoffizieller Relace MCP-Server

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

Inoffiziell — Persönliches Projekt, nicht mit Relace verbunden.

Mit KI erstellt — Vollständig mit KI-Unterstützung entwickelt (Antigravity, Codex, Cursor, Github Copilot, Windsurf).

MCP-Server, der KI-gestützte Code-Bearbeitung und intelligente Werkzeuge zur Erkundung der Codebasis bereitstellt.

Ohne

Mit agentic_search + fast_apply

Manuelles Grep, übersieht verwandte Dateien

Natürlich fragen, präzise Orte erhalten

Bearbeitungen zerstören Importe an anderer Stelle

Verfolgt Importe und Aufrufketten

Vollständiges Umschreiben verbraucht Token

Änderungen beschreiben, keine Zeilennummern

Zeilennummernfehler beschädigen Code

10.000+ Token/Sek. Zusammenführung

Funktionen

  • Fast Apply — Code-Bearbeitungen mit über 10.000 Token/Sek. über die Relace-API anwenden

  • Agentic Search — Agentische Codebase-Erkundung mit natürlichsprachlichen Abfragen

  • Agentic Retrieval — Hybride semantische Hinweise + Live-Code-Erkundung, mit Unterstützung für veraltete Hinweise und expliziter Cloud-Wartung (aktivieren mit MCP_SEARCH_RETRIEVAL=1; wählen Sie das Backend mit MCP_RETRIEVAL_BACKEND)

  • Cloud Search — Semantische Codesuche über in der Cloud synchronisierte Repositories

Related MCP server: code-context

Schnellstart

Voraussetzungen: uv, git, ripgrep (empfohlen)

Verwendung des relace-Backends (Standard): Holen Sie sich Ihren API-Schlüssel vom Relace Dashboard und fügen Sie ihn dann Ihrem MCP-Client hinzu:

~/.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 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

~/.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"
      }
    }
  }
}

.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/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"

Konfiguration

Variable

Erforderlich

Beschreibung

RELACE_API_KEY

✅*

API-Schlüssel vom Relace Dashboard; erforderlich für Relace-Anbieter und Cloud-Tools

MCP_SEARCH_RETRIEVAL

❌

Auf 1 setzen, um das agentic_retrieval-Tool zu registrieren

MCP_RETRIEVAL_BACKEND

❌

Semantisches Retrieval-Backend: relace (Standard), codanna, chunkhound oder none

MCP_RETRIEVAL_HINT_POLICY

❌

Retrieval-Hinweis-Richtlinie: prefer-stale (Standard) oder strict

MCP_BACKGROUND_INDEX_MONITOR

❌

Optionaler periodischer Aktualisierungsmonitor für lokale Indizes; erfordert ein fixiertes MCP_BASE_DIR und ein lokales Backend

MCP_BACKGROUND_INDEX_INTERVAL_SECONDS

❌

Intervall für den periodischen lokalen Indexmonitor in Sekunden (Standard: 300)

MCP_BACKGROUND_INDEX_INITIAL_DELAY_SECONDS

❌

Anfängliche Verzögerung vor der ersten periodischen lokalen Indexprüfung in Sekunden (Standard: 30)

MCP_SEARCH_TURN_STATUS_MODE

❌

Richtlinie für Turn-Status-Benutzernachrichten: always (Standard), final-only oder off

SEARCH_BASH_TOOLS

❌

bash während Suchläufen aktivieren: 1 (an, Standard), 0 (aus)

SEARCH_LSP_TOOLS

❌

LSP-unterstützte Suche aktivieren: 1 (an), 0 (aus, Standard)

MCP_BASE_DIR

❌

Überschreibung des Projekt-Roots (automatisch erkannt über MCP Roots → Git → Workspace-Speicher → CWD)

MCP_LOGGING

❌

Dateiprotokollierung: off (Standard), safe, full

MCP_DOTENV_PATH

❌

Pfad zur .env-Datei für zentralisierte Konfiguration

* Optional, wenn beides zutrifft: (1) APPLY_PROVIDER und SEARCH_PROVIDER sind keine Relace-Anbieter, und (2) MCP_RETRIEVAL_BACKEND ist codanna, chunkhound oder none.

Für die Verwendung von .env, Kodierungseinstellungen, benutzerdefinierte LLM-Anbieter und mehr, siehe docs/advanced.md.

Werkzeuge

Immer verfügbar: fast_apply, agentic_search. agentic_retrieval erfordert MCP_SEARCH_RETRIEVAL=1. Cloud-Tools sind nur verfügbar, wenn MCP_RETRIEVAL_BACKEND=relace. index_status ist für relace, codanna und chunkhound verfügbar und ausgeblendet, wenn MCP_RETRIEVAL_BACKEND=none.

Verwenden Sie MCP-native Erkennungsoberflächen: list_tools() für Werkzeuge und list_resources() für Ressourcen.

Für detaillierte Parameter siehe docs/tools.md.

Sprachunterstützung

LSP-Werkzeuge verwenden externe Sprachserver, die auf Ihrem System installiert sind.

Sprache

Sprachserver

Installationsbefehl

Python

basedpyright

(gebündelt)

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

Echtzeit-Terminal-UI zur Überwachung von Vorgängen.

pip install relace-mcp[tools]
relogs

Für eine detaillierte Nutzung siehe docs/dashboard.md.

Benchmark

Bewerten Sie die Leistung von agentic_search mithilfe des Loc-Bench Code-Lokalisierungs-Datensatzes.

git clone https://github.com/possible055/relace-mcp.git
cd relace-mcp
uv sync --extra benchmark

# Build dataset from Hugging Face
uv run --extra benchmark python -m benchmark.cli.build_locbench --output artifacts/data/raw/locbench_v1.jsonl

# Run evaluation
uv run --extra benchmark python -m benchmark.cli.run --dataset artifacts/data/raw/locbench_v1.jsonl --limit 20

Alle Benchmark-Artefakte werden unter benchmark/.data/ geschrieben.

Für Rastersuche, Analysewerkzeuge und Metrikeninterpretation siehe docs/benchmark.md.

Plattformunterstützung

Plattform

Status

Hinweise

Linux

✅ Voll unterstützt

Primäre Entwicklungsplattform

macOS

✅ Voll unterstützt

Alle Funktionen verfügbar

Windows

⚠️ Teilweise

bash-Werkzeug nicht verfügbar; verwenden Sie WSL für volle Funktionalität

Fehlerbehebung

Fehler oder Nachricht

Lösung

RELACE_API_KEY is required ...

Setzen Sie RELACE_API_KEY bei Verwendung von Relace-Anbietern oder Cloud-Tools

NEEDS_MORE_CONTEXT

Fügen Sie 1-3 eindeutige Ankerzeilen in der Nähe des Zielblocks ein

INVALID_PATH

Überprüfen Sie, ob der Pfad existiert und sich innerhalb von MCP_BASE_DIR oder einem erlaubten zusätzlichen Pfad befindet

FILE_TOO_LARGE

Datei überschreitet 10 MB; teilen Sie die Änderung in kleinere Dateien oder Bearbeitungen auf

ENCODING_ERROR

Setzen Sie RELACE_DEFAULT_ENCODING explizit für Nicht-UTF-8-Projekte

AUTH_ERROR

Überprüfen Sie den API-Schlüssel und die Anbieterkonfiguration

RATE_LIMIT

Versuchen Sie es später erneut oder reduzieren Sie das Anfragevolumen

NETWORK_ERROR / TIMEOUT_ERROR

Überprüfen Sie den Netzwerkzugriff und versuchen Sie es erneut

APPLY_NOOP

Fügen Sie spezifischere Anker oder konkrete neue Zeilen hinzu, damit die Zusammenführung ein Diff erzeugen kann

MARKER_LEAKAGE

Stellen Sie sicher, dass Platzhaltermarkierungen nur als Platzhalter verwendet werden, nicht als erwartete wörtliche Ausgabe

TRUNCATION_DETECTED

Teilen Sie große, löschintensive Bearbeitungen auf oder verwenden Sie explizite Entfernungsanweisungen

BLAST_RADIUS_EXCEEDED

Unterteilen Sie die Änderung in kleinere, lokalere Bearbeitungen

Entwicklung

git clone https://github.com/possible055/relace-mcp.git
cd relace-mcp
uv sync --extra dev --extra benchmark
uv run pytest
uv run --extra dev --extra benchmark pytest benchmark/tests -q

Lizenz

MIT

Available Tools

7 tools
cloud_clearA
Destructive

Delete cloud repository and local sync state. IRREVERSIBLE.

Removes all indexed data from Relace Cloud. Use cloud_list to find repo IDs.

Inputs: confirm, repo_id. Returns: object

cloud_listA
Read-onlyIdempotent

[ADMIN] List all repositories in your Relace Cloud account.

Use to find repo_id for cloud_clear. Not needed for normal search/sync workflow. Returns repository IDs, names, and indexing status.

Inputs: no named parameters. Returns: object

cloud_syncA
Idempotent

Upload or refresh codebase to Relace Cloud for semantic search.

Check index_status() first—skip this if cloud freshness is already 'fresh'. Syncs git-tracked files to enable cloud_search. Incremental by default.

Advanced (Relace-specific): force=True Re-upload all files; use after large refactors. force=True+mirror=True Delete cloud files absent locally; use after branch switch.

Returns: {sync_mode (str), files_created (int), files_updated (int), files_deleted (int), files_unchanged (int), warnings (list[str]), repo_id (str), repo_head (str)}. Check warnings[] for truncation or suppressed deletes. Fails if not in a git repo or RELACE_API_KEY is not set.

Inputs: force, mirror. Returns: object

fast_applyA
Destructive

Edit or create a file using intelligent merging.

For new files: writes content directly. For existing files: merges edit_snippet with current content using anchor lines. Anchor lines are verbatim lines copied from the existing file that help locate the exact edit target. Include 1-2 unique lines adjacent to the change. Truncation markers are recommended for larger scoped edits but not required. Markdown files keep fenced code blocks verbatim; outer fence stripping is skipped for .md/.mdx targets.

On error, the response includes a code field:

  • NEEDS_MORE_CONTEXT: merge model could not locate the target - add 1-2 unique anchor lines from immediately around the edit location.

  • APPLY_NOOP: merge returned an identical file even though the snippet contained explicit remove directives or concrete new lines not present in the original.

  • BLAST_RADIUS_EXCEEDED: edit scope too large - split into smaller edits.

  • MARKER_LEAKAGE: placeholder marker text leaked into merged output (treated as literal text).

  • TRUNCATION_DETECTED: merged output shrank drastically and no explicit remove directive was provided.

On success: {status: "ok", diff: str | None (unified diff, None for new files or no-op)}.

Do NOT use this tool to delete files or clear file contents. Use a dedicated file management tool for those operations.

Inputs: path (required), edit_snippet (required), instruction. Returns: object

index_statusA
Read-onlyIdempotent

Inspect the single active indexing backend in read-only mode.

Use this before retrieval when you need to know whether the active backend is fresh and whether semantic hints are usable. Returns active_backend, a single backend status object with freshness and hints_usable, and background_monitor (state, reason). This tool never refreshes indexes; if active_backend is relace and backend.status.needs_sync is true, run cloud_sync().

Inputs: no named parameters. Returns: trace_id, active_backend, base_dir, base_dir_source, +3 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with descriptions that explicitly differentiate similar tools (e.g., agentic_search vs cloud_search based on query type). There is no functional overlap.

    Naming Consistency3/5

    Cloud operations use a consistent 'cloud_' prefix, but 'agentic_search', 'fast_apply', and 'index_status' break the pattern. Mix of verb_noun and adjective_noun styles reduces predictability.

    Tool Count5/5

    Seven tools is well-scoped for a code search and editing server. Each tool addresses a specific need without redundancy or excessive complexity.

    Completeness3/5

    Covers search (local and cloud) and file editing, but lacks tools for reading full file content, deleting files, or managing local files beyond edits. Users may need to rely on external tools for basic operations.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      F
      maintenance
      Provides AI-powered code intelligence for any codebase using local LLMs and vector search, enabling semantic code search, pattern analysis, and context-optimized code generation with 90% token savings.
      2
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI coding assistants to automatically scan, store, and query API endpoints from codebases, providing instant lookup and semantic search to reduce context switching and token consumption.
      1
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Make any LLM a codebase expert instantly. Provides deep code intelligence through semantic search, architecture mapping, security analysis, and smart context that fits perfectly in token windows.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides structured, token-efficient code context for AI assistants by indexing codebases with AST-level analysis, supporting 17+ languages, enabling semantic search, call-site tracking, and PR attribution.
      70 PyPI
      52
      MIT