# Knowledge Fabric

The Knowledge Fabric MCP server for Claude Code retrieves evidence from documents and code. It combines keyword and vector search to surface exact terms alongside related passages.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 8 repo stars
- Author: invarcore
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/invarcore/knowledge-fabric
- Updated: 2026-11-11
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/knowledge-fabric

## What it does

Knowledge Fabric indexes documents and returns retrieved evidence to an agent over MCP. PostgreSQL full-text search works alongside `pgvector` similarity search; RRF combines their results, then cross-encoders rerank them.

The storage layer requires PostgreSQL with `pgvector`. Apache Tika extracts document text, and embeddings come from Ollama, OpenRouter, OpenAI, or Cohere. Tenant separation happens at the application layer by default; PostgreSQL RLS is an optional additional mode.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add knowledge-fabric -- uvx knowledge-fabric
```
uvx runs the command named after the package; if the README names another one, use uvx --from knowledge-fabric <command>

### Codex

**Platform CLI**
```bash
codex mcp add knowledge-fabric -- uvx knowledge-fabric
```
uvx runs the command named after the package; if the README names another one, use uvx --from knowledge-fabric <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "knowledge-fabric": {
            "command": "uvx",
            "args": [
                "knowledge-fabric"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from knowledge-fabric <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "knowledge-fabric": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "knowledge-fabric"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from knowledge-fabric <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add knowledge-fabric uvx knowledge-fabric
```
uvx runs the command named after the package; if the README names another one, use uvx --from knowledge-fabric <command>

## When to use it
- find passages by meaning and exact terms
- combine PostgreSQL text search with vector retrieval
- send retrieved evidence to an agent over MCP
- isolate data between tenants

## Example prompts
- Find the error code in the documents and return the passages that support it.
- Search the documents for evidence matching this question, including exact terms.

## Similar
- [Memory Vault](https://affpapa.org/en/nevibecode/mcp/memory-vault.md) — MCP server · ★ 67 repo stars
- [postgres-hybrid-text-search](https://affpapa.org/en/nevibecode/skills/postgres-hybrid-text-search.md) — skill · 411 installs
- [data-and-ai-tools](https://affpapa.org/en/nevibecode/plugins/data-and-ai-tools.md) — plugin · ★ 96 repo stars
- [pgvector-semantic-search](https://affpapa.org/en/nevibecode/skills/pgvector-semantic-search.md) — skill · 1000 installs
- [postgres-semantic-search](https://affpapa.org/en/nevibecode/skills/postgres-semantic-search.md) — skill · 227 installs
- [postgres-skills](https://affpapa.org/en/nevibecode/plugins/postgres-skills.md) — plugin · ★ 56 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
