Markdown Library MCP server

Indexes and serves Markdown knowledge bases with specialized tools for tag-based navigation, text search, and content retrieval across large document collections.
Back to servers
Provider
Will Larson
Release date
Apr 22, 2025
Language
Python
Stats
45 stars

The MCP server for Markdown knowledge bases helps you interact with your collection of Markdown files, enabling search and retrieval of content based on tags, text, dates, and more. This tool is particularly useful when working with large content collections that exceed model context windows.

Installation

Prerequisites

  • Claude Desktop (or another MCP-compatible application)
  • Python environment with uv package manager

Step-by-Step Installation

  1. Install Claude Desktop from https://claude.ai/download or use another MCP-compatible application

  2. Clone the library-mcp repository:

    git clone https://github.com/lethain/library-mcp
    
  3. Install the uv package manager by following the instructions at https://modelcontextprotocol.io/quickstart/server

  4. Configure Claude Desktop to use the MCP server:

    • Open Claude Desktop
    • Go to Settings > Developer and create your MCP config file
    • Navigate to the Claude config directory:
      cd ~/Library/Application\ Support/Claude
      
    • Edit the claude_desktop_config.json file to add the MCP server configuration:
      {
        "mcpServers": {
          "library": {
            "command": "uv",
            "args": [
              "--directory",
              "/path/to/library-mcp",
              "run",
              "main.py",
              "/path/to/your/markdown/content"
            ]
          }
        }
      }
      
  5. Replace /path/to/library-mcp with the actual path where you cloned the repository

  6. Replace /path/to/your/markdown/content with the path to your Markdown content directory

  7. Restart Claude Desktop

Usage

Available Tools

The MCP server provides several categories of tools for interacting with your Markdown content.

Content Search Tools

These tools help retrieve content into your context window:

  • get_by_tag - Retrieves content by tag
  • get_by_text - Searches content for specific text
  • get_by_slug_or_url - Finds posts by slug or URL
  • get_by_date_range - Gets posts published within a date range

Tag Management Tools

These tools help navigate your knowledge base:

  • search_tags - Searches for tags matching a query
  • list_all_tags - Lists all tags sorted by post count and recency

Maintenance Tools

For managing the MCP server:

  • rebuild - Rebuilds the content index (useful after adding or editing content)

Example Queries

Once you have the MCP server running, you can use natural language to interact with your content:

Get the next 50 posts with tag "executive", then tell me what I should do about this problem I am running into: ...

You can also work with date ranges:

Summarize the blog posts I wrote in the past year.

Benefits Over Context Window Loading

This approach offers advantages over simply uploading your entire content collection:

  • Works with content collections larger than model context windows
  • Allows selective retrieval of relevant content
  • Enables working across multiple distinct Markdown knowledge bases

The server is designed for local use on your personal computer and works effectively with properly formatted Markdown files containing metadata headers.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later