Skip to main content
Glama
possible055

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)。

MCP 服务器,提供 AI 驱动的代码编辑和智能代码库探索工具。

无此工具

使用 agentic_search + fast_apply

手动 grep,容易遗漏相关文件

自然语言提问,获取精确位置

编辑导致其他地方导入错误

追踪导入和调用链

全量重写消耗大量 tokens

描述变更,无需行号

行号错误导致代码损坏

10,000+ tokens/秒合并

功能特性

  • 快速应用 (Fast Apply) — 通过 Relace API 以 10,000+ tokens/秒的速度应用代码编辑

  • 智能搜索 (Agentic Search) — 基于自然语言查询的智能代码库探索

  • 智能检索 (Agentic Retrieval) — 混合语义提示 + 实时代码探索,支持陈旧提示和显式云端维护(通过 MCP_SEARCH_RETRIEVAL=1 启用;使用 MCP_RETRIEVAL_BACKEND 选择后端)

  • 云端搜索 (Cloud Search) — 对云端同步仓库进行语义代码搜索

Related MCP server: GraphHub

快速开始

先决条件: uvgitripgrep(推荐)

使用 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(默认)、codannachunkhoundnone

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-onlyoff

SEARCH_BASH_TOOLS

在搜索运行期间启用 bash1(开启,默认)、0(关闭)

SEARCH_LSP_TOOLS

启用 LSP 辅助搜索:1(开启)、0(关闭,默认)

MCP_BASE_DIR

项目根目录覆盖(通过 MCP Roots → Git → 工作区存储 → CWD 自动检测)

MCP_LOGGING

文件日志记录:off(默认)、safefull

MCP_DOTENV_PATH

用于集中配置的 .env 文件路径

* 如果满足以下两者,则可选:(1) APPLY_PROVIDERSEARCH_PROVIDER 为非 Relace 提供商,且 (2) MCP_RETRIEVAL_BACKENDcodannachunkhoundnone

有关 .env 使用、编码设置、自定义 LLM 提供商等更多信息,请参阅 docs/advanced.md

工具

始终可用:fast_applyagentic_searchagentic_retrieval 需要 MCP_SEARCH_RETRIEVAL=1。云端工具仅在 MCP_RETRIEVAL_BACKEND=relace 时可用。index_status 适用于 relacecodannachunkhound,在 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

Install Server
A
license - permissive license
A
quality
B
maintenance

Maintenance

Maintainers
Response time
1wRelease cycle
4Releases (12mo)
Commit activity
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    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
    A
    quality
    A
    maintenance
    Provides persistent memory and a codebase knowledge graph for AI coding assistants, enabling shared context across multiple tools like Claude, Cursor, and ChatGPT, with significant token reduction.
    5
    32
    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

View all related MCP servers

Related MCP Connectors

  • SaaS intelligence for AI agents. 5 unified tools cover 1,000+ services with 91-96% token savings.

  • Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.

  • Search your knowledge bases from any AI assistant using hybrid RAG.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/possible055/relace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server