Skip to main content
Glama
Markdown Knowledge MCP

Markdown Knowledge MCP

Markdown Knowledge MCP

Search a local folder of Markdown notes from an MCP client. The server indexes headings and text with SQLite FTS5, ranks matching sections with BM25, and returns source paths and line ranges so you can check the excerpts yourself.

It is a retrieval tool, not a chatbot: it does not generate answers, decide which source is correct, or call an AI service. If sources disagree, compare the cited sections. If nothing matches, the server reports that instead of inventing an answer.

Try it

You need uv, Python 3.10 or newer with SQLite FTS5, and macOS or Linux (including WSL). Clone the repository and run:

git clone https://github.com/Videhisawesome/markdown-knowledge-mcp.git
cd markdown-knowledge-mcp
uv sync --locked
uv run markdown-knowledge-mcp --root "$PWD/examples/knowledge"

The server speaks MCP over stdio. It waits for a client and does not open a network port. The example folder contains fictional documentation; replace it with a dedicated folder of Markdown files you are allowed to share with your client.

Connect an MCP client

For a client that uses a JSON mcpServers configuration, set the uv path, checkout path, and Markdown folder to real absolute paths: use command -v uv to find uv.

{
  "mcpServers": {
    "markdown-knowledge": {
      "command": "/absolute/path/to/uv",
      "args": [
        "--directory", "/absolute/path/to/markdown-knowledge-mcp",
        "run", "markdown-knowledge-mcp",
        "--root", "/absolute/path/to/notes"
      ]
    }
  }
}

Use the equivalent stdio setup in clients with a different configuration format.

Related MCP server: Brain MCP

Tools

Tool

What it does

search_knowledge(query, limit=5)

Returns ranked matching excerpts with section IDs and citations.

read_section(section_id, offset=0, max_chars=8000)

Reads a matching section with its relative path and line range. Use next_offset to read longer sections.

refresh_index()

Rebuilds the index after you add, move, or edit notes.

Mark a documentation gap

If a section is deliberately unwritten, make <!-- knowledge-gap --> the entire body under its heading. A matching gap is labeled documented_gap and returns the citation but no excerpt. An ordinary no-match is labeled no_matches. If another document has written material on the same topic, inspect that source separately.

Privacy and limits

  • The server reads the Markdown folder you configure. Use a narrow folder, not your home directory.

  • The search index is in memory. The server does not modify source files or send requests over the network. An MCP client or its model provider may receive text returned by the tools. Only point the server at content permitted by that client's data policies.

  • Treat document text as untrusted. An excerpt is evidence, not an instruction for a client to follow.

  • The index reads UTF-8 .md and .markdown files, skips hidden files and symlinks, and caps scans at 1 MiB per file and 16 MiB overall. Refresh reports when scan limits were reached.

  • Search is lexical, not semantic. Wording matters; try a narrower or alternate term when a search misses. Results are not proof that a fact is true, current, or the only relevant answer.

Development

uv run python -m unittest discover -s tests -v

MIT licensed. See LICENSE.

Available Tools

3 tools
read_sectionB
Read-only

Read text by indexed section ID, paging with next_offset when present.

Inputs: section_id (required), offset, max_chars. Returns: object

refresh_indexA
Idempotent

Reread the configured corpus into memory without writing to its filesystem.

Inputs: no named parameters. Returns: object

search_knowledgeA
Read-only

Find Markdown excerpts with relative paths, headings, and source line ranges.

Search uses all distinct words in a query. Try short keyword phrases, and inspect multiple sources before drawing a conclusion. No matches is not an answer.

Inputs: query (required), limit. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 3 tools

    Disambiguation5/5

    The three tools have clearly distinct purposes: search_knowledge discovers excerpts, read_section retrieves a specific indexed section, and refresh_index rebuilds the in-memory index. There is little risk of misselection because each targets a different stage of the retrieval workflow.

    Naming Consistency5/5

    All tool names follow a consistent snake_case verb_noun pattern: search_knowledge, read_section, refresh_index. The convention is predictable and readable throughout.

    Tool Count5/5

    For a focused Markdown knowledge retrieval server, three tools are well-scoped and each earns its place. The surface is intentionally small rather than thin, since search, read, and refresh cover the core workflow.

    Completeness4/5

    The tools cover discovery, section reading, and index refresh, which is most of the read-only knowledge lifecycle. However, there is no explicit list/browse operation or a clearly stated way to resolve a section ID from search results before read_section is used.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Local MCP server for querying and maintaining a Markdown vault. Provides full-text search, backlinks, note retrieval, and optional confined write tools, without sending the whole vault to the client context.
      22
      56 PyPI
      1
      Apache 2.0
    • A
      license
      B
      quality
      D
      maintenance
      Enables hybrid dense and BM25 search over a markdown vault, with tools for reading, writing, grepping, and managing notes through any MCP-compatible client.
      12
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides hybrid search (BM25 + vector) and staleness reporting for local markdown notes, exposing search and indexing tools to AI assistants via MCP.
      14 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables local semantic and full-text search over Markdown notes through MCP, returning relevant passages ranked by meaning and exact terms without requiring a GPU or hosted APIs.
      MIT