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.
uv
package managerInstall Claude Desktop from https://claude.ai/download or use another MCP-compatible application
Clone the library-mcp repository:
git clone https://github.com/lethain/library-mcp
Install the uv
package manager by following the instructions at https://modelcontextprotocol.io/quickstart/server
Configure Claude Desktop to use the MCP server:
cd ~/Library/Application\ Support/Claude
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"
]
}
}
}
Replace /path/to/library-mcp
with the actual path where you cloned the repository
Replace /path/to/your/markdown/content
with the path to your Markdown content directory
Restart Claude Desktop
The MCP server provides several categories of tools for interacting with your Markdown content.
These tools help retrieve content into your context window:
These tools help navigate your knowledge base:
For managing the MCP server:
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.
This approach offers advantages over simply uploading your entire content collection:
The server is designed for local use on your personal computer and works effectively with properly formatted Markdown files containing metadata headers.
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.
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"
]
}
}
}
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.
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.