Rust FAF

one.faf由 faf.one 发布v0.9.0更新于 Nov 7, 2026

Persistent project context — Rust-native MCP server. IANA-registered .faf format.

发布方自己的服务:rust.wiki

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

本地 MCP 服务器,用于创建、评分并同步 project.faf 项目上下文文件,让 AI 助手无需反复了解项目背景。

可以做什么
  • 创建与查找上下文:从文件树初始化 project.faf、执行初始化并同步 CLAUDE.md 与评分、根据 GitHub 仓库地址起草,或向上查找最近的 project.faf
  • 读取与评分:显示解析后的 project.faf 内容,并按字段给出 0 到 100% 的 AI 就绪度评分
  • 生成助手文件:由 project.faf 生成 CLAUDE.md 与 AGENTS.md,并保留 faf 区块之外的手写内容
  • 适配上下文限制:按 minimal、standard、full 三档压缩 project.faf,并估算各档 token 数
  • 查看演进记录:显示 .faf-dna 中记录的 FAF DNA 历史
适用场景
适合希望用一个持久项目上下文文件替代每次向 AI 重复解释代码库的场景,也适合让生成的 CLAUDE.md 或 AGENTS.md 与该文件保持同步。主要面向本地 Rust 相关 MCP 客户端。
运行要求
以本地 stdio 进程运行,无需参数、配置文件、环境变量或身份验证。可通过 cargo 安装(需 Rust 工具链),或用 npx 运行 npm 包以下载预编译二进制;macOS 另有 Homebrew 方式。仅根据 GitHub 仓库生成上下文的工具需要联网。
安装前请注意
多个工具会在项目中写入文件:project.faf、CLAUDE.md 和 AGENTS.md,不过写入工具声明为非破坏性,且不会覆盖已存在的 project.faf。GitHub 工具会把仓库地址发送到公开的 GitHub API。建议锁定包版本,因为 PATH 上的同名二进制可能是旧版本。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Rust FAF,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

rust-faf-mcp

Persistent Project Context for Rust MCP clients. Native. Fast. cargo install

⭐ Star it on GitHub: bookmarks it for you, helps other devs find it too.

The Your-Files-Stay-Yours Edition (v0.9.0) — one.faf/rust-faf-mcp · rmcp 3.0.1 (MCP Tier 1 foundation) · faf-rust-sdk 3.1.1 (the same always-33 kernel faf-wasm-sdk uses) · solid cargo-native Rust MCP for Rust devs

v0.9.0 — faf_sync keeps your hand-written CLAUDE.md, refuses what it can't write safely, and says so. See CHANGELOG.

FAF defines. AGENTS.md instructs. AI codes.

Stop re-explaining your project to every AI session. One .faf file holds your persistent project context. Every AI reads it once and knows what you're building.

[Crates.io] [FAF Trophy 100%] [Tests] [IANA] [License] [Business card · Get yours →]

Rust-native MCP (Model Context Protocol) server for FAF — structured AI project context in YAML (application/vnd.faf+yaml). Single binary, stdio transport, 4.3 MB stripped. Built on rmcp and faf-rust-sdk.

Quickstart

bash
# Rust toolchain (install):cargo install rust-faf-mcp --version 0.9.0
# No Rust (try — downloads GH Release binary for darwin/linux):npx --yes [email protected]

Point an MCP client at the pin. A bare rust-faf-mcp on PATH may be an old Homebrew binary.

bash
# Claude Codeclaude mcp add faf -- npx --yes [email protected]
jsonc
// Cursor, Claude Desktop, Windsurf — any client that reads mcpServers{  "mcpServers": {    "faf": {      "command": "npx",      "args": ["--yes", "[email protected]"]    }  }}

After cargo install rust-faf-mcp --version 0.9.0, "command": "rust-faf-mcp" is the install. Until you have proven that binary, use the npx pin.

No flags, no config files, no network listener. Pure stdio JSON-RPC.

Or via Homebrew (macOS, pre-built). If you already have it, upgrade — an old keg can sit on PATH as rust-faf-mcp:

bash
brew updatebrew install Wolfe-Jam/faf/rust-faf-mcp# already installed:brew upgrade Wolfe-Jam/faf/rust-faf-mcp

One command, done forever

faf_auto runs setup if project.faf is missing (tree detection writes mechanical facts), then syncs CLAUDE.md. It does not rewrite an existing file. Confirm setup (sweeps) lists what setup occupied — walk it; not a second write-gate. Empty human slots stay empty until you state them.

faf_auto complete━━━━━━━━━━━━━━━━━Score: 0% → 42% (+42) ● GREENSteps:  1. Setup — created project.faf  2. Created CLAUDE.md
Path: /home/user/my-project
Confirm setup (sweeps)Walk these. Detection is already a fact. Not a second write-gate.  project.name           my-api  project.main_language  Rust  stack.backend          Rust

What it produces:

yaml
# project.faf — your project, machine-readablefaf_version: "3.3"project:  name: my-api  goal: REST API for user management  main_language: Rust  version: "0.1.0"  license: MITinstant_context:  what_building: REST API for user management  tech_stack: Rust 2024  key_files:    - Cargo.toml    - src/main.rs    - README.md  commands:    build: cargo build    test: cargo teststack:  backend: Rust  build: cargo

Every AI agent reads this once and knows exactly what you're building. No 20-minute onboarding. No wrong assumptions.

Tools

Create & Detect

ToolWhat it does
faf_autoSetup if missing, sync CLAUDE.md, score — Confirm setup (sweeps); does not invent 6Ws
faf_initSetup: first write from the tree. Refuses if the file exists. Confirm setup (sweeps). 6Ws stay empty
faf_goTable-of-8 + Confirm setup (sweeps). 6Ws score after ☑. Below 100: add Human Context. After 100: courtesy check every 30 days (90 max)
faf_gitAuthor project.faf from any GitHub repo URL — no clone needed. Uses the public GitHub API; returns the text, writes nothing
faf_discoverWalk up the directory tree to find the nearest project.faf

Score & Validate

ToolWhat it does
faf_scoreScore AI-readiness 0-100% with field-level breakdown
faf_syncSync project.faf → CLAUDE.md (preserves existing content)
faf_agentsAuthor AGENTS.md from project.faf (non-destructive, preserves hand-written content)

Optimize

ToolWhat it does
faf_readParse and display project.faf contents
faf_compressCompress .faf for token-limited contexts (minimal / standard / full)
faf_tokensEstimate token count at each compression level

Lineage

ToolWhat it does
faf_dnaYour FAF DNA journey from .faf-dna: Birth DNA to now, with history. faf_init births it, faf_auto records growth — the same file as faf-cli

Every tool declares MCP annotations: faf_read, faf_score, faf_compress, faf_discover, faf_tokens, faf_dna and faf_git are read-only; the writers are non-destructive; only faf_git reaches the network.

faf_init will not overwrite an existing file. Setup occupies mechanical facts; Confirm setup (sweeps) is the walk. Empty human slots stay empty until faf_go.

Architecture

src/├── main.rs      # ~20 lines — tokio entry, rmcp stdio transport├── server.rs    # FafServer: #[tool_router], ServerHandler, resources└── tools.rs     # Business logic — tools as pure functions returning Value
  • Runtime: tokio single-threaded (current_thread)
  • HTTP: reqwest async (only used by faf_git for GitHub API)
  • SDK: faf-rust-sdk 3.1 (Cargo pin — the facade over faf-kernel/faf-fafb in faf-rust; score() for the always-33 number, validate() for structural checks only)
  • Server: rmcp 3.0.1 with #[tool_router] / #[tool_handler] — JSON-RPC, JSON Schema from the param types, stdio transport (Tier-1 assessed SDK cut)

Tools return serde_json::Value. The server adapts them to Result<String, String> for rmcp's IntoCallToolResult.

Testing

223 tests (152 integration + 71 unit):

bash
cargo test    # runs all 223
# Full ship bar (same gates as GitHub CI — run before push)bash scripts/ci.sh# Optional: block push on red CI twinbash scripts/install-hooks.sh
FileTestsCoverage
mcp_protocol.rs11Init handshake, tools/list, tool annotations, resources, schema validation, ID preservation
tools_functional.rs37Tools — happy path, error paths, language detection, faf_go
tier1_security.rs12Path traversal, null bytes, shell injection, oversized input, malformed JSON
tier2_engine.rs37Corrupt YAML, sync replacement, pipelines, dual manifests, legacy filenames, direct paths
tier3_edge_cases.rs10Unicode, CJK, score boundaries, unknown fields, GitHub URL parsing
tier4_aero.rs22Manifest structure, version sync, server.json, context block, manifest-server cross-validation
wjttc_setup.rs16Setup / Confirm setup (sweeps) — BRAKE · ENGINE · AERO · TYRE · PIT
wjttc_faf_dna.rs7.faf-dna lineage — faf_init birth, faf_auto growth, faf_dna, faf-cli's lines
src unit71setup sweep, skills digest, agents::, inject::, intent, app-type, dna:: lineage + faf-cli fixtures

Tests spawn the compiled binary as a subprocess and communicate via stdin/stdout JSON-RPC — true integration tests against the real server.

FAF Ecosystem

One format, every AI platform.

PackagePlatformRegistry
rust-faf-mcpRustcrates.io
claude-faf-mcpAnthropicnpm + MCP #2759
gemini-faf-mcpGooglePyPI
grok-faf-mcpxAInpm
faf-cliUniversalnpm

Build from source

bash
git clone https://github.com/Wolfe-Jam/rust-faf-mcpcd rust-faf-mcpcargo build --release# Binary at target/release/rust-faf-mcp (about 5 MB)

Edition: 2024 | LTO: enabled | Strip: symbols

If rust-faf-mcp has been useful, consider starring the repo — it helps others find it.

Links

Citation

If you use rust-faf-mcp or the .faf / .fafa formats in research or production, please cite the format papers:

Wolfe, J. (2025). Format-Driven AI Context Architecture: The .faf Standard for Persistent Project Understanding. Zenodo. https://doi.org/10.5281/zenodo.18251362

Wolfe, J. (2026). Why Agents Need a Passport: .fafa — Portable Identity for the Agentic Era. Zenodo. https://doi.org/10.5281/zenodo.21951641

License

MIT


Built by @wolfe_jam | wolfejam.dev

来源:README.md,提交 1f4f8a7

工具

12

faf_agents

Author AGENTS.md from project.faf. Non-destructive: preserves any hand-written content outside the faf-managed block.

输入参数path

faf_auto

Setup if missing, sync CLAUDE.md, score. Existing project.faf unchanged. Returns Confirm setup (sweeps). Does not invent 6Ws. Use faf_go for the human card.

输入参数path

faf_compress

Compress project.faf for token-limited contexts. Levels: minimal (names only), standard (names + goals), full (everything minus extras).

输入参数pathlevel

faf_discover

Find the nearest project.faf by walking up the directory tree from the given path.

输入参数path

faf_dna

Show your FAF DNA journey from .faf-dna: Birth DNA to now (e.g. 22% → 85% → 99%), with history. Reads only; faf_init births the lineage, faf_auto records growth.

输入参数path

faf_git

Author a project.faf from a GitHub repository URL. Fetches repo metadata and creates AI context instantly. Calls the public GitHub API (no auth). Returns the project.faf text; writes nothing.

输入参数url必填

faf_go

Table-of-8 plus Confirm setup (sweeps). 6Ws need ☑ to score. Suggestions from the goal (beats only) are not typed and not scored. Below 100 run this to add Human Context. After 100, courtesy: Time to check your Context.

输入参数pathanswersinterval_days

faf_init

Setup: first write of project.faf from the tree. Will not overwrite. Returns Confirm setup (sweeps). App-type assigns slotignored. Human 6Ws stay empty. Use faf_go to state them.

输入参数path

faf_read

Read and display the project.faf file contents with parsed structure.

输入参数path

faf_score

Score the AI-readiness of a project.faf file (0-100%). Shows breakdown and suggestions.

输入参数path

faf_sync

Write CLAUDE.md from project.faf. Updates faf's own section and keeps everything else in the file.

输入参数path

faf_tokens

Estimate token count for project.faf at each compression level. Shows minimal/standard/full token counts.

输入参数path

版本历史

4
  1. v0.9.0最新Nov 6, 2026
  2. v0.8.3Oct 7, 2026
  3. v0.8.1Sep 21, 2026
  4. v0.8.0Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Rust 集成