# /docs/start/quickstart # Fabric MCP — Alpha Quickstart Five minutes from `npx` to indexing your repo. ## Prerequisites - Node.js 18+ - [Claude Code CLI](https://docs.claude.com/en/docs/claude-code) installed and signed in. ## Install ```bash npx -y @cognisos/fabric-mcp@beta setup ``` The setup command signs you in via your browser and registers Fabric with Claude Code. The `@beta` tag is required. ## Verify Restart Claude Code, then in any project run: ``` /mcp ``` You should see `fabric` listed. ## First workflow In Claude Code: > Use `fabric_index` to index this project. Indexing takes a few seconds for a small repo. The local index lives under `~/.fabric/index/v2/`. If anything looks off, run `npx @cognisos/fabric-mcp@beta doctor`. --- # /docs/fabric-indexer # Fabric Indexer **MCP server that turns any codebase into a typed knowledge graph for AI assistants.** ## What it is `fabric-indexer` is a local-first [Model Context Protocol](https://modelcontextprotocol.io) server that parses your source tree into a typed graph of modules, functions, types, tests, dependencies, contracts, and tech debt. It exposes that graph to any MCP-compatible AI client (Claude Code, Cursor, Codex, Claude Desktop) as structural-query tools. The graph lives in an embedded LMDB store on your machine, persists across sessions, and is incrementally maintained via a file watcher. ## Quickstart ```bash npx @cognisos/fabric-mcp@beta ``` Your AI client launches the server for you. See the integration pages for client-specific config: - [Claude Code](/docs/integrations/claude-code) - [Cursor](/docs/integrations/cursor) Once configured, ask your client to run `fabric_index` on your project, then `fabric_status`. ## What it indexes 13 languages with tree-sitter parsing. Modules, functions, types, interfaces, tests, and dependencies as graph nodes; structural edges (`Contains`, `Imports`, `Tests`, `Implements`, `Extends`, `Exports`) between them. - **Full call-graph resolution** — TypeScript, Python, Go, Rust, Java - **Structural extraction** — C, C++, C#, Ruby, PHP, Swift, Kotlin, Scala - **Regex fallback** — Shell, Lua, R, Perl, and others `fabric_index` respects `.gitignore` and `.fabricignore`. For the full tool surface, see the [MCP reference](/docs/mcp). ## Performance Median **73 K LoC/sec** with **< 70 MB peak RSS**, measured cold-cache against production OSS repos on M-series macOS. ## Status Public beta. Pin to a version tag (`@cognisos/fabric-mcp@`) for production use. See the [changelog](/docs/changelog/fabric-mcp). ## License MIT. --- # /docs/mcp # @cognisos/fabric-mcp Fabric MCP server for Claude Code, Cursor, Windsurf, and any other client that speaks the Model Context Protocol. Builds a local LMDB-backed knowledge graph of your codebase and exposes it as tools. ## Tools - **Code intelligence** (9 tools): `fabric_index`, `fabric_reindex`, `fabric_query`, `fabric_slice`, `fabric_impact`, `fabric_contracts`, `fabric_staleness`, `fabric_recent_changes`, `fabric_explain` — tree-sitter-parsed graph over your codebase. - **Governance & context** (4 tools): `fabric_debt`, `fabric_context_gen`, `fabric_govern`, `fabric_govern_add` — team rules, tech-debt tracking, auto-generated `CLAUDE.md` / `.cursorrules` / `copilot-instructions.md`. - **Cloud sync** (3 tools): `fabric_sync_now`, `fabric_list_snapshots`, `fabric_pull` — LMDB graph backup, listing, and cross-device restore. - **Status** (1 tool): `fabric_status` — indexer health + per-type node/edge counts. ## Install (one command) ```bash npx -y @cognisos/fabric-mcp setup ``` That command opens your browser, signs you in at cognisos.ai, stores an API key in your OS keychain, and registers Fabric as a local stdio MCP in Claude Code. Restart Claude Code, type `/mcp`, and the tools are available. ## How it works - **Indexer tools** spawn a local Rust binary that reads your code, parses it with tree-sitter, and builds a local LMDB knowledge graph at `~/.fabric/index`. Your code never leaves your machine. - **Cloud sync** uploads snapshots of your local store (graph only, no source) to your Fabric account for disaster recovery and cross-device restore. - **API key** is stored in your OS keychain (macOS Keychain, GNOME Keyring, Windows Credential Manager) via `@napi-rs/keyring`. Never written to disk in plaintext. ## Platforms | Platform | Supported | |---|---| | macOS Apple Silicon (darwin-arm64) | ✅ | | macOS Intel (darwin-x64) | ✅ | | Linux x64 | ✅ | | Linux ARM64 | ✅ | | Windows x64 | ✅ | ## Subcommands ```bash npx @cognisos/fabric-mcp # run the MCP server in stdio mode (what Claude Code spawns) npx @cognisos/fabric-mcp setup # one-time install: OAuth + keychain + claude mcp add npx @cognisos/fabric-mcp login # re-auth (opens browser again, updates keychain) npx @cognisos/fabric-mcp logout # wipe keychain entry npx @cognisos/fabric-mcp doctor # environment health check ``` ## Manual install (for CI / headless) If `setup` can't open a browser (SSH, tmux, container): ```bash # 1. Get an API key from https://cognisos.ai/dashboard → Developer # 2. Register the MCP with the key passed as an env var claude mcp add fabric -s user \ -e FABRIC_API_KEY=lim_xxxxxxxxxxxxx \ -- npx -y @cognisos/fabric-mcp ``` ## License Proprietary — © Cognisos, Inc. --- # /docs/mcp/tools ## MCP Tool Reference Fabric exposes the following tools over the Model Context Protocol (MCP). Each tool page includes the full description, input schema, and required fields. | Tool | Description | | ---- | ----------- | | [fabric_context_gen](/docs/mcp/tools/fabric_context_gen) | Auto-generate context files from the indexed knowledge graph. Produces project-aware CLAUDE.md, .cu… | | [fabric_contracts](/docs/mcp/tools/fabric_contracts) | List every exported symbol in the indexed graph, ranked by inbound fan-in (CALLS edge count). Not a… | | [fabric_debt](/docs/mcp/tools/fabric_debt) | Inventory TODO/FIXME/HACK/@deprecated markers with graph context — each debt node surfaces alongsid… | | [fabric_explain](/docs/mcp/tools/fabric_explain) | Full structural summary of a single symbol: name, node type, file, callers, callees, dependencies, … | | [fabric_govern](/docs/mcp/tools/fabric_govern) | Check proposed code against governance rules. Returns compliance status, violations (block/warn), a… | | [fabric_govern_add](/docs/mcp/tools/fabric_govern_add) | Add a governance rule. Rules persist as HOT-tier nodes and are enforced on all future governance ch… | | [fabric_impact](/docs/mcp/tools/fabric_impact) | Call before refactoring to see "what breaks if I change this?" Reverse-walks call, import, test, an… | | [fabric_index](/docs/mcp/tools/fabric_index) | Index a codebase directory. Parses source files with tree-sitter (TypeScript, Python, Go + 200 lang… | | [fabric_list_snapshots](/docs/mcp/tools/fabric_list_snapshots) | List cloud snapshots for a repo. Returns snapshot_id, device_id, size, created_at, sha256 for each.… | | [fabric_pull](/docs/mcp/tools/fabric_pull) | Restore a snapshot from the Fabric cloud into the local LMDB dir. Refuses if target already has dat… | | [fabric_query](/docs/mcp/tools/fabric_query) | Ask "what symbols match this name and what do they connect to?" Matches nodes by name (case-insensi… | | [fabric_recent_changes](/docs/mcp/tools/fabric_recent_changes) | Files sorted by recency — discover what changed most recently without enumerating paths first. Retu… | | [fabric_reindex](/docs/mcp/tools/fabric_reindex) | Call after editing files to keep the graph current without reparsing the whole repo. Accepts absolu… | | [fabric_slice](/docs/mcp/tools/fabric_slice) | Build an LLM-ready context window for a target symbol, bounded by a real token budget (cl100k_base … | | [fabric_staleness](/docs/mcp/tools/fabric_staleness) | Does the indexed state match disk? For each file, compares on-disk mtime against the timestamp capt… | | [fabric_status](/docs/mcp/tools/fabric_status) | Call this first to orient on the local code index: node/edge counts, governance rule count, store s… | | [fabric_sync_now](/docs/mcp/tools/fabric_sync_now) | Upload a snapshot of the local knowledge graph to the Fabric cloud for disaster recovery. Manually … | | [fabric_text_search](/docs/mcp/tools/fabric_text_search) | Graph-aware regex grep. Greps for a pattern across indexed source files (Rust regex / RE2 syntax — … | | [fabric_visualize](/docs/mcp/tools/fabric_visualize) | Open an interactive 3D code graph of the indexed codebase in your default browser. Spins up a local… | --- # /docs/cli   **Package:** `@cognisos/liminal` --- # @cognisos/liminal **Transparent LLM context compression proxy.** Liminal sits between your AI coding tools and the LLM API, compressing context to save tokens, reduce costs, and extend effective context windows — all without changing your workflow. ## Install ```bash npm i @cognisos/liminal ``` ## Quick Start ```bash liminal init # Guided setup — auth, tool detection, config liminal start # Start the compression proxy liminal # Launch the TUI dashboard ``` ## Features - **Zero-config compression** — Routes through Claude Code, Codex, Cursor, and OpenAI-compatible tools automatically - **TUI dashboard** — Run `liminal` to launch a full-screen live dashboard with stats, config, and logs - **Setup wizard** — 5-step guided setup with verification and error recovery - **Stats tracking** — Session and all-time metrics with token savings, context extension, and cost estimates - **Cursor hooks** — Transparent file compression via preToolUse hooks (no sudo, no TLS hacks) - **Multi-session** — Concurrent session management with circuit breakers and graceful degradation - **Zero UI dependencies** — All terminal rendering uses raw ANSI codes ## Commands ``` liminal Launch TUI dashboard liminal init Guided setup wizard liminal start [-d] [--port PORT] Start the compression proxy liminal stop Stop the proxy liminal status Quick health check liminal stats [--json] Compression metrics & savings liminal config [--set k=v] [--get k] View or edit configuration liminal logs [--follow] [--lines N] View proxy logs liminal setup cursor [--teardown] Install Cursor compression hooks liminal login Log in or create an account liminal logout Log out liminal trust-ca Install CA cert (TLS intercept) liminal untrust-ca Remove CA cert liminal uninstall Remove all Liminal configuration ``` ## TUI Dashboard Run `liminal` with no arguments to launch the interactive dashboard: - **Dashboard** — Live daemon health, tool routing status, session metrics, recent activity - **Stats** — Token savings, cost impact, context extension (session + all-time) - **Config** — Current configuration at a glance - **Logs** — Colorized live tail of daemon logs Navigate with arrow keys or Tab. Press `q` to exit. ## How It Works 1. **Proxy** — Liminal runs a local HTTP proxy (default port 3141) 2. **Intercept** — Your AI tool sends API requests through the proxy 3. **Compress** — RSC (Recursive Semiotic Computation) normalizes and compresses the context 4. **Forward** — Compressed request goes to the upstream LLM API 5. **Learn** — Patterns are learned over time to improve compression Supported protocols: Anthropic Messages API, OpenAI Chat Completions, OpenAI Responses API. ## Configuration Config is stored at `~/.liminal/config.json`. Key settings: | Key | Default | Description | |-----|---------|-------------| | `port` | `3141` | Proxy listen port | | `compressionThreshold` | `100` | Min tokens to compress | | `learnFromResponses` | `true` | Learn patterns from LLM responses | | `latencyBudgetMs` | `10000` | Max compression time before fallback | | `enabled` | `true` | Global compression toggle | ## Requirements - Node.js >= 18.0.0 - A Cognisos account (created during `liminal init`) ## License MIT ## Command Reference Commands are listed alphabetically. Each links to a dedicated reference page. | Command | Description | Usage | | ------- | ----------- | ----- | | [byok list](/docs/cli/commands/byok-list) | List providers with a stored key | `liminal byok list [--json]` | | [byok remove](/docs/cli/commands/byok-remove) | Remove a stored provider key | `liminal byok remove ` | | [byok set](/docs/cli/commands/byok-set) | Store a provider API key (stdin only) | `liminal byok set ` | | [config](/docs/cli/commands/config) | View or edit configuration | `liminal config [--set k=v] [--get k]` | | [daemon get-token](/docs/cli/commands/daemon-get-token) | Print the stored auth token | `liminal daemon get-token` | | [daemon inspect](/docs/cli/commands/daemon-inspect) | Diagnostic details (port, pid, binary) | `liminal daemon inspect` | | [daemon logs](/docs/cli/commands/daemon-logs) | View daemon log output | `liminal daemon logs [--follow]` | | [daemon restart](/docs/cli/commands/daemon-restart) | Restart the Fabric daemon | `liminal daemon restart` | | [daemon start](/docs/cli/commands/daemon-start) | Start the Fabric background daemon | `liminal daemon start` | | [daemon status](/docs/cli/commands/daemon-status) | Show daemon status and health | `liminal daemon status [--json]` | | [daemon stop](/docs/cli/commands/daemon-stop) | Stop the Fabric daemon | `liminal daemon stop` | | [init](/docs/cli/commands/init) | Set up Liminal (login, config) | `liminal init` | | [inspect](/docs/cli/commands/inspect) | Inspect pipeline phases for text | `liminal inspect [--json]` | | [install-service](/docs/cli/commands/install-service) | Install as a launchd LaunchAgent (macOS) or systemd user unit (Linux) | `liminal install-service` | | [login](/docs/cli/commands/login) | Log in or create an account | `liminal login` | | [logout](/docs/cli/commands/logout) | Log out of your account | `liminal logout` | | [logs](/docs/cli/commands/logs) | View proxy logs | `liminal logs [--follow] [--lines N]` | | [mcp-stdio](/docs/cli/commands/mcp-stdio) | stdio↔HTTP MCP bridge (used by Codex) | `liminal mcp-stdio` | | [setup claude-code](/docs/cli/commands/setup-claude-code) | Connect Fabric MCP tools to Claude Code | `liminal setup claude-code [--global]` | | [setup codex](/docs/cli/commands/setup-codex) | Connect Fabric MCP tools to Codex CLI | `liminal setup codex [--teardown]` | | [setup cursor](/docs/cli/commands/setup-cursor) | Install file compression hooks for Cursor | `liminal setup cursor [--teardown]` | | [start](/docs/cli/commands/start) | Start the compression proxy | `liminal start [-d] [--port PORT]` | | [stats](/docs/cli/commands/stats) | Compression metrics & savings | `liminal stats [--json]` | | [status](/docs/cli/commands/status) | Show proxy health check | `liminal status [--json]` | | [stop](/docs/cli/commands/stop) | Stop the running proxy | `liminal stop` | | [trust-ca](/docs/cli/commands/trust-ca) | Install CA cert (for TLS intercept) | `liminal trust-ca` | | [uninstall](/docs/cli/commands/uninstall) | Remove Liminal configuration | `liminal uninstall` | | [uninstall-service](/docs/cli/commands/uninstall-service) | Remove the launchd LaunchAgent (macOS) or systemd user unit (Linux) | `liminal uninstall-service [--purge]` | | [untrust-ca](/docs/cli/commands/untrust-ca) | Remove CA cert | `liminal untrust-ca` | --- # /docs/integrations/claude-code # Claude Code Add Fabric to [Claude Code](https://claude.com/claude-code) so the agent has persistent memory and code-graph tools across sessions. ## Prerequisites Node.js 20+, Claude Code 2.x, and a repo you want indexed. ## Install ```bash npx -y @cognisos/fabric-mcp@beta setup ``` The setup wizard registers Fabric in `~/.claude/mcp_settings.json`. ## Verify Restart Claude Code, then run `/mcp` — you should see `fabric` listed as **connected**. ## Try it ```text > Index this repo with fabric_index, then use fabric_explain to tell me what calls `parseDoc`. ``` Claude answers from the local graph — no source upload. ## See also - [Cursor](/docs/integrations/cursor) — same Fabric, different host --- # /docs/integrations/cursor # Cursor Add Fabric MCP to [Cursor](https://cursor.com) so its agent shares the same code-graph and memory layer as Claude Code. ## Prerequisites Node.js 20+, Cursor 0.43+, and a repo you want indexed. ## Configure Add Fabric to `~/.cursor/mcp.json` (global) or `/.cursor/mcp.json` (per project): ```json { "mcpServers": { "fabric": { "command": "npx", "args": ["-y", "@cognisos/fabric-mcp@beta"], "env": { "FABRIC_REPO_ROOT": "${workspaceFolder}" } } } } ``` ## Verify Restart Cursor. Open chat, click the tool icon, and confirm `fabric.*` tools are listed. ```text > @fabric find every reference to `useDocsToc` ``` ## See also - [Claude Code](/docs/integrations/claude-code) — same install, different host --- # /docs/changelog/fabric-mcp # fabric-mcp Changelog All notable changes to `@cognisos/fabric-mcp` are documented here. ## Unreleased - Initial dedicated changelog file. Pre-release history is recorded in the project root `CHANGELOG.md` and in git history of `packages/fabric-mcp`. ## 0.2.0-rc.22 - Latest release-candidate. Full per-rc notes live in the root [Cognisos Changelog](../../CHANGELOG.md). For per-commit detail run: ```bash git log --oneline -- packages/fabric-mcp ```