Skip to main content

doc-search MCP server

A small MCP server written with FastMCP. It gives an AI coding agent structured access to this workspace's documentation and demo tickets — the local, public stand-in for the Jira/Confluence side of the original production workspace. Five tools are annotated read-only (embeddings maintains a derived local cache); the sixth can only write ticket drafts (see below).

Tools

Tool What it does
search_docs(query, limit=8) Keyword search across every Markdown doc under projects/; title hits ×3, heading hits ×2, body hits ×1; returns path, title, score, snippet
search_docs_semantic(query, limit=8) TF-IDF vector-space search over the same corpus (cosine similarity); returns path, title, score (0–1), snippet
search_docs_embeddings(query, limit=8) Sentence embeddings over heading chunks; returns path, title, cosine score, snippet, heading; caches in .index/
get_doc(path) Fetch one document by workspace-relative path (only projects/ and tickets/ are readable)
list_tickets(status?) List the pre-TF-115 archive from tickets/*.md front matter, optionally filtered by status
propose_ticket(title, body, priority="medium") Write a ticket draft to tickets/drafts/draft-<slug>.md — the server's only source-content write; it cannot create or modify real tickets

Draft-first writes

propose_ticket mirrors the production workspace's rule for outward writes (there: Jira changes start as drafts a human approves). The boundary is enforced by the tool, not by politeness: it writes only new files under tickets/drafts/, always with status: draft, it refuses to overwrite an existing draft, and it is annotated as a write, so clients ask the user before calling it. tickets/ is the pre-TF-115 archive; list_tickets never shows drafts as tickets. A human reviews and promotes a draft with scripts/promote-draft.ps1 (or .sh), which files an Issue instead of moving the file into tickets/. Set AI_WORKSPACE_PROJECT to the workspace Project number, or pass -Project N / --project N, to also add the Issue to the board. Without a Project, the script prints the Issue URL and notes that it was not added to a board. The draft is preserved. The doc-search server stays credential-free and never calls GitHub.

  1. search_docs counts exact term hits with title/heading/body weights. It is predictable for known terms, but repetition can dominate ranking.
  2. search_docs_semantic uses TF-IDF cosine similarity over whole documents. It down-weights common terms and balances multi-term queries. Both of these first two rungs are bag-of-words models: neither understands synonyms. They use only the standard library and rebuild their vectors per call.
  3. search_docs_embeddings uses sentence-transformers over ATX heading sections, embedding the document title, heading trail and body. It can retrieve paraphrases and synonyms, but relevance is model-dependent. Cosine ranking uses pure Python. A content-hash fingerprint invalidates the derived .index/ cache when documents or the model change.
  • Local documents: searches never modify the source documents. Embeddings writes a derived cache; propose_ticket writes drafts under the rules above.
  • No credentials: keyword and TF-IDF need no network. Embeddings downloads its model once, then runs fully locally.
  • Client-agnostic: plain MCP over stdio.

Setup

cd mcp\doc-search
python -m venv .venv
.venv\Scripts\python -m pip install -r requirements.txt pytest

Optional embeddings dependencies (includes torch):

.venv\Scripts\python -m pip install -r requirements-embeddings.txt

DOC_SEARCH_EMBEDDING_MODEL overrides the default sentence-transformers/all-MiniLM-L6-v2. DOC_SEARCH_EMBEDDER=fake selects only a deterministic hashed-token test double, without semantic understanding.

Evaluate the synced corpus with python scripts/run_eval.py; add --write to record the dated results in EVAL.md. The eval is not run in CI.

Run the tests

.venv\Scripts\python -m pytest

The tests build a throwaway fixture workspace, so they pass whether or not sync has populated projects/.

Register it

Codex — add to ~/.codex/config.toml:

[mcp_servers.doc-search]
command = 'C:\path\to\ai-workspace-kit\mcp\doc-search\.venv\Scripts\python.exe'
args = ['C:\path\to\ai-workspace-kit\mcp\doc-search\server.py']

Claude Code:

claude mcp add doc-search -- C:\path\to\ai-workspace-kit\mcp\doc-search\.venv\Scripts\python.exe C:\path\to\ai-workspace-kit\mcp\doc-search\server.py

The server finds the workspace root from its own location (<root>/mcp/doc-search/server.py); set AI_WORKSPACE_ROOT to override.

Install the distribution

Once published, install with pip install taskflow-doc-search (or pip install "taskflow-doc-search[embeddings]" for sentence embeddings). For a local checkout, pip install . from this directory works today. Run taskflow-doc-search with AI_WORKSPACE_ROOT set to the absolute path of the workspace to search. It serves MCP over stdio; no command arguments are needed. The existing python server.py launcher and its automatic workspace-root detection remain supported.

Release instructions: PUBLISHING.md. The included server.json is prepared for an optional MCP registry listing and has not been published.

Metadata

Release files for taskflow-doc-search 0.1.1

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

Source distribution (sdist)

Source distribution for taskflow-doc-search 0.1.1
File Size Uploaded Provenance Actions
taskflow_doc_search-0.1.1.tar.gz 20.2 kB With provenance Details for taskflow_doc_search-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for taskflow-doc-search 0.1.1
File Interpreter ABI Platform Actions
taskflow_doc_search-0.1.1-py3-none-any.whl Python 3 none any Details for taskflow_doc_search-0.1.1-py3-none-any.whl

Total release size: 33.0 kB

Release files / taskflow_doc_search-0.1.1.tar.gz

Download URL taskflow_doc_search-0.1.1.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0aafad29341c24865d11f05832f62b4ef8c7efaab47787101f671a5704cc0e32
BLAKE2b-256 checksum
How to use checksums
1cef36db9e18b8779698331097144118626cd744172d6c0006b8506aaf003446
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / taskflow_doc_search-0.1.1-py3-none-any.whl

Download URL taskflow_doc_search-0.1.1-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a3983d86edb510c77a03661d32d76a242c6d4c36f5244f396ad6f4184d3b8eb
BLAKE2b-256 checksum
How to use checksums
7568eaa64e453832520a9a969a1c4ec1ec6fa237e71da5141b21110065588af9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for taskflow-doc-search 0.1.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for taskflow_doc_search-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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