Doctree

Provides BM25 search and a hierarchical outline to access and retrieve Markdown documentation content.
  • javascript

0

GitHub Stars

javascript

Language

3 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "joesaby-doctree-mcp": {
      "command": "bunx",
      "args": [
        "doctree-mcp"
      ],
      "env": {
        "DOCS_ROOT": "/path/to/your/markdown/docs"
      }
    }
  }
}

You can run the Doctree MCP server locally to provide structured access to your markdown documentation. It lets an agent search with BM25, read an outline, and retrieve only the sections it needs, combining fast search with a navigable content tree for precise content retrieval.

How to use

Start the MCP server as a local, stdio process using your Bun runtime, then connect your MCP client to it. The server exposes a hierarchical outline of your markdown docs and a fast BM25 search, enabling you to browse, filter, and fetch exact sections or full nodes as needed. Use the client to perform a search, inspect the tree, and retrieve only the relevant content for your agent.

How to install

Prerequisites: you need Node-compatible tooling or Bun installed on your system. The server runs in a local environment and reads your markdown repository.

  1. Ensure Bun is installed on your system.

  2. Clone the project and install dependencies.

  3. Run the server in stdio mode and point it to your Markdown docs directory.

Configuration and starting the server

Configure the client to use the local MCP endpoint provided by this server. You can also set the documents root path via an environment variable to tell the server where your Markdown repository is located.

# Example runtime command to start the server in stdio mode
# This runs the Doctree MCP server via Bun and points to your docs
DOCS_ROOT=/path/to/your/markdown/docs bunx doctree-mcp

Tools and endpoints you can call

The server provides a set of tools to interact with your documents. Use the following tools to browse, search, and fetch content.

Example MCP server configuration for local run

{
  "mcpServers": {
    "doctree": {
      "command": "bunx",
      "args": ["doctree-mcp"],
      "env": {
        "DOCS_ROOT": "/path/to/your/markdown/docs"
      }
    }
  }
}

Notes on usage patterns

  • Start the server once and reuse it for multiple queries from your MCP client. - Use the search tool to quickly locate relevant sections by keywords, then navigate the tree to see the context and nearby nodes before requesting content. - Retrieve specific sections by node ID to minimize data transfer and improve agent efficiency.

Troubleshooting

If you encounter connection issues, verify that the DOCS_ROOT points to a valid Markdown repository and that Bun is available in your environment. Check that the server process started successfully and that the client points to the correct local endpoint.

Security and usage tips

Keep your local document repository secure and ensure that any agent access to the MCP endpoint operates within your environment’s security policies. Use appropriate access controls for any clients connecting to the local MCP server.

Available tools

list_documents

Browse the catalog with tag or keyword filters and facet counts to locate relevant documents.

search_documents

Perform a BM25 search with facet filters and glossary expansion to find candidate sections.

get_tree

Retrieve the hierarchical outline showing structure and word counts without content to guide reasoning.

get_node_content

Fetch the full text of specific sections identified by node IDs.

navigate_tree

Return a section and all its descendants in a single call to assemble context.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational