Taskflow Doc Search

io.github.cynthiawang109-sudo由 GitHub 帳號 cynthiawang109-sudo 發布v0.1.1更新於 Nov 15, 2026

Search local TaskFlow workspace documentation and read tickets over MCP stdio.

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理以三種方式檢索 TaskFlow 工作區的 Markdown 文件、讀取文件,並列出或起草工單。

可以做什麼
  • 以關鍵字、TF-IDF 相似度或本機句向量檢索文件,回傳路徑、標題、分數與片段
  • 依工作區相對路徑讀取單一 Markdown 文件,僅限 projects/ 與 tickets/
  • 列出 tickets/ 中的封存工單,可依狀態篩選
  • 在 tickets/drafts/ 下以草稿檔案形式提出新工單
適用情境
適合讓 AI 編碼助理根據本機文件與工單工作區回答問題,而不是憑空猜測;也適合需要「先起草、再由人工提升」的工單提交流程。
執行需求
以 stdio 在本機執行,可從 PyPI 以 uvx 或 pip 安裝(Python)。需將 AI_WORKSPACE_ROOT 設為包含 projects/ 與 tickets/ 的工作區絕對路徑。關鍵字與 TF-IDF 檢索不需網路;向量檢索需安裝選用相依套件並在首次使用時下載模型,可用 DOC_SEARCH_EMBEDDING_MODEL 覆寫預設模型。
安裝前請注意
propose_ticket 會在 tickets/drafts/ 下寫入新檔案,並標示為寫入操作,用戶端可能先詢問使用者;它無法修改或刪除既有工單。向量檢索會在伺服器的 .index/ 目錄寫入衍生快取,並於首次使用時下載模型。不使用任何憑證,也不會呼叫 GitHub。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Taskflow Doc Search,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

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

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

Three rungs of document search

  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

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

Optional embeddings dependencies (includes torch):

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

powershell
.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:

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:

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

來源:mcp/doc-search/README.md,提交 e3a66ed

工具

6

search_docs

Search Docs

Keyword search over the workspace documentation repos. Ranking is deliberately simple and inspectable: a hit in a document title counts 3, in a heading 2, in body text 1. Returns workspace- relative path, title, score, and the first matching line as a snippet.

輸入參數limitquery必填

search_docs_semantic

Search Docs Semantic

Vector-space (TF-IDF, cosine similarity) search over the docs. The contrast with search_docs is deliberate. Keyword search counts exact hits with hand-set weights (title x3, heading x2, body x1), so a document that repeats a common term many times can outrank the topically closest one. Here each document is a TF-IDF vector: terms that appear in many documents (low information) are down-weighted by the IDF factor, and ranking is by cosine similarity to the query vector, i.e. overall topical closeness across all query terms. It is still a bag-of-words model - no synonym or embedding magic. Pure stdlib; the corpus is re-indexed on every call, which is fine at documentation-repo scale and keeps the server stateless.

輸入參數limitquery必填

search_docs_embeddings

Search Docs Embeddings

Search document sections using locally computed sentence embeddings. Returns path, title, cosine score rounded to four places, the first non-empty body line (up to 200 characters) as snippet, and heading trail. Writes only a derived cache in this server's .index/ directory. The optional model downloads on first use, then runs locally. Model imports are deferred until this tool is called, keeping startup torch-free.

輸入參數limitquery必填

get_doc

Get Doc

Fetch one Markdown document by workspace-relative path, e.g. "projects/taskflow-docs/system-overview.md" or "tickets/TF-101.md". Paths outside projects/ and tickets/ are refused.

輸入參數path必填

list_tickets

List Tickets

List the pre-TF-115 archive (Markdown files in tickets/). Optionally filter by status: open, in-progress, done. New work lives in GitHub Issues; humans promote drafts via scripts/promote-draft.

輸入參數status

propose_ticket

Propose Ticket

Propose a new ticket as a DRAFT under tickets/drafts/. Draft-first is enforced here, not left to convention: this is the server's only write tool, and it can only create a new file in tickets/drafts/ with status "draft". It cannot create, modify, or delete the pre-TF-115 archive in tickets/. A human reviews the draft and files an Issue via scripts/promote-draft if it should become a ticket. The server stays credential-free. Returns the workspace-relative path.

輸入參數body必填title必填priority

版本歷史

1
  1. v0.1.1最新Nov 15, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分