⚠ 本页部分翻译:安装漏斗(Windows PowerShell / Linux / macOS / Claude Desktop / .mcp.json)以英文为准,中文翻译进行中。技术命令与配置以英文原文呈现,避免歧义。

快速上手

安装

Silex 是以 Python 包分发的本地 MCP 服务器。它在你的机器上扫描代码库,任何内容都不会外传。需要 Python 3.10+。

# Requires Python 3.10+
pip install silex-archaeology

无需信用卡。无需账号。无遥测。下面的命令会安装到隔离的虚拟环境中——这是我们在实战中的运行方式。

Windows — PowerShell

PowerShell uses $env:USERPROFILE, never %USERPROFILE%. The %VAR% syntax is cmd.exe only — in PowerShell it does not expand and silently creates a literal %USERPROFILE% folder (a 400 MB venv landed inside one in the field). Use $env:USERPROFILE in PowerShell; keep %USERPROFILE% only in classic cmd.exe.

Create an isolated venv and install the wheel into it:

# PowerShell — create the venv and install
python -m venv $env:USERPROFILE\silex-mcp\venv
& $env:USERPROFILE\silex-mcp\venv\Scripts\pip install silex-archaeology

# Sanity check — the server answers outside your client
& $env:USERPROFILE\silex-mcp\venv\Scripts\silex-mcp-server.exe --help

Linux / macOS

Same recipe with the POSIX venv layout:

# bash / zsh — create the venv and install
python3 -m venv ~/silex-mcp/venv
~/silex-mcp/venv/bin/pip install silex-archaeology

# Sanity check
~/silex-mcp/venv/bin/silex-mcp-server --help

Connect your agent

Silex speaks MCP over stdio. Add it to any MCP-aware client — Cursor, Claude Desktop, Claude Code, Windsurf, Cline, Continue, Zed. The VS Code extension is coming soon; MCP is the path today. There are two config surfaces:

Claude Desktop — claude_desktop_config.json

On Windows this file lives at %APPDATA%\Claude\claude_desktop_config.json (open $env:APPDATA\Claude from PowerShell). Five lines are enough — the command plus SILEX_TIER=free:

{
  "mcpServers": {
    "silex": {
      "command": "silex-mcp",
      "args": ["serve", "--stdio"],
      "env": { "SILEX_TIER": "free" }
    }
  }
}

Point command at the venv binary above if it isn't on your PATH. Then fully quit and reopen Claude Desktop — the tools icon lists the silex tools.

Claude Code / VS Code — .mcp.json (primary)

Windows drive-case bug. claude mcp add writes the path into ~/.claude.json as C:/… while the VS Code extension reads c:/… — the case mismatch breaks server discovery (it stalled a field run). The robust path on Windows is a .mcp.json at the project root as the primary form; keep claude mcp add for Linux/macOS.

Create .mcp.json in the root of the project you want Silex to see:

// .mcp.json — project root (Claude Code & VS Code)
{
  "mcpServers": {
    "silex": {
      "command": "silex-mcp",
      "args": ["serve", "--stdio"],
      "env": { "SILEX_TIER": "free" }
    }
  }
}

On Linux / macOS you can instead run claude mcp add silex -- silex-mcp serve --stdio.

首次扫描

首次使用时,Silex 会扫描工作区并构建本地知识库:架构、依赖、工作流和业务规则——每条论断都锚定到 file:line。随后你的代理通过下方的 MCP 工具查询这些知识。

MCP 工具

所有工具都位于 silex-archaeology 命名空间之下。完整且始终最新的列表——名称、参数和示例——由真实注册表在 MCP 工具参考 页面生成。

工具返回
create_workspace注册仓库并触发后台扫描。
get_workspace_stats扫描状态与统计——轮询直到完成。
get_code_communities代码库社区的层级地图(Leiden)。
get_structural_findings桥接、枢纽与孤立区域——不消耗 LLM。
get_rules_by_ids带来源和置信度的业务规则。
generate_domain_report可分享的领域 Markdown 报告。

证据与置信度

每条论断都带有裁定、置信度百分比和来源锚点。裁定:

verified该论断由锚点处的代码证据支撑。
flagged ⚠证据指向风险——修改前请复查。

置信度以等宽字体显示为取整百分比(96%)。锚点是 file:line 指向源码的链接,例如 Order.cs:99-131

未知领域

Silex 从不猜测。扫描无法证明的部分会被报告为未知领域,你的代理因此知道地图的边界在哪里。

可分享的报告

每次扫描都会生成可与团队分享的报告——与代理所见相同的证据,人类可读。

← 返回产品页