Persistent Project Context for xAI Grok
Persistent project context for xAI Grok. IANA-registered .faf format.
我該用這個嗎
品質與安全性
發現項目(2)
- LOW在 faf_get_tier 中
- LOW在 refresh_faf 中
根據工具定義與協定合規性的自動化分析。
上下文成本
這是每次將伺服器的工具載入模型上下文時所消耗的約略 token 數量。數量越高,可用於其他工作的注意力就越少。
安裝
一鍵安裝
將以下內容加入你的 `claude_desktop_config.json` 檔案:
{
"mcpServers": {
"grok-faf-mcp": {
"command": "npx",
"args": [
"grok-faf-mcp"
]
}
}
}可執行的套件
1.8.1stdio遠端端點
https://grok-faf-mcp.vercel.app/ssessehttps://mcpaas.live/grok/mcp/v1streamable-http它能做什麼
工具清單
工具(19)
🟢get_soul(soul)
Fetch a context soul by name. Returns structured AI context.
輸入結構描述
{
"type": "object",
"properties": {
"soul": {
"type": "string",
"description": "Soul identifier (e.g., \"spacex\", \"wolfe\", \"grok\")"
}
},
"required": [
"soul"
]
}🟢list_souls
List all available context souls.
輸入結構描述
{
"type": "object",
"properties": {}
}🟢delta_check(topic)
Determine if a topic needs FULL, DELTA, or X-DELTA soul.
輸入結構描述
{
"type": "object",
"properties": {
"topic": {
"type": "string",
"description": "Topic to check"
}
},
"required": [
"topic"
]
}🟢list_tags(soul)
List all unique tags used in a soul, with counts.
輸入結構描述
{
"type": "object",
"properties": {
"soul": {
"type": "string",
"description": "Soul identifier"
}
},
"required": [
"soul"
]
}🟢search_by_tag(soul, tag)
Find all entries in a soul with a specific tag.
輸入結構描述
{
"type": "object",
"properties": {
"soul": {
"type": "string",
"description": "Soul identifier"
},
"tag": {
"type": "string",
"description": "Tag to search for"
}
},
"required": [
"soul",
"tag"
]
}🟢search_context(query, soul)
Full-text search across souls. Returns matching lines only (token-efficient).
輸入結構描述
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Text to search for"
},
"soul": {
"type": "string",
"description": "Specific soul (optional, searches all if omitted)"
}
},
"required": [
"query"
]
}🟢tag_intel(handle)
Discover tag patterns, co-occurrence, candidates, and merge suggestions across all namepoints. Optionally suggest tags for a specific handle.
輸入結構描述
{
"type": "object",
"properties": {
"handle": {
"type": "string",
"description": "Optional: suggest tags for this specific namepoint"
}
}
}🟢generate_faf_from_github(repo)
Generate a .faf file from any public GitHub repository WITHOUT cloning. Extracts 6 Ws from README, analyzes stack from languages and package.json, and generates Championship-grade AI context. Returns .faf content, quality score, and metadata.
輸入結構描述
{
"type": "object",
"properties": {
"repo": {
"type": "string",
"description": "GitHub repository URL or owner/repo format (e.g., \"facebook/react\" or \"https://github.com/facebook/react\")"
}
},
"required": [
"repo"
]
}🟢faf_score(content)
Score .faf YAML content with the always-33 faf-kernel (WASM). Returns 0-100 (capped). The same score faf-cli and every FAF MCP give. Runs at the edge.
輸入結構描述
{
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "Raw .faf YAML content. Souls with a [faf] section have it extracted automatically."
}
},
"required": [
"content"
]
}🟢faf_validate(content)
Validate .faf YAML content: true if mission-ready (always-33 score of 100).
輸入結構描述
{
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "Raw .faf YAML content to validate."
}
},
"required": [
"content"
]
}🟢faf_get_tier(score)
Resolve the FAF tier for a given numeric score. Returns the tier symbol (Trophy/Gold/Silver/Bronze/etc.) per the canonical tier-table.
輸入結構描述
{
"type": "object",
"properties": {
"score": {
"type": "number",
"description": "Numeric score 0-100."
}
},
"required": [
"score"
]
}🟢faf_estimate_tokens(content)
Estimate token count for arbitrary content via the Zig WASM engine. Sub-millisecond, zero allocations. Useful for context-budget planning.
輸入結構描述
{
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "Content to estimate tokens for."
}
},
"required": [
"content"
]
}🟢faf_analyze(content)
One-call composite — returns score, tier-ready, valid, and engine identifier. Two WASM calls, sub-millisecond total.
輸入結構描述
{
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "Raw .faf YAML content to analyze."
}
},
"required": [
"content"
]
}🟢refresh_faf(content, baseline, verbatim)
Re-ground on .faf content — re-score with the always-33 faf-kernel (33 slots; slotignored slots drop out), report drift vs an optional baseline score, and return a stamped re-ground. The explicit re-grounding primitive for long sessions: drift → refresh → re-grounded. Built for Grok, by request.
輸入結構描述
{
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "Raw .faf YAML content to re-ground on."
},
"baseline": {
"type": "number",
"description": "Optional last-known score (0-100). When provided, the drift delta (current - baseline) is reported."
},
"verbatim": {
"type": "boolean",
"description": "When true, return the full .faf content verbatim with the stamp. Default false (stamped delta + summary)."
}
},
"required": [
"content"
]
}🟢faf_orchestrate_recommendation(faf, fafm, packageJson, changelog, readme)
Takes raw content strings (`.faf`, `.fafm`, and optionally `package.json`/`CHANGELOG.md`/`README.md`) and runs deterministic drift + contradiction signals across the FAF substrate. Returns a structured `Recommendation` (recommend, severity, reason, summary) with `hints` containing the current `effective_policy` and `partial[]` for any stateful signals unavailable on the current surface. Light-lane execution (hosted) is WASM-pure with no filesystem access. Heavy-lane execution (local via bunx/rust-faf-mcp) has full FS + persisted state. Advisory only — never auto-fires.
輸入結構描述
{
"type": "object",
"properties": {
"faf": {
"type": "string",
"description": "Raw .faf YAML content (project DNA). Required for any meaningful analysis."
},
"fafm": {
"type": "string",
"description": "Raw .fafm YAML content (memory layer). Enables drift detection."
},
"packageJson": {
"type": "string",
"description": "Raw package.json content. Enables version cross-stamp checks (.faf vs pkg)."
},
"changelog": {
"type": "string",
"description": "Raw CHANGELOG.md content. Enables changelog cross-stamp checks."
},
"readme": {
"type": "string",
"description": "Raw README.md content. Enables README arch-tree cross-stamp checks."
}
}
}🟢faf_gate(content, min_score, max_tokens)
Phase III (FRC) — pre-promotion quality gate. Scores .faf content (edge Mk4) + estimates tokens and returns a deterministic promote/hold verdict BEFORE it goes to a Grok Collection. Promote IFF score >= min_score AND tokens <= max_tokens (defaults 85/8000). Edge parity with the local gate; the hold-hint can't list empty slots at the edge.
輸入結構描述
{
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "Raw .faf YAML content to gate."
},
"min_score": {
"type": "number",
"description": "Minimum score to promote (default 85)."
},
"max_tokens": {
"type": "number",
"description": "Maximum tokens to promote (default 8000)."
}
},
"required": [
"content"
]
}🟢faf_section(content, section)
Phase III (FRC) — returns an EXACT, WHOLE .faf section by dotted path (e.g. "stack", "human_context"), structure preserved — the deterministic complement to blind chunking. Omit "section" to list every path.
輸入結構描述
{
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "Raw .faf YAML content."
},
"section": {
"type": "string",
"description": "Dotted path to retrieve (e.g. \"stack.backend\"). Omit to list all paths."
}
},
"required": [
"content"
]
}🟢faf_memory(content, type, tag, priority, query)
Phase III (FRC) — query the durable .fafm model by type/tag/priority/text. Omit filters for a structured summary. .fafm is NOT scored: this SELECTS facts (provenance preserved), never grades them.
輸入結構描述
{
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "Raw .fafm YAML content."
},
"type": {
"type": "string",
"description": "Filter by fact type (e.g. \"feedback\")."
},
"tag": {
"type": "string",
"description": "Filter by a tag."
},
"priority": {
"type": "string",
"description": "Filter by priority (e.g. \"critical\")."
},
"query": {
"type": "string",
"description": "Case-insensitive substring match on fact text."
}
},
"required": [
"content"
]
}🟢faf_collections_search(query, collection_id, limit)
Phase III (FRC §7b) — semantic search over a Grok Collection at the edge, KV-cached (1h TTL). Returns matched chunks (content, score, file). Requires the XAI_API_KEY secret; composes with faf_section (structural) for hybrid retrieval. Handled env-aware in the MCP handler (needs the key + KV).
輸入結構描述
{
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "The search query."
},
"collection_id": {
"type": "string",
"description": "The Grok Collection id to search."
},
"limit": {
"type": "number",
"description": "Max chunks to return (default 5)."
}
},
"required": [
"query",
"collection_id"
]
}社群
證據