npm rust-faf-mcpstdioMITupdated 9d ago
Persistent Project Context for Rust MCP clients. Native. Fast. cargo install
What can you do with Rust FAF?
rust-faf-mcp
Persistent Project Context for Rust MCP clients. Native. Fast. cargo install
The AGENTS.md Edition (v0.6.0) โ one.faf/rust-faf-mcp ยท rmcp 3.0.1 (MCP Tier 1 foundation) ยท faf-rust-sdk 3.1 (the same always-33 kernel faf-wasm-sdk uses) ยท solid cargo-native Rust MCP for Rust devs
v0.6.0 โ adds faf_agents, a 10th tool: generates AGENTS.md from project.faf, non-destructively (preserves any hand-written content outside the faf-managed block). Ported line-for-line from faf-cli's generateAgentsMd() โ byte-for-byte parity is deliberate, so this MCP stays backward-compatible with any faf-cli output as it evolves. See CHANGELOG.
FAF defines. MD instructs. AI codes.
Stop re-explaining your project to every AI session. One
.faffile holds your persistent project context. Every AI reads it once and knows what you're building.
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
# Rust toolchain:
cargo install rust-faf-mcp
# No Rust (downloads GH Release binary for darwin/linux x64):
npx rust-faf-mcp
Then point any MCP client at it:
# Claude Code
claude mcp add faf rust-faf-mcp
// WARP / Cursor / Zed / Claude Desktop โ any stdio MCP client
{
"mcpServers": {
"faf": {
"command": "rust-faf-mcp"
}
}
}
No flags, no config files, no network listener. Pure stdio JSON-RPC.
Or via Homebrew (macOS, pre-built):
brew install Wolfe-Jam/faf/rust-faf-mcp
One command, done forever
faf_auto detects your project, creates a .faf, enhances it to max score, and syncs CLAUDE.md โ in one shot:
faf_auto complete
โโโโโโโโโโโโโโโโโ
Score: 0% โ 85% (+85) โ BRONZE
Steps:
1. Created project.faf
2. Second enhancement pass
3. Created CLAUDE.md
Path: /home/user/my-project
What it produces:
# project.faf โ your project, machine-readable
faf_version: "3.3"
project:
name: my-api
goal: REST API for user management
main_language: Rust
version: "0.1.0"
license: MIT
instant_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 test
stack:
backend: Rust
build_tool: cargo
Every AI agent reads this once and knows exactly what you're building. No 20-minute onboarding. No wrong assumptions.
Tools
Create & Detect
| Tool | What it does |
|---|---|
faf_auto |
Zero to AI context in one command โ init, enhance, sync, score, done |
faf_init |
Create or enhance project.faf from Cargo.toml, package.json, pyproject.toml, or go.mod |
faf_git |
Generate project.faf from any GitHub repo URL โ no clone needed |
faf_discover |
Walk up the directory tree to find the nearest project.faf |
Score & Validate
| Tool | What it does |
|---|---|
faf_score |
Score AI-readiness 0-100% with field-level breakdown |
faf_sync |
Sync project.faf โ CLAUDE.md (preserves existing content) |
faf_agents |
Generate AGENTS.md from project.faf (non-destructive, preserves hand-written content) |
Optimize
| Tool | What it does |
|---|---|
faf_read |
Parse and display project.faf contents |
faf_compress |
Compress .faf for token-limited contexts (minimal / standard / full) |
faf_tokens |
Estimate token count at each compression level |
faf_init is iterative โ run it again and it fills in what's missing. Score goes up each time.
Architecture
src/
โโโ main.rs # ~20 lines โ tokio entry, rmcp stdio transport
โโโ server.rs # FafServer: #[tool_router], ServerHandler, resources
โโโ tools.rs # Business logic โ all 10 tools, pure functions returning Value
- Runtime:
tokiosingle-threaded (current_thread) - HTTP:
reqwestasync (only used byfaf_gitfor GitHub API) - SDK:
faf-rust-sdk3.1 (Cargo pin โ the facade overfaf-kernel/faf-fafbin faf-rust;score()for the real Mk4 number,validate()for structural checks only) - Server:
rmcp3.0.1 with#[tool_router]/#[tool_handler]โ JSON-RPC, schema generation, 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
133 tests (117 integration + 16 unit):
cargo test # runs all 133
# Full ship bar (same gates as GitHub CI โ run before push)
bash scripts/ci.sh
# Optional: block push on red CI twin
bash scripts/install-hooks.sh
| File | Tests | Coverage |
|---|---|---|
mcp_protocol.rs |
9 | Init handshake, tools/list, resources, schema validation, ID preservation |
tools_functional.rs |
28 | All 10 tools โ happy path, error paths, language detection |
tier1_security.rs |
12 | Path traversal, null bytes, shell injection, oversized input, malformed JSON |
tier2_engine.rs |
36 | Corrupt YAML, sync replacement, pipelines, dual manifests, legacy filenames, direct paths |
tier3_edge_cases.rs |
10 | Unicode, CJK, score boundaries, unknown fields, GitHub URL parsing |
tier4_aero.rs |
22 | Manifest structure, version sync, server.json, context block, manifest-server cross-validation |
src unit |
16 | Skills extension digest + scoring resource, agents:: generator (7), inject:: non-destructive write (5) |
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.
| Package | Platform | Registry |
|---|---|---|
| rust-faf-mcp | Rust | crates.io |
| claude-faf-mcp | Anthropic | npm + MCP #2759 |
| gemini-faf-mcp | PyPI | |
| grok-faf-mcp | xAI | npm |
| faf-cli | Universal | npm |
Build from source
git clone https://github.com/Wolfe-Jam/rust-faf-mcp
cd rust-faf-mcp
cargo build --release
# Binary at target/release/rust-faf-mcp (4.3 MB)
Edition: 2024 | LTO: enabled | Strip: symbols
If rust-faf-mcp has been useful, consider starring the repo โ it helps others find it.
Links
- crates.io/crates/rust-faf-mcp
- npmjs.com/package/rust-faf-mcp โ
npx rust-faf-mcp(no Rust toolchain; downloads GH Release binary) - Dual-package publish guide โ cargo + npm (this server is the product example)
- docs/DUAL-PACKAGE.md โ pointer + OIDC docs for this repo
- docs/SKILLS-OVER-MCP.md โ J1 Agent Skill
faf-context(skills/list ยท digests) - faf-rust-sdk โ the parser this depends on
- faf.one โ FAF home
- IANA registration โ
application/vnd.faf+yaml - MCP Registry name:
mcp-name: one.faf/rust-faf-mcp - CHANGELOG
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
Install
Add Rust FAF to your client. Pick the one you use.
claude mcp add rust-faf-mcp -- npx -y rust-faf-mcpcodex mcp add rust-faf-mcp -- npx -y rust-faf-mcpamp mcp add rust-faf-mcp -- npx -y rust-faf-mcp{
"mcpServers": {
"rust-faf-mcp": {
"command": "npx",
"args": [
"-y",
"rust-faf-mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"rust-faf-mcp": {
"command": "npx",
"args": [
"-y",
"rust-faf-mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"rust-faf-mcp","command":"npx","args":["-y","rust-faf-mcp"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"rust-faf-mcp": {
"command": "npx",
"args": [
"-y",
"rust-faf-mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"rust-faf-mcp": {
"command": "npx",
"args": [
"-y",
"rust-faf-mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"rust-faf-mcp": {
"command": "npx",
"args": [
"-y",
"rust-faf-mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"rust-faf-mcp": {
"type": "local",
"command": "npx",
"args": [
"-y",
"rust-faf-mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"rust-faf-mcp": {
"command": {
"path": "npx",
"args": [
"-y",
"rust-faf-mcp"
]
}
}
}
}Add to your Zed `settings.json`.
npx -y rust-faf-mcpRun `goose configure`, choose **Add Extension โ Command-line Extension**, and paste this command.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance25/25
- Trust13/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 2 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint โ no local install
Version history
| Versions | Published |
|---|---|
| 0.6.0Latest | Aug 27, 2026 |
| 0.5.1 | Aug 26, 2026 |
| 0.5.0 | Aug 26, 2026 |
| 0.4.3 | Aug 20, 2026 |
| 0.4.2 | Aug 19, 2026 |
| 0.4.1 | Aug 8, 2026 |
| 0.4.0 | Jul 18, 2026 |