kbyk004
MCP Serverkbyk004publicArchived

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.

Repository Info

1
Stars
0
Forks
1
Watchers
0
Issues
TypeScript
Language
-
License

About This 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.

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

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等)と標準入出力経由で通信。

セットアップ

  1. 依存パッケージのインストール
npm install
  1. docsディレクトリの作成とMarkdownファイルの配置
mkdir docs
# 例: サンプルファイル作成
echo "# サンプル\nこれはテストです。" > docs/sample.md
  1. 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での利用例

  1. 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"
      ]
    }
  }
}
  • commandnodeargsにビルド済みサーバーのパスとdocsディレクトリのパスを指定してください。
  • パスは絶対パス推奨です。
  1. Claude Desktopを再起動すると、MCPツール一覧にsearch_docsが表示されます。

提供ツール・リソース

Tool: search_docs

  • 概要: Markdownファイルを全文検索(日本語は分かち書きトークナイズで高精度検索)
  • 入力: query(検索ワード, 必須)、limit(最大件数, 省略可, デフォルト5)
  • 出力: 検索結果(ファイル名、パス、スニペット)
  • 備考: 検索クエリ・本文ともにwakachigakiで分かち書きし、自然な日本語検索が可能です。

Resource: read_doc

  • 概要: ファイル全文取得
  • 入力: filePath(MCPリソースURI経由で指定)
  • 出力: ファイル全文

ログ

サーバーは主要な処理ごとに標準エラー出力(stderr)へ詳細なログを出力します。

ライセンス

MIT

Quick Start

1

Clone the repository

git clone https://github.com/kbyk004/my-docs-mcp-server
2

Install dependencies

cd my-docs-mcp-server
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerkbyk004
Repomy-docs-mcp-server
LanguageTypeScript
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation