
一个模型上下文协议(MCP)服务器,为任何 MkDocs 驱动的网站提供搜索功能。该服务器依赖于现有的 MkDocs 搜索实现,使用 Lunr.Js 搜索引擎。
概览
一个模型上下文协议(MCP)服务器,为任何 MkDocs 驱动的网站提供搜索功能。该服务器依赖于现有的 MkDocs 搜索实现,使用 Lunr.Js 搜索引擎。 请按照安装说明操作,请遵循 Claude Desktop 用户的模型上下文协议快速入门。您需要在 MCP 配置文件中添加以下部分: 该项目实现了一个MCP服务器,使大型语言模型(LLMs)能够搜索任何已发布的mkdocs文档网站。它利用lunr.js实现高效的本地搜索功能,并提供可摘要和展示给用户的结果。 - 支持MCP的服务器,用于与大型语言模型集成- 使用lunr进行本地搜索。
概述(AI 翻译)
一个模型上下文协议(MCP)服务器,为任何 MkDocs 驱动的网站提供搜索功能。该服务器依赖于现有的 MkDocs 搜索实现,使用 Lunr.Js 搜索引擎。
Claude桌面快速入门
请按照安装说明操作,请遵循 Claude Desktop 用户的模型上下文协议快速入门。您需要在 MCP 配置文件中添加以下部分:
概述
该项目实现了一个MCP服务器,使大型语言模型(LLMs)能够搜索任何已发布的mkdocs文档网站。它利用lunr.js实现高效的本地搜索功能,并提供可摘要和展示给用户的结果。
特色
- 支持MCP的服务器,用于与大型语言模型集成
- 使用lunr.js索引的局部搜索
- 版本特定的文档搜索功能
- MkDocs材料HTML转Markdown,带有结构化JSON响应
- 带语言检测和上下文的代码示例提取
- 支持多语言文档的标签视图
- 美人鱼图保存
- 自动URL解析(相对于绝对)
- 智能缓存,涵盖搜索索引和转换文档
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MkDocs MCP Search Server
A Model Context Protocol (MCP) server that provides search functionality for any MkDocs powered site. This server relies on the existing MkDocs search implementation using the Lunr.Js search engine.
Claude Desktop Quickstart
Follow the installation instructions please follow the Model Context Protocol Quickstart For Claude Desktop users. You will need to add a section tothe MCP configuration file as follows:
{
"mcpServers": {
"my-docs": {
"command": "npx",
"args": [
"-y",
"@serverless-dna/mkdocs-mcp",
"https://your-doc-site",
"Describe what you are enabling search for to help your AI Agent"
]
}
}
}
Overview
This project implements an MCP server that enables Large Language Models (LLMs) to search through any published mkdocs documentation site. It uses lunr.js for efficient local search capabilities and provides results that can be summarized and presented to users.
Features
- MCP-compliant server for integration with LLMs
- Local search using lunr.js indexes
- Version-specific documentation search capability
- MkDocs Material HTML to Markdown conversion with structured JSON responses
- Code example extraction with language detection and context
- Tab view support for multi-language documentation
- Mermaid diagram preservation
- Automatic URL resolution (relative to absolute)
- Intelligent caching for both search indexes and converted documentation
Installation
# Install dependencies
pnpm install
# Build the project
pnpm build
Usage
The server can be run as an MCP server that communicates over stdio:
npx -y @serverless-dna/mkdocs-mcp https://your-doc-site.com
Available Tools
Search Tool
The server provides a searchMkDoc tool with the following parameters:
search: The search query stringversion: Optional version string (only for versioned sites)
Sample Response:
{
"query": "logger",
"version": "latest",
"total": 3,
"results": [
{
"title": "Logger",
"url": "https://docs.example.com/latest/core/logger/",
"score": 1.2,
"preview": "Logger utility for structured logging...",
"location": "core/logger/"
},
{
"title": "Configuration",
"url": "https://docs.example.com/latest/core/logger/#config",
"score": 0.8,
"preview": "Configure the logger with custom settings...",
"location": "core/logger/#config",
"parentArticle": {
"title": "Logger",
"location": "core/logger/",
"url": "https://docs.example.com/latest/core/logger/"
}
}
]
}
Features:
- Confidence-based filtering (configurable threshold)
- Advanced scoring with title matching and boosting
- Parent article context for section results
安装
npx -y @serverless-dna/mkdocs-mcp https://your-doc-site Describe what you are enabling search for to help your AI Agent配置
{
"mcpServers": {
"my-docs": {
"command": "npx",
"args": [
"-y",
"@serverless-dna/mkdocs-mcp",
"https://your-doc-site",
"Describe what you are enabling search for to help your AI Agent"
]
}
}
}