rust-faf-mcp RMCP
rust-faf-mcp
无需再向每个 AI 会话重复解释你的项目。 一个
.faf文件即可捕获你的项目 DNA。每个 AI 读取一次即可了解你正在构建的内容。
用于 FAF 的 Rust 原生 MCP(模型上下文协议)服务器——以 YAML (application/vnd.faf+yaml) 格式提供结构化的 AI 项目上下文。单一二进制文件,stdio 传输,剥离后仅 4.3 MB。基于 rmcp 和 faf-rust-sdk 构建。
快速入门
cargo install rust-faf-mcp然后将任何 MCP 客户端指向它:
# Claude Code
claude mcp add faf rust-faf-mcp// WARP / Cursor / Zed / Claude Desktop — any stdio MCP client
{
"mcpServers": {
"faf": {
"command": "rust-faf-mcp"
}
}
}无需标志,无需配置文件,无需网络监听。纯 stdio JSON-RPC。
或者通过 Homebrew(macOS,预构建):
brew install Wolfe-Jam/faf/rust-faf-mcpRelated MCP server: gemini-faf-mcp
一条命令,永久搞定
faf_auto 会检测你的项目,创建 .faf 文件,将其增强至最高评分,并同步 CLAUDE.md —— 一步到位:
faf_auto complete
━━━━━━━━━━━━━━━━━
Score: 0% → 85% (+85) 🥈 Silver
Steps:
1. Created project.faf
2. Second enhancement pass
3. Created CLAUDE.md
Path: /home/user/my-project它生成的内容:
# 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 2021
key_files:
- Cargo.toml
- src/main.rs
- README.md
commands:
build: cargo build
test: cargo test
stack:
backend: Rust
build_tool: cargo每个 AI 代理只需读取一次,就能准确了解你正在构建的内容。无需 20 分钟的入职培训,也不会产生错误的假设。
工具
创建与检测
工具 | 功能 |
| 一条命令实现 AI 上下文配置——初始化、增强、同步、评分,完成 |
| 从 |
| 从任何 GitHub 仓库 URL 生成 |
| 向上遍历目录树以查找最近的 |
评分与验证
工具 | 功能 |
| 对 AI 就绪度进行 0-100% 评分,并提供字段级细分 |
| 同步 |
优化
工具 | 功能 |
| 解析并显示 |
| 为 Token 受限的上下文压缩 |
| 估算每个压缩级别的 Token 数量 |
faf_init 是迭代式的——再次运行它,它会填补缺失的内容。每次评分都会提高。
架构
src/
├── main.rs # ~20 lines — tokio entry, rmcp stdio transport
├── server.rs # FafServer: #[tool_router], ServerHandler, resources
└── tools.rs # Business logic — all 9 tools, pure functions returning Value运行时:
tokio单线程 (current_thread)HTTP:
reqwest异步(仅由faf_git用于 GitHub API)SDK:
faf-rust-sdk1.3,用于解析、验证、压缩、发现服务器:
rmcp1.1,带有#[tool_router]宏 —— 处理 JSON-RPC、模式生成、传输
工具返回 serde_json::Value。服务器将其适配为 rmcp 的 IntoCallToolResult 所需的 Result<String, String>。
测试
跨 6 个文件的 112 项测试:
cargo test # runs all 112文件 | 测试数 | 覆盖率 |
| 9 | 初始化握手、工具列表、资源、模式验证、ID 保留 |
| 25 | 全部 9 个工具 —— 正常路径、错误路径、语言检测 |
| 12 | 路径遍历、空字节、Shell 注入、超大输入、格式错误的 JSON |
| 35 | 损坏的 YAML、同步替换、管道、双清单、遗留文件名、直接路径 |
| 10 | Unicode、CJK、评分边界、未知字段、GitHub URL 解析 |
| 21 | 清单结构、版本同步、server.json、清单-服务器交叉验证 |
测试将编译后的二进制文件作为子进程启动,并通过 stdin/stdout JSON-RPC 进行通信 —— 针对真实服务器的真正集成测试。
FAF 生态系统
一种格式,适配所有 AI 平台。
包 | 平台 | 注册表 |
rust-faf-mcp | Rust | crates.io |
Anthropic | npm + MCP #2759 | |
PyPI | ||
xAI | npm | |
通用 | npm |
从源码构建
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)版本: 2021 | LTO: 启用 | Strip: 符号
如果 rust-faf-mcp 对你有帮助,请考虑给仓库加星 —— 这有助于其他人发现它。
链接
faf-rust-sdk — 本项目依赖的解析器
faf.one — FAF 主页
IANA 注册 —
application/vnd.faf+yaml
许可证
MIT
由 @wolfe_jam 构建 | wolfejam.dev
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Related MCP Connectors
Persistent project context for xAI Grok. IANA-registered .faf format.
Persistent project context for Claude. IANA-registered .faf format.
Share one project context across ChatGPT, Claude, Telegram and any MCP client.
- mcpOAuthio.artifacta
Artifact store for AI agents. Hosted OAuth at mcp.artifacta.io/mcp; local stdio via npm/PyPI.
Related MCP Servers
- AlicenseAqualityAmaintenance.FAF (Foundational AI-context Format) with 50+ tools - Only Persistent project context that integrates seamlessly with Claude Desktop workflows. Officially merged (#2759) Anthropic MCP server.1249122MIT
- AlicenseAqualityAmaintenancePersistent project context for Google Gemini. 12 MCP tools for .faf Project DNA — auto-detect your stack, validate, score, and sync across CLAUDE.md, GEMINI.md, and AGENTS.md. Python/FastMCP. IANA-registered format (application/vnd.faf+yaml). 183 tests. One file, every AI platform.122MIT
- AlicenseAqualityAmaintenancePersistent project context MCP server that syncs a single .faf file to all AI tool formats (Cursor, Windsurf, Cline, etc.), enabling eternal bi-sync and optimized context for AI assistants.152386MIT
- AlicenseAqualityCmaintenanceDeterministic dependency + CVE context for AI coding tools, over the Model Context Protocol. A ~0.85 MB pure-Rust MCP server.21MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Wolfe-Jam/rust-faf-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server