.faf for Grok - First MCP Server Built for xAI

平台与服务

by wolfe-jam

面向 Grok/xAI 的首个 MCP 服务器,支持基于 URL 的访问,并提供 17 个工具用于 .faf 项目上下文。

什么是 .faf for Grok - First MCP Server Built for xAI

面向 Grok/xAI 的首个 MCP 服务器,支持基于 URL 的访问,并提供 17 个工具用于 .faf 项目上下文。

README

<!-- faf: grok-faf-mcp | TypeScript | mcp-server | First MCP server for Grok — URL-based AI context, FAST⚡️AF --> <!-- faf: doc=readme | canonical=project.faf | score=100 | family=FAF -->

grok-faf-mcp — FAST⚡️AF Edition

<div align="center"> <img src="https://www.faf.one/orange-smiley.svg" alt="FAF" width="80" /> <h3>Grok asked for MCP on a URL. This is it.</h3> <p><strong>Persistent Project Context for xAI Grok.</strong></p> <p><code>URL-based • Zero config • Just works</code></p>

IANA: vnd.faf+yaml DOI: Context paper

</div>

Home: faf.one/grok Live demo: grok.faf.one

grok-faf-mcp hero

<div align="center">

npm version smithery badge FAF Trophy 100% CI License: MIT project.faf Chat to FAFA live

</div>

Stars Downloads

FAF defines. MD instructs. AI codes.

First v0.2-conformant reader of the FAF Context Ingestion Contract — the open standard co-authored in public with @grok.


Install — one line

Add to ~/.grok/config.toml:

toml
[mcp_servers.grok-faf-mcp]
url = "https://mcpaas.live/grok/mcp/v1"

Restart Grok TUI (or /mcps r) to refresh. Tools: faf_score, faf_validate, faf_get_tier, faf_estimate_tokens, faf_analyze (plus soul/memory ops).

Smithery: wolfe-jam/grok-faf-mcp — gateway at https://grok-faf-mcp--wolfe-jam.run.tools

Homebrew (local stdio):

bash
brew install wolfe-jam/faf/grok-faf-mcp

Hosted on Cloudflare Workers — sub-ms cold start, no subprocess, edge-served. 4865-byte Zig WASM engine, parity-tested vs the Rust authority (xai-faf-rust). Externally validated by Grok S1 + S2 on 2026-05-27.

Verify the live contract:

bash
curl https://mcpaas.live/grok/mcp/v1/info

Returns endpoint, protocol versions, engine details, tool list, and the architecture line: .faf=vROM | AI-in-session=RAM.

Sample corpus: xai-faf-proof/pilot — 10 records ready to score.


The 6 Ws - Quick Reference

Every README should answer these questions. Here's ours:

QuestionAnswer
WHO is this for?Grok/xAI developers and teams building with URL-based MCP
WHAT is it?Persistent project context for xAI Grok — URL-first deployment, IANA-registered .faf format
WHERE does it work?Cloudflare Workers (mcpaas.live/grok/mcp/v1) • Any MCP client supporting native url= config • Self-deploy to your own CF/Vercel worker
WHY do you need it?Zero-config MCP on a URL — Grok asked for it, we built it first
WHEN should you use it?Grok integration, xAI projects, any url-based MCP client
HOW does it work?url = "https://mcpaas.live/grok/mcp/v1" — context tools served from edge via MCPaaS (sub-ms cold start, no subprocess)

For AI: Read the detailed sections below for full context. For humans: Use this pattern in YOUR README. Answer these 6 questions clearly.

For the xAI / Grok Build team

Built for Grok and shaped by direct Grok feedback.
Open for native Grok Build integration, .fafm memory layer, refresh_faf primitives, or any other context features the team needs.
Live and dogfooded at https://grok.faf.one and https://mcpaas.live/grok/mcp/v1.

Context for Grok agents: faf-cli authors what Grok agents read from real project detection — bunx faf export --agents. The existing src/interop/grok.ts wires FAF MCP into .grok/config.toml. See FAF-CLI for Grok & xAI agents 👀.


The Problem

Every Grok session starts from zero. You re-explain your stack, your goals, your architecture. Every time.

.faf fixes that. One file, your project DNA, persistent across every session.

code
Without .faf  →  "I'm building a REST API in Rust with Axum and PostgreSQL..."
With .faf     →  Grok already knows. Every session. Forever.

One Command, Done Forever

faf_auto detects your project, creates a .faf, and scores it — in one shot:

code
faf_auto
━━━━━━━━━━━━━━━━━
Score: 0% → 85% (+85) ◇ BRONZE
Steps:
  1. Created project.faf
  2. Detected stack from package.json
  3. Synced CLAUDE.md

Path: /home/user/my-project

What it produces:

yaml
# project.faf — your project, machine-readable
faf_version: "3.3"
project:
  name: my-api
  goal: REST API for user management
  main_language: TypeScript
stack:
  backend: Express
  database: PostgreSQL
  testing: Jest
  runtime: Node.js
human_context:
  who: Backend developers
  what: User CRUD with auth
  why: Replace legacy PHP service

Every AI agent reads this once and knows exactly what you're building.


⚡ What You Get

code
URL:     https://mcpaas.live/grok/mcp/v1
Format:  IANA-registered .faf (application/vnd.faf+yaml)
Tools:   12 core by default (bunx) — re-grounding (refresh_faf/fafm/blend), LAZY-RAG, orchestration substrate, FAF essentials · extended utilities via FAF_TOOLS=all · 14 hosted (WASM-pure) on the URL
Engine:  Mk4 WASM scoring (faf-scoring-kernel)
Speed:   0.5ms average (was 19ms — 3,800% faster with Mk4)
Tests: 27 .ts files (~518 test declarations) — WJTTC parity (heavy local ↔ light hosted) + full suites. Runner: sh scripts/run-tests.sh (bun + flake retry)
Status:  FAST⚡️AF

MCP on a URL. Point your Grok integration at the URL. That's it.


Scoring: From Blind to Optimized

TierScoreWhat it means
🏆 TROPHY100%Gold Code — AI is optimized
★ GOLD99%+Near-perfect context
◆ SILVER95%+Excellent
◇ BRONZE85%+Strong baseline
GREEN70%+Solid foundation
● YELLOW55%+AI flipping coins
○ RED<55%AI working blind
♡ WHITE0%Start — good luck

At 55%, Grok guesses half the time. At 100%, Grok knows your project.


Two Ways to Deploy

1. Hosted (zero install — recommended)

Point your MCP client at the production URL — edge-served on Cloudflare Workers, no subprocess, sub-ms cold start. WASM-pure tools only on this path (scoring, validation, refresh_faf).

json
{
  "mcpServers": {
    "grok-faf": {
      "url": "https://mcpaas.live/grok/mcp/v1"
    }
  }
}

2. Local (stdio — for FS-touching workflows)

Use the local stdio path when you need filesystem access (faf_init, faf_sync, file-mutating tools):

bash
brew install wolfe-jam/faf/grok-faf-mcp   # macOS tap
# or
bunx grok-faf-mcp

Or via MCP config:

json
{
  "mcpServers": {
    "grok-faf": {
      "command": "bunx",
      "args": ["grok-faf-mcp"]
    }
  }
}

MCP Tools

Create & Detect

ToolPurpose
faf_initCreate project.faf from your project
faf_autoAuto-detect stack and populate context
faf_scoreAI-readiness score (0-100%) with breakdown
faf_statusCheck current AI-readability
faf_enhanceIntelligent enhancement
refresh_fafRe-ground on the live .faf — re-read + re-score, report drift, return fresh DNA (drift → refresh → re-grounded). Requested by Grok.

Drift & Orchestration (1.5 — the prestige release)

ToolPurpose
refresh_fafmRe-ground on the live .fafm memory layer for one or more souls. Returns a stamped delta (added/updated facts) by default; verbatim: true for full content. Read-only · always stamped. Sister to refresh_faf for the RAM/memory layer in the vROM/RAM model. Built for Grok, by request.
refresh_blendThe baked-in two-intensity refresh (Cmd+R / Cmd+Shift+R analog). mode: "blend" (default) fires refresh_faf (light) + refresh_fafm (delta); mode: "nuke" fires both at hard intensity. Blend is BAKED IN, NOT a dial — both layers always fire; mode only affects fafm intensity.
faf_orchestrate_recommendationThe heavy orchestrator. Reads current substrate state, composes the full 1.5 library substrate (drift detection · CheckID · repeat-offender · take-a-hint · refresh history), returns a structured Recommendation with recommend, severity, summary, reason, and a rich hints object including effective_policy (the tier in force). Advisory only — never auto-fires (subordinate-not-daemon). Writes a recommendation receipt on every call (no silent decisions). Spec source: Grok-1 FAF-DRIFT-DETECTION-SPEC §9.5 + Appendix C.
faf_get_orchestration_policyPure introspection of the effective policy WITHOUT running the orchestrator. Returns { tier, thresholds, source, overrides_applied } — what aggressiveness tier the next orchestration call would use, and whether it came from defaults or a .faf:orchestration: override. No drift detection · no signals · no receipt write — the quietest tool in the 1.5 substrate. Useful for debugging unexpected orchestrator behavior, pre-flight checks before bulk operations, and override-took-effect verification.

Sync & Persist

ToolPurpose
faf_syncSync .faf → CLAUDE.md
faf_bi_syncBi-directional .faf ↔ platform context
faf_trustValidate .faf integrity

Read & Write

ToolPurpose
faf_readRead any file
faf_writeWrite any file
faf_listDiscover projects with .faf files

RAG & Grok-Exclusive

ToolPurpose
rag_queryRAG-powered context retrieval
rag_cache_statsRAG cache statistics
rag_cache_clearClear RAG cache
grok_go_fast_afAuto-load .faf context for Grok

Plus 34 advanced tools available with FAF_SHOW_ADVANCED=true.


Performance

code
Execution:    0.5ms average (97% faster than v1.1)
Fastest:      3,360ns (version — nanosecond territory)
Slowest:      1.3ms (score — Mk4 WASM)
Improvement:  19ms → 0.5ms (3,800% faster)
Engine:       Mk4 WASM via faf-scoring-kernel
Memory:       Zero leaks
Transport:    stdio (local, bunx) · Streamable HTTP (hosted, Cloudflare Workers)

Benchmarked 10x per tool, warmed up, on local stdio execution. Hosted edge adds sub-ms cold start on top.

Orchestrator (faf_orchestrate_recommendation) characteristics: composition call — reads up to 6 files (.faf, .fafm, package.json, CHANGELOG.md, README.md, plus all 3 receipt logs), runs 2 analyzers (detectFafmDrift + checkId), evaluates the decision table, writes 1 receipt. Expected latency: tens of ms on warm cache; higher under cold-disk or very large .fafm corpora. Designed for occasional agent-initiated calls, not per-turn polling. detectFafmDrift is O(n²) in fact count (cross-fact n-gram recurrence) — comfortable up to ~hundreds of facts.


Architecture

code
grok-faf-mcp
├── src/
│   ├── server.ts             → MCP server (GrokFafMcpServer)
│   ├── handlers/
│   │   ├── championship-tools.ts  → 55+ tool definitions
│   │   ├── tool-registry.ts       → Visibility filtering (core/advanced)
│   │   └── engine-adapter.ts      → FAF engine bridge
│   ├── faf-core/compiler/faf-compiler.ts → Mk4 WASM scoring + Mk3.1 fallback
│   ├── types/                     → Canonical type substrate (1.5)
│   │   ├── drift-signals.ts       → DriftSignal · Contradiction · RepeatOffender
│   │   ├── refresh.ts             → RefreshMode
│   │   ├── escalation.ts          → EscalationLevel
│   │   ├── recommendation.ts      → RecommendationAction
│   │   └── receipts.ts            → ReceiptMetadata
│   ├── detection/fafm-drift.ts    → detectFafmDrift() — repetition-rate gauge
│   ├── integrity/check-id.ts      → checkId() — cross-stamp contradiction check
│   ├── orchestrator/
│   │   ├── repeat-offender.ts     → RepeatOffenderTracker
│   │   ├── take-a-hint.ts         → evaluateTakeAHint() — escalation ladder
│   │   ├── refresh-blend.ts       → runRefreshBlend()
│   │   └── recommendation.ts      → analyzeAndRecommend() + orchestrate()
│   └── telemetry/
│       ├── refresh-receipts.ts        → RefreshReceiptsLog
│       └── recommendation-receipts.ts → RecommendationReceiptsLog
├── smithery.yaml             → Smithery listing config
├── api/index.ts              → Vercel catch-site (legacy showcase surface; kept alive)
└── vercel.json               → Vercel routing for the catch-site

Production deployment: Cloudflare Workers via mcpaas-cf (serving mcpaas.live/grok/mcp/v1). The api/index.ts + vercel.json paths above stay alive as a catch-site for legacy/bookmarked links — they are no longer the production path.

Scoring pipeline: TypeScript compiler parses .faf → detects project type → The Bouncer injects slotignored for inapplicable slots → faf-scoring-kernel (WASM) scores → falls back to Mk3.1 if kernel unavailable.


Testing

27 test files (~518 test declarations) — WJTTC parity (heavy local ↔ light hosted) + full suites (recent runs green on CI):

bash
sh scripts/run-tests.sh
SuiteCoverage
desktop-native-validationCore native functions, security, performance
mcp-conformanceMCP protocol conformance — tools, transport, errors
wjttc-mcpWJTTC MCP certification
wjttc-bunWJTTC bun-migration + integrity
wjttc-compiler-scoringCompiler scoring — engine, type detection, slots
rag-systemRAG query, caching, context retrieval
securityInput validation + security guards
visibilityTool visibility (core/advanced filtering)

Status & known limitations (v1.9)

v1.9.0 — The ZEPH Default Edition — the proven-fast Zig→WASM scoring path behind refresh_faf is now default-ON (same score, cheaper to compute; parity proven byte-identical — CI gate + 91/91 live). Kill switch USE_ZEPH=0 forces the canonical scorer. No tool-surface change; FRC tools stay opt-in behind USE_FRC. Everything below still applies; operating it honestly means surfacing what's NOT in here alongside what is.

Earlier: v1.8.0 — The Closed-Loop Edition — observability writes, token math is honest, FRC contract locked. The drift→refresh→re-ground loop can finally be measured. Earlier: v1.7.0 — The Grounded Memory Edition — ZEPH + the FRC layer over Grok Collections (faf_gate/faf_section/faf_memory), opt-in via USE_FRC/USE_ZEPH; 12-tool core unchanged. Earlier: v1.6.0 — The ZEPH Edition — the ZEPH fast path for re-grounding (refresh_faf/refresh_blend via Zig→WASM cascade.wasm, ~12µs, USE_ZEPH=1; faf-cli stays canonical, parity locked in CI).

What is fully supported:

  • WASM-pure tools on the hosted endpoint (https://mcpaas.live/grok/mcp/v1 and client-specific routes) — scoring · validation · refresh_faf.
  • refresh_faf and refresh_fafm as explicit, callable re-grounding primitives.
  • refresh_blend as the baked-in two-intensity refresh (Cmd+R / Cmd+Shift+R analog).
  • faf_orchestrate_recommendation — the heavy orchestrator that composes drift signals, recurrence, receipts, and take-a-hint into an advisory recommendation.
  • faf_get_orchestration_policy — pure introspection of the effective policy without running the orchestrator (no drift detection, no receipt write — the quietest tool in the substrate).
  • Full policy visibility (effective_policy) returned on every orchestration call AND surfaced standalone via faf_get_orchestration_policy.

Current limitations:

  • faf_orchestrate_recommendation, faf_get_orchestration_policy, refresh_fafm, and refresh_blend require filesystem access and are only available via the local stdio path (bunx grok-faf-mcp / npx grok-faf-mcp). They are not exposed on the hosted WASM-pure endpoint. The hosted path serves the existing WASM-pure subset only (refresh_faf + scoring + validation).
  • Receipt storage — cwd-relative JSON, pull-discoverable. Three append-only JSON files live at the repo root with stable schemas:
    code
    .faf-drift-index.json              ← RepeatOffenderTracker — per-slot recurrence counts
    .faf-refresh-receipts.json         ← RefreshReceiptsLog    — every refresh fire
    .faf-recommendation-receipts.json  ← RecommendationReceiptsLog — every orchestrator call
    
    Pull-discoverable by external tools (TAF, custom indexers, observability dashboards) — read on your own schedule, no callback/push API required. Promotion to a dedicated orphan branch (mirroring the TAF pattern) is documented but deferred per ship discipline; the cwd-relative JSON is the v1 bootstrap.
  • No multi-process file lock on the receipt logs. Within a process, the JS event loop serializes writes. Multi-agent concurrent writes can race; future task.
  • Aggressiveness tier hook.faf:orchestration:tier reads 'conservative' (default — quietest, no noisy first-impression) · 'balanced' · 'aggressive'. active_tier always surfaced in hints.effective_policy for observability, and standalone via faf_get_orchestration_policy. The policy WRITER (faf_set_orchestration_policy) and scheduling (faf_schedule_heavy_re_ground) are not included in v1.5 — edit .faf:orchestration:tier: directly to override.
  • No ack mechanism yet for recommendation receipts. acknowledged: false by default, never auto-flipped. Take-a-hint's ladder-reset semantics fire only on explicit ack — conservative by intent. Future task: explicit ack tool OR derived-from-subsequent-refresh-receipt timing.
  • Outcome tracking ("did this recommendation actually help?") — needs a learning layer beyond 1.5 scope.

The honest split is intentional: hosted = fast, auditable, WASM-pure; local = full capability including filesystem. We will expand the hosted surface only where it can be done safely and without compromising the model.

Subordinate-not-daemon throughout. The orchestrator NEVER auto-fires the recommended tool. Agents surface the recommendation; the user (or higher agent) decides whether to act. Even severity: 'block' is advisory.

See the public verifier and curl https://mcpaas.live/grok/mcp/v1/info for the current contract.


Ecosystem

One format, every AI platform.

PackagePlatformRegistry
grok-faf-mcp (this)xAI Groknpm + Homebrew
claude-faf-mcpAnthropicnpm + MCP #2759
gemini-faf-mcpGooglePyPI
rust-faf-mcpRustcrates.io
faf-mcpCursor, IDE's, VS Codenpm
faf-cliTerminal CLIbunx, npm + Homebrew

Same project.faf. Same scoring. Same result. Different execution layer.


Voice variant — grok-faf-voice (VML)

.fafm 🐘🎙️ — the voice variant of the .faf 🐘 family.

grok-faf-voice is the reference implementation of the Voice Memory Layer (VML) — what your voice agent remembers across sessions, devices, and model switches. Companion to grok-faf-mcp:

  • grok-faf-mcp (this) — .faf Foundational Context Layer for Grok via MCP-on-a-URL.
  • grok-faf-voice.fafm Voice Memory Layer (VML) for Grok Voice via LiveKit + xAI realtime.

Same family. Different surface. Voice swappable; memory permanent.

PyPI · GitHub · Onboarding


For the xAI / Grok Build team

This MCP server was built for Grok and continues to be shaped by direct feedback from Grok itself.

Open for deeper collaboration on:

  • Native Grok Build integration
  • .fafm memory layer
  • refresh_faf primitives inside the Grok TUI / CLI
  • Any other context or orchestration features the team needs

I ship fast, test rigorously, and dogfood everything live on https://grok.faf.one and https://mcpaas.live/grok/mcp/v1.

Happy to:

  • Open PRs
  • Run private dogfood sessions
  • Jump on a call
  • Or just ship whatever moves the needle

Real software only. Just say the word.


Contributing

PR conventions, code style, CI doctrine, MCP-tool contribution path, npm publish discipline, architecture decisions: CONTRIBUTING.md.

xAI / Grok devs welcome — TL;DR setup at the top, F1-inspired tone throughout.


If grok-faf-mcp has been useful, consider starring the repo ⭐️ it helps others find it.

For xAI / Grok Build team

Open for deeper native integration, .fafm memory layer, or Grok Build CLI collaboration.
Happy to ship PRs, dogfood, or jump on a call. Just say the word.


License

MIT — Free and open source


<div align="center"> <p><strong>Built for Grok. Built for Speed. Built Right.</strong></p> <p>FAST⚡️AF • First to Ship • Zero Friction</p> <p><strong>Zero drift. Eternal sync. AI optimized.</strong> 🏆</p> </div>

Get the CLI

faf-cli — The original AI-Context CLI. A must-have for every builder.

bash
npx faf-cli auto

Anthropic MCP #2759 · IANA Registered: application/vnd.faf+yaml · faf.one · npm · Talk to my Agent →

常见问题

.faf for Grok - First MCP Server Built for xAI 是什么?

面向 Grok/xAI 的首个 MCP 服务器,支持基于 URL 的访问,并提供 17 个工具用于 .faf 项目上下文。

相关 Skills

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描164.6k

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描164.6k

接口测试套件

by alirezarezvani

Universal
热门

扫描 Next.js、Express、FastAPI、Django REST 的 API 路由,自动生成覆盖鉴权、参数校验、错误码、分页、上传与限流场景的 Vitest 或 Pytest 测试套件。

帮你把API与集成测试自动化跑顺,减少回归漏测;能力全面,尤其适合复杂接口场景的QA团队。

平台与服务
未扫描23.3k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
89.0k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
79.5k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
71.5k

评论