Skip to main content
Glama

aft-mcp

把 AFT(cortexkit)的唯讀工具包成 MCP server,供 Codex 等 MCP host 使用。

AFT 本身只支援 OpenCode/Pi/omp 這幾種 host,沒有 MCP server;但它接受 harness: "mcp:<client>" 的 configure,且 binary 以 NDJSON 溝通,因此這個 介面層直接驅動 aft.exe。

需求

  • Node.js 18+

  • AFT 已安裝(%LOCALAPPDATA%\aft\bin\v*\aft.exe,或設定 AFT_BINARY)

Related MCP server: Codebase Copilot MCP Server

啟動

node H:\aft-mcp\src\index.mjs

環境變數:

變數

說明

AFT_BINARY

指定 aft.exe 路徑(預設自動找最新版)

AFT_PROJECT_ROOT

預設專案根目錄(否則用 process cwd)

AFT_MCP_CLIENT

harness 名稱,預設 codex(送 mcp:codex)

註冊到 Codex

codex mcp add aft -- node H:\aft-mcp\src\index.mjs

預設不啟用;要啟用時把 ~/.codex/config.toml 的 [mcp_servers.aft] 改成 enabled = true,或直接移除 enabled = false 那一行。

Codex 的 MCP 程序 cwd 不一定是 session 的專案目錄,因此提供 aft_use_project 工具:

aft_use_project { "root": "C:\\path\\to\\repo" }

之後同一個 MCP 程序都用這個根目錄(變更時會重新 configure)。

工具(全部唯讀)

工具

AFT 指令

說明

aft_grep

grep

索引式 regex 搜尋,支援 include/path/offset

aft_glob

glob

glob 檔名搜尋

aft_search

search

語意搜尋(需要 semantic index)

aft_outline

outline

檔案/目錄結構大綱

aft_zoom

zoom

指定 symbol 的內容與位置

aft_inspect

inspect

診斷、TODO、metrics、dead code 等

aft_callgraph

callgraph

callers/call_tree/impact/trace_to/trace_to_symbol/trace_data

aft_conflicts

conflicts

合併衝突掃描

aft_status

status

索引/bridge 狀態

aft_use_project

—

設定專案根目錄

已知限制

  • AFT 的 bridge 協定不是公開 API;升級 AFT 後請重跑測試(node 啟動後看 tool 結果)。

  • 首次呼叫會觸發索引建置(grep 數秒;callgraph/semantic 可能更久), 回應會帶 index_building/callgraph_building,重試即可。

  • PowerShell 檔案不支援 outline(AFT 回 unsupported file extension: ps1)。

  • semantic search 需要 ONNX Runtime;inspect 的 LSP 診斷需要對應語言伺服器。

Available Tools

10 tools
aft_callgraphC

AFT call graph (read-only). Ops: callers, call_tree, impact, trace_to, trace_to_symbol, trace_data.

Inputs: op (required), symbol (required), filePath (required), depth, +5 more.

aft_conflictsB

AFT merge-conflict scan (read-only). Lists conflicted files/regions for a repo or worktree.

Inputs: path.

aft_globC

AFT indexed glob (read-only). List files matching a glob pattern.

Inputs: pattern (required), path.

aft_grepC

AFT indexed grep (read-only). Regex search with file paths and line numbers; paginate with offset.

Inputs: pattern (required), path, offset, include.

aft_inspectC

AFT codebase inspection (read-only). Diagnostics, TODOs, metrics, dead code, unused exports, duplicates.

Inputs: topK, scope, offset, sections.

aft_outlineB

AFT structural outline (read-only). Symbols/headings with line ranges; pass files=true for a directory tree.

Inputs: target (required), files, includeTests.

aft_statusA

AFT bridge/index status (read-only). Useful when a tool reports an index is building.

Inputs: no named parameters.

aft_use_projectB

Set the AFT project root for this session (configures the aft bridge).

Inputs: root (required).

aft_zoomC

AFT symbol zoom (read-only). Pass batch: [{ target, symbols }] to read specific symbols/sections.

Inputs: batch (required), callgraph, contextLines.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 10 tools

    Disambiguation4/5

    The tools mostly separate cleanly into regex search, globbing, semantic search, structural outlining, symbol reading, inspection, call graph, session setup, status, and conflict scanning. Minor potential overlap exists between aft_glob and aft_outline with files=true, and between aft_grep and aft_search, but descriptions provide enough distinction.

    Naming Consistency4/5

    All tools share the aft_ prefix and snake_case style, which is highly predictable. However, the operation names mix verbs and nouns (e.g., aft_zoom, aft_inspect vs. aft_outline, aft_status), so it is not a pure verb_noun pattern throughout.

    Tool Count5/5

    Ten tools is well-scoped for a codebase search and analysis server. Each tool covers a distinct capability area without excessive fragmentation.

    Completeness4/5

    The surface covers code discovery, search, structural navigation, diagnostics, call graph analysis, project configuration, status, and merge conflicts. Minor gaps remain, such as arbitrary file content reading and explicit index refresh, but most read-only codebase workflows are supported.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables AI coding agents to efficiently explore codebases by providing structural outlines, module digests, symbol bodies, and AST-aware grep via MCP.
      4
      14 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables ChatGPT Web or another MCP client to inspect and develop a local workspace, read local Codex task history, and use the complete installed XcodeBuildMCP catalog through a small set of stable tools.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides local, read-only MCP tools that expose a specified workspace's directory listing, file contents, text search, git status, and git diff to AI clients.
      2
      Apache 2.0