Skip to main content

Context-Fabric MCP Server

Query Context-Fabric corpora via MCP (Model Context Protocol).

Installation

pip install cfabric-mcp

Transports

The server supports three transport modes:

Transport Flag Use Case
stdio (default) Claude Desktop, local MCP clients
SSE --sse PORT Cursor, remote MCP clients
Streamable HTTP --http PORT Production deployments

Usage

# stdio transport (Claude Desktop)
cfabric-mcp --corpus /path/to/bhsa

# SSE transport (Cursor, remote clients)
cfabric-mcp --corpus /path/to/bhsa --sse 8000

# Streamable HTTP transport (production)
cfabric-mcp --corpus /path/to/bhsa --http 8000

Options

--corpus PATH              # Corpus to load (required, repeatable)
--corpus name=PATH         # Named corpus
--sse PORT                 # SSE transport on port (endpoint: /sse)
--http PORT                # Streamable HTTP transport on port (endpoint: /mcp)
--host HOST                # Host to bind (default: 0.0.0.0)
--features "sp lex"        # Load only specific features
--verbose                  # Debug logging

Tools

The server exposes 11 MCP tools organized in layers for efficient discovery.

Note: A usage guide is automatically provided to clients via the MCP instructions field at connection time.

Discovery Tools

Tool Description
list_corpora List loaded corpora
describe_corpus Get corpus structure (node types, sections)
list_features Browse features with optional node_type filter
describe_feature Get feature details with sample values
get_text_formats Get text encoding samples (cached)

Search Tools

Tool Description
search Pattern search (results/count/statistics/passages)
search_continue Paginate search results
search_csv Export results to CSV file (stdio only)
search_syntax_guide Search syntax docs (section-based)

Data Access Tools

Tool Description
get_passages Get text by section references
get_node_features Get feature values for nodes

Discovery Flow

The tools are designed for hierarchical, iterative discovery:

describe_corpus()
│
├─► list_features()                  → Browse all features
│       └─► describe_feature("sp")   → Full details + samples
│
├─► list_features(node_types=["word"])  → Filter by node type
│       └─► describe_feature(...)
│
└─► get_text_formats()               → When encoding matters

        ↓
    search()  → Execute queries

Typical workflow:

  1. describe_corpus() - Get structure overview
  2. list_features() or list_features(node_types=["word"]) - Browse available features
  3. describe_feature("sp") - Deep dive into specific feature with sample values
  4. search_syntax_guide() - Get search syntax help (section-based)
  5. search() - Execute search queries

Search Return Types

Type Description
results Paginated node info with cursor (default)
count Total count only
statistics Feature value distributions
passages Formatted text passages

Client Configuration

Claude Desktop (stdio)

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "context-fabric": {
      "command": "/path/to/venv/bin/cfabric-mcp",
      "args": ["--corpus", "/path/to/bhsa"]
    }
  }
}

Cursor (SSE)

Start server:

cfabric-mcp --corpus /path/to/bhsa --sse 8000

Configure Cursor to connect to: http://localhost:8000/sse

Custom MCP Clients

For SSE transport, connect to http://host:port/sse For Streamable HTTP, connect to http://host:port/mcp

License

MIT

Metadata

Release files for cfabric-mcp 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cfabric-mcp 0.1.7
File Size Uploaded
cfabric_mcp-0.1.7.tar.gz 22.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cfabric-mcp 0.1.7
File Interpreter ABI Platform
cfabric_mcp-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 44.2 kB

Release files / cfabric_mcp-0.1.7.tar.gz

Download URL cfabric_mcp-0.1.7.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9ec34c21b3a242563fbd0062062b03e6c227f5a8692d0bf5dc8968b50fcb186d
BLAKE2b-256 checksum
How to use checksums
dca2b069537ac66853a58ea48b27a2d4be8e8d908c14b592a474522cd2693016
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / cfabric_mcp-0.1.7-py3-none-any.whl

Download URL cfabric_mcp-0.1.7-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
daa9006b98cb9cf425dd3eccb4d86027adf2850b2272aa9b22b11f28b9000ba5
BLAKE2b-256 checksum
How to use checksums
e9c7d412b8b41552928a01d59afa859a4c30ef34849ca77ebe5719c0a8a61eb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page