Skip to main content
Glama
Relace MCP Server

Relace MCP Server

by possible055

非公式 Relace MCP サーバー

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

非公式 — 個人のプロジェクトであり、Relace とは提携していません。

AI で構築 — すべて AI の支援(Antigravity、Codex、Cursor、Github Copilot、Windsurf)を受けて開発されました。

AI を活用したコード編集およびインテリジェントなコードベース探索ツールを提供する MCP サーバーです。

従来の手法

agentic_search + fast_apply を使用

手動 grep、関連ファイルを見落とす

自然言語で質問し、正確な場所を取得

編集により他の場所のインポートが壊れる

インポートと呼び出しチェーンを追跡

全書き換えでトークンを消費

変更内容を記述、行番号は不要

行番号エラーでコードが破損

10,000 トークン/秒以上のマージ

機能

  • Fast Apply — Relace API を介して 10,000 トークン/秒以上の速度でコード編集を適用

  • Agentic Search — 自然言語クエリによるエージェント型コードベース探索

  • Agentic Retrieval — ハイブリッドなセマンティックヒントとライブコード探索(古いヒントのサポートと明示的なクラウドメンテナンス機能付き。MCP_SEARCH_RETRIEVAL=1 で有効化し、MCP_RETRIEVAL_BACKEND でバックエンドを選択)

  • Cloud Search — クラウド同期されたリポジトリに対するセマンティックコード検索

Related MCP server: code-context

クイックスタート

前提条件: uv, git, ripgrep (推奨)

relace バックエンド(デフォルト)を使用する場合: Relace ダッシュボード から API キーを取得し、MCP クライアントに追加してください。

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

設定

変数

必須

説明

RELACE_API_KEY

✅*

Relace ダッシュボード の API キー。Relace プロバイダーおよびクラウドツールに必須

MCP_SEARCH_RETRIEVAL

❌

1 に設定すると agentic_retrieval ツールが登録されます

MCP_RETRIEVAL_BACKEND

❌

セマンティック検索バックエンド: relace (デフォルト), codanna, chunkhound, または none

MCP_RETRIEVAL_HINT_POLICY

❌

検索ヒントポリシー: prefer-stale (デフォルト) または strict

MCP_BACKGROUND_INDEX_MONITOR

❌

ローカルインデックスの定期更新モニター(オプトイン)。固定された MCP_BASE_DIR とローカルバックエンドが必要

MCP_BACKGROUND_INDEX_INTERVAL_SECONDS

❌

ローカルインデックスモニターの定期実行間隔(秒)(デフォルト: 300)

MCP_BACKGROUND_INDEX_INITIAL_DELAY_SECONDS

❌

初回のローカルインデックスチェックまでの初期遅延(秒)(デフォルト: 30)

MCP_SEARCH_TURN_STATUS_MODE

❌

ターンステータスのユーザーメッセージポリシー: always (デフォルト), final-only, または off

SEARCH_BASH_TOOLS

❌

検索実行中の bash 有効化: 1 (オン、デフォルト), 0 (オフ)

SEARCH_LSP_TOOLS

❌

LSP 支援検索の有効化: 1 (オン), 0 (オフ、デフォルト)

MCP_BASE_DIR

❌

プロジェクトルートのオーバーライド(MCP Roots → Git → ワークスペースストレージ → CWD から自動検出)

MCP_LOGGING

❌

ファイルログ: off (デフォルト), safe, full

MCP_DOTENV_PATH

❌

設定を一元管理するための .env ファイルへのパス

* APPLY_PROVIDER と SEARCH_PROVIDER の両方が Relace 以外であり、かつ MCP_RETRIEVAL_BACKEND が codanna, chunkhound, none のいずれかである場合はオプションです。

.env の使用方法、エンコーディング設定、カスタム LLM プロバイダーなどの詳細については、docs/advanced.md を参照してください。

ツール

常に利用可能: fast_apply, agentic_search。agentic_retrieval は MCP_SEARCH_RETRIEVAL=1 が必要です。クラウドツールは MCP_RETRIEVAL_BACKEND=relace の場合のみ利用可能です。index_status は relace, codanna, chunkhound で利用可能で、MCP_RETRIEVAL_BACKEND=none の場合は非表示になります。

MCP ネイティブの検出機能を使用してください: ツールには list_tools()、リソースには list_resources() を使用します。

詳細なパラメータについては、docs/tools.md を参照してください。

言語サポート

LSP ツールは、システムにインストールされている外部言語サーバーを使用します。

言語

言語サーバー

インストールコマンド

Python

basedpyright

(バンドル済み)

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

ダッシュボード

操作を監視するためのリアルタイムターミナル UI。

pip install relace-mcp[tools]
relogs

詳細な使用方法については、docs/dashboard.md を参照してください。

ベンチマーク

Loc-Bench コードローカリゼーションデータセットを使用して agentic_search のパフォーマンスを評価します。

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

すべてのベンチマーク成果物は benchmark/.data/ に書き込まれます。

グリッド検索、分析ツール、メトリクスの解釈については、docs/benchmark.md を参照してください。

プラットフォームサポート

プラットフォーム

ステータス

備考

Linux

✅ 完全サポート

主要な開発プラットフォーム

macOS

✅ 完全サポート

すべての機能が利用可能

Windows

⚠️ 部分的

bash ツールは利用不可。完全な機能を利用するには WSL を使用してください

トラブルシューティング

エラーまたはメッセージ

解決策

RELACE_API_KEY is required ...

Relace プロバイダーまたはクラウドツールを使用する場合は RELACE_API_KEY を設定してください

NEEDS_MORE_CONTEXT

ターゲットブロックの近くに 1~3 個の固有のアンカー行を含めてください

INVALID_PATH

パスが存在し、MCP_BASE_DIR または許可された追加パス内にあることを確認してください

FILE_TOO_LARGE

ファイルが 10MB を超えています。変更を小さなファイルや編集に分割してください

ENCODING_ERROR

UTF-8 以外のプロジェクトでは RELACE_DEFAULT_ENCODING を明示的に設定してください

AUTH_ERROR

API キーとプロバイダーの設定を確認してください

RATE_LIMIT

後で再試行するか、リクエスト量を減らしてください

NETWORK_ERROR / TIMEOUT_ERROR

ネットワークアクセスを確認して再試行してください

APPLY_NOOP

マージが差分を生成できるように、より具体的なアンカーや具体的な新しい行を追加してください

MARKER_LEAKAGE

プレースホルダーマーカーがプレースホルダーとしてのみ使用され、期待されるリテラル出力として使用されていないことを確認してください

TRUNCATION_DETECTED

大規模な削除を伴う編集を分割するか、明示的な削除ディレクティブを使用してください

BLAST_RADIUS_EXCEEDED

変更をより小さく、より局所的な編集に分割してください

開発

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

ライセンス

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