Skip to main content
Glama
MicroSearch MCP Server

MicroSearch MCP Server

by kineticdirt

microsearch-mcp

MicroSearch as a small, generic MCP server (Model Context Protocol): ingest context and training-style JSONL, keep multiple named iterations on disk, then run the four-tool retrieval ladder (preview → retrieve → MCP handoff) over a BDH-style lexical chunk graph (next / prev link expansion).

No vector DB required. Optional HTTP transport uses FastAPI.

Four tools

Tool

Purpose

microsearch_ingest

Ingest documents[] (chunked into the graph), append training_records[] as JSON Lines, list iterations, activate an iteration, or create a new iteration.

microsearch_preview

Pass 1 — corpus index + cheap lexical hits (no link expansion).

microsearch_retrieve

Passes 2–3 — linked expansion, max_chars, optional refine_query, tier (ground / deep).

microsearch_prepare_mcp_handoff

Pass 4 — suggested downstream MCP tools + argument hints (does not call foreign MCPs).

Related MCP server: bulk-lanes

Data layout

Set MICROSEARCH_DATA_ROOT (default: ./data under the process working directory):

{MICROSEARCH_DATA_ROOT}/
  registry.json                 # active_iteration_id + iteration metadata
  iterations/
    {iteration_id}/
      bdh_graph.json            # chunk graph
      training/
        examples.jsonl          # one JSON object per line (your schema)

Iterations are plain string ids (slugged on create). microsearch_preview responses include iterations and active_iteration_id so hosts can orient without an extra tool.

Environment

Variable

Meaning

MICROSEARCH_DATA_ROOT

Root directory for registry + iterations/

MICROSEARCH_MCP_HANDOFF_CATALOG

Optional JSON file for pass-4 rules (tools array); see examples/handoff_catalog.example.json

Install

cd microsearch-mcp
pip install .
# HTTP transport:
pip install '.[http]'

Editable install:

pip install -e .

Run (stdio MCP)

export MICROSEARCH_DATA_ROOT="$PWD/data"
python -m microsearch_mcp serve stdio

Cursor / Claude Desktop (conceptually):

{
  "mcpServers": {
    "microsearch": {
      "command": "python3",
      "args": ["-m", "microsearch_mcp", "serve", "stdio"],
      "cwd": "/path/to/project",
      "env": { "MICROSEARCH_DATA_ROOT": "/path/to/project/data" }
    }
  }
}

Run (HTTP)

pip install '.[http]'
export MICROSEARCH_DATA_ROOT="$PWD/data"
python -m microsearch_mcp serve http --host 127.0.0.1 --port 8777

POST /mcp — JSON-RPC: initialize, tools/list, tools/call (same pattern as many sample MCP HTTP servers).

Repository

https://github.com/kineticdirt/microsearch-mcp

Batch file ingest (CLI)

export MICROSEARCH_DATA_ROOT="$PWD/data"
microsearch-mcp ingest-files --text ./notes.txt --manifest ./paths.list --iteration-id default

Ingest via MCP (tool)

Call microsearch_ingest with:

  • documents: [{ "doc_id": "runbook-auth", "text": "...", "metadata": { "source": "notion" }, "replace": true }]

  • training_records: arbitrary objects appended to training/examples.jsonl (for fine-tuning datasets, intent logs, etc.)

  • create_iteration_id + make_created_iteration_active to start a new snapshot

  • list_iterations: true or activate_iteration_id: "v2" for housekeeping

Same doc_id re-ingested with replace: true (default) replaces that document’s chunks.

License

MIT — see LICENSE.

Upstream

Extracted from the Cequence BlackWall workspace; this repo is the portable MCP + BDH package. Monorepo copies under retrieval-eval/experiments/microsearch_mcp_*.py may lag — treat this repository as canonical for installs.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      B
      maintenance
      Enables local-first context retrieval and management from JSONL and Markdown sources through MCP, with a rebuildable full-text search index and support for stable reference pagination.
      1
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables typed batch evidence processing, including classification, extraction, summarization, and triage, with SQLite checkpoints, exact source offsets, CLI, and MCP integration.
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables retrieval-augmented question answering with source-grounded citations, document retrieval, and idempotent ingestion through MCP tools.
      -
    • F
      license
      C
      quality
      B
      maintenance
      Enables users to build and query a project-local literature database by ingesting papers from Semantic Scholar, PubMed, arXiv, and OpenAlex, caching open-access PDFs, extracting full text, ranking results, and exposing MCP tools for search, seeds, feedback, and pipeline status over stdio.
      16
      -