Skip to main content

MCP server for Context Fabric corpus operations

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfabric_mcp-0.1.6.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cfabric_mcp-0.1.6-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file cfabric_mcp-0.1.6.tar.gz.

File metadata

  • Download URL: cfabric_mcp-0.1.6.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for cfabric_mcp-0.1.6.tar.gz
Algorithm Hash digest
SHA256 964ad0930f0d2a5f5722fd22a24dd59d204ba6cba149bdb97d5323b968298de1
MD5 eccf8717414826e30b831b87d615ca28
BLAKE2b-256 072ce1649cf31bfbaee874c90b84ecad8c0335b18b8b6dbccc73b515631483e4

See more details on using hashes here.

File details

Details for the file cfabric_mcp-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: cfabric_mcp-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for cfabric_mcp-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9949903d0812a4ae0d58edb621fe7122ca19897968e9e9d31642aa76367d8508
MD5 62145fefd07f95d727da5bc42a8303d9
BLAKE2b-256 05b3f8d63f53e43e36b71131370b69db3b4d2ea41d13b969ee97b9cf3e2d5059

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page