図書館検索 MCP サーバー

by kzk-maeda

190 downloads
Not rated
GitHub

About

図書館検索 MCP サーバー uses the Calil API to enable AI assistants like Claude to search and retrieve library information across Japan. Designed for developers, it provides tools to query libraries by prefecture and fetch basic details such as names and locations.

Details

Author
kzk-maeda
Downloads
190
Categories
Search

- Search libraries by prefecture name.
- Retrieve library name and location.
- Tool-callable by AI assistants.
- Simple CLI for local testing.

Install Node.js v16+, obtain a Calil API key, then clone the repository. Run npm install, create a .env file with CALIL_APPLICATION_KEY, build with npm run build, and start with npm start. For Claude Desktop, add the server entry to claude_desktop_config.json as shown in the README.

図書館検索 MCP サーバー

Calil API を利用した図書館検索のための MCP (Model Context Protocol) サーバーです。このサーバーを使用することで、Claude などのAIアシスタントが日本全国の図書館情報に直接アクセスできるようになります。

機能

- 都道府県名から図書館情報を検索
- 図書館名や所在地などの基本情報を取得
- AIアシスタントがツールとして利用可能

使用方法

前提条件

- Calil API キーの取得 (https://calil.jp/api/dashboard/)
- Node.js v16 以上

ローカル実行

1. 依存関係のインストール:

npm install

2. 環境変数の設定:
.envファイルを作成し、以下の内容を追加:

CALIL_APPLICATION_KEY=あなたのCalilAPIキー

3. プロジェクトのビルド:

npm run build

4. サーバーの起動:

npm start

Claude Desktop での設定

Claude Desktop の設定ファイル(通常は~/.config/Claude Desktop/claude_desktop_config.json)に以下のエントリを追加してください:

{
  "mcpServers": {
    "book-search": {
      "command": "node",
      "args": [
        "/absolute/path/to/dist/index.js"
      ],
      "env": {
        "CALIL_APPLICATION_KEY": "あなたのCalilAPIキー"
      }
    }
  }
}

接続テスト

サーバーが正しく動作していることを確認するには、以下のコマンドを実行してください:

npm test

このテストでは以下の機能が検証されます:
- Calil API への接続
- 図書館情報の取得
- ツール呼び出しの処理

使用可能なツール

このMCPサーバーでは、以下のツールが利用可能です:

get_libraries_by_prefecture

指定した都道府県内の図書館情報を検索します。

引数:
- prefecture: 都道府県名(例: 「東京都」「大阪府」)

戻り値:
都道府県内の図書館システムと図書館情報のリスト

search_books

(現在はプレースホルダー実装)書籍を検索します。

引数:
- query: 検索キーワード

制限事項

- 現在、図書館情報の検索のみが実装されています
- 書籍検索機能は将来のバージョンで実装予定

ライセンス

MIT

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.