
MCP为本地医生服务
概览
实现了模型上下文协议(MCP)服务器,用于本地文档访问。为Claude提供了从多个来源无缝访问标记文档的能力。 - : 访问命令、项目文档和项目根文档 - : 模糊匹配且具有精确/子字符串匹配优先级 - : 可选元数据以增强搜索(描述、标签) - : 文件列表缓存,变更时自动失效(速度快约3000倍) - : 文档文件变更时自动缓存失效 - : 防止目录遍历并验证路径 - : 明确指定文档来源(例如命令s:file.md) - : 防止读取大于5MB的文件 1. (~/.claude/commands/**Project Docs**/*.md):带有可配置排除功能的项目专用文档 3.($CWD/*.md):根级文档,如 README。
概述(AI 翻译)
实现了模型上下文协议(MCP)服务器,用于本地文档访问。为Claude提供了从多个来源无缝访问标记文档的能力。
特色
- 多源文档:访问命令、项目文档和项目根节点的文档
- 智能搜索:带有精确/子字符串匹配优先级的模糊匹配
- YAML 前置支持:增强搜索(描述、标签)的可选元数据
- 始终在线缓存:文件列表缓存,变更时自动失效(速度快约3000倍)
- 文件监视:文档文件发生变化时自动缓存失效
- 安全路径处理:防止目录遍历并验证路径
- 源代码前缀:明确指定文档来源(例如,
commands:file.md) - 大小限制:防止读取大于5MB的文件
文献来源
- 共享文档(
~/.claude/commands/**/*.md):用户命令和知识库(可配置) - 项目文档(
$CWD/docs/**/*.md):项目专用文档,可配置排除项 - Project Root(
$CWD/*.md):根级文档,如 README.md(选择加入)
YAML 前件支持
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Local Docs MCP Server

Implementation of the Model Context Protocol (MCP) server for local documentation access. Provides Claude with seamless access to markdown documentation from multiple sources.
Features
- Multi-source documentation: Access docs from commands, project docs, and project root
- Smart search: Fuzzy matching with exact/substring match priority
- YAML frontmatter support: Optional metadata for enhanced search (description, tags)
- Always-on caching: File list caching with automatic invalidation on changes (~3000x faster)
- File watching: Automatic cache invalidation when documentation files change
- Safe path handling: Prevents directory traversal and validates paths
- Source prefixes: Explicitly specify documentation source (e.g.,
commands:file.md) - Size limits: Prevents reading files larger than 5MB
Documentation Sources
- Shared Docs (
~/.claude/commands/**/*.md): User commands and knowledge bases (configurable) - Project Docs (
$CWD/docs/**/*.md): Project-specific documentation with configurable exclusions - Project Root (
$CWD/*.md): Root-level docs like README.md (opt-in)
YAML Frontmatter Support
Documentation files can optionally include YAML frontmatter for enhanced searchability:
---
description: Enforce Test-Driven Development approach for Go code with test-first workflow
tags: [testing, development, go]
---
# Your Documentation Content
Supported fields:
description: Text description used to boost search relevancetags: Array or comma-separated list of tags for categorization
Search behavior:
- Description matches add +0.5 to search score
- Exact tag matches add +0.3 to search score
- Partial tag matches add +0.15 to search score
- Frontmatter is automatically stripped from
read_docoutput list_all_docsincludes description and tags in file metadata
Note: Frontmatter is completely optional - plain markdown files work perfectly without it.
Installation
Download Binary
Download the latest release from the releases page.
Using Go
go install github.com/umputun/local-docs-mcp/app@latest
Using Homebrew (macOS)
brew tap umputun/apps
brew install umputun/apps/local-docs-mcp
Build from Source
git clone https://github.com/umputun/local-docs-mcp.git
cd local-docs-mcp
make build
make install
Configure Claude
Add to ~/.claude.json:
{
"mcpServers": {
"local-docs": {
"command": "local-docs-mcp"
}
}
}
Or use absolute path:
{
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"local-docs": {
"command": "local-docs-mcp"
}
}
}