my-docs-mcp-server
A lightweight MCP server that indexes and searches Markdown files in a specified directory, providing full-text search and file retrieval via the Model Context Protocol.
kbyk004
README
my-docs-mcp-server
概要
このMCPサーバーは、指定したディレクトリ配下のMarkdown(.md)ファイルを全文検索インデックス化し、MCPプロトコル経由で検索・参照できるMCPサーバーです。
- MCPの
tools
として全文検索(search_docs)を提供 - MCPの
resources
としてファイル全文取得(read_doc)を提供 - TypeScript製
技術スタック・実装技術
- TypeScript: サーバー本体の実装言語。
- @modelcontextprotocol/sdk: MCPサーバーのプロトコル実装・通信に利用。
- MiniSearch: Markdownファイルの全文検索インデックス作成・検索に利用。軽量で高速な全文検索ライブラリ。
- wakachigaki: 日本語テキストを分かち書き(トークナイズ)する軽量ライブラリ。MiniSearchのトークナイザとして利用し、日本語検索の精度を大幅に向上。
- fast-glob: docsディレクトリ配下のMarkdownファイルを再帰的に探索。
- Node.js標準のfs/promises, path: ファイル読み込みやパス操作。
- Stdioサーバー: MCPクライアント(Claude DesktopやInspector等)と標準入出力経由で通信。
セットアップ
- 依存パッケージのインストール
npm install
- docsディレクトリの作成とMarkdownファイルの配置
mkdir docs
# 例: サンプルファイル作成
echo "# サンプル\nこれはテストです。" > docs/sample.md
- TypeScriptビルド
npm run build
サーバーの起動方法
開発用(TypeScriptを直接実行)
npm run dev -- [docsディレクトリのパス]
# 例: npm run dev -- ./docs
本番用(ビルド済みで実行)
npm start -- [docsディレクトリのパス]
# 例: npm start -- ./docs
docsディレクトリのパス
は省略可能(省略時はdocs/
が使われます)
MCP Inspectorでの動作確認
MCP Inspectorを使うと、GUIでサーバーのtools/resourcesをテストできます。
npm run inspect -- [docsディレクトリのパス]
# 例: npm run inspect -- ./docs
またはビルド済みで:
npx -y @modelcontextprotocol/inspector node build/index.js ./docs
Claude Desktopでの利用例
- Claude Desktopの設定ファイル(例:
~/Library/Application Support/Claude/claude_desktop_config.json
)を開き、以下のようにサーバーを追加します。
{
"mcpServers": {
"docs-search": {
"command": "node",
"args": [
"/path/to/docs-search/build/index.js",
"/path/to/your-project/docs"
]
}
}
}
command
はnode
、args
にビルド済みサーバーのパスとdocsディレクトリのパスを指定してください。- パスは絶対パス推奨です。
- Claude Desktopを再起動すると、MCPツール一覧に
search_docs
が表示されます。
提供ツール・リソース
Tool: search_docs
- 概要: Markdownファイルを全文検索(日本語は分かち書きトークナイズで高精度検索)
- 入力:
query
(検索ワード, 必須)、limit
(最大件数, 省略可, デフォルト5) - 出力: 検索結果(ファイル名、パス、スニペット)
- 備考: 検索クエリ・本文ともにwakachigakiで分かち書きし、自然な日本語検索が可能です。
Resource: read_doc
- 概要: ファイル全文取得
- 入力:
filePath
(MCPリソースURI経由で指定) - 出力: ファイル全文
ログ
サーバーは主要な処理ごとに標準エラー出力(stderr)へ詳細なログを出力します。
ライセンス
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor

Linear MCP Server
A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.