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)

Search totals count all matches, including matches beyond the cursor cache's 10,000-result retention limit. Counts remain exact on cache hits. Statistics use all matches; when only a prefix is cached, statistics may rerun the query. Result and passage responses include cached_count and results_truncated to distinguish retained results from total_count. Pagination's has_more describes remaining cached results, so it becomes false at the cache boundary even when results_truncated is true. CSV exports honor their requested row limit independently of cache retention, rerunning a truncated cached query when more rows are needed.

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.9

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.9
File Size Uploaded Provenance Actions
cfabric_mcp-0.1.9.tar.gz 27.1 kB Without provenance Details for cfabric_mcp-0.1.9.tar.gz

Built distribution (wheel)

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

Total release size: 51.0 kB

Release files / cfabric_mcp-0.1.9.tar.gz

Download URL cfabric_mcp-0.1.9.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
882268fdf5138c0ee1cef86b8716e4bfa4c04f525427859e29d7a3c2b17337ec
BLAKE2b-256 checksum
How to use checksums
b4f542b83d431269f064c58f9e1f89bca9ad5a891ab2fac40411ef4cbbdba9d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

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

Download URL cfabric_mcp-0.1.9-py3-none-any.whl
Size 23.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
380896a066cf7ede553d4c402d1402024fb1768968a696bea6a74a52a5cb22dd
BLAKE2b-256 checksum
How to use checksums
3029ea78ff1555d0e5c118f27c8fcb507130729259e71872469901a3bd150fce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for cfabric-mcp 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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