lod-mcp-jp
Provides tools for searching and querying Wikidata via its SPARQL endpoint, retrieving entity details, and finding links between Wikidata and other linked open data datasets.
lod-mcp-jp
日本のLinked Open Dataを、ClaudeなどのLLMから検索するためのMCPサーバーです。SPARQLエンドポイントごとのデータ構造、検索方法、動作確認済みのクエリ例、出典の書き方を収録していて、LLMはそれを参照してからクエリを書きます。
対応データ
id | データ | エンドポイント |
textbook | 教科書LOD | |
jp-cos | 学習指導要領LOD | |
ndla | Web NDL Authorities(国立国会図書館典拠データ) | |
jps | ジャパンサーチ | |
dbpedia-ja | DBpedia Japanese | |
madb | メディア芸術データベース | |
wikidata | Wikidata |
データを追加するときは、src/datasets.jsに1件書き足します。
Related MCP server: mcp-toolserver
ツール
ツール | 内容 |
list_datasets | 対応データの一覧と、ライセンス・出典の書き方を返す |
describe_dataset | 接頭辞、クラスと件数、検索時の注意、クエリ例を返す |
describe_class | 指定したクラスのプロパティと、値の例を返す |
search | キーワードで検索する。 |
get_resource | URIを1つ指定すると、そのプロパティと値を返す。値がURIのものには名前を付け、空白ノード(別名の表記と読み、掲載ページなど)は内容まで返す |
find_links | URIを1つ指定すると、ほかのデータへのリンクと、ほかのデータからそのURIを参照しているものを名前付きで返す。WikidataのP349のように、ほかのデータのIDが文字列で入っているものも調べる |
sparql | SELECTかASKのクエリを1つのデータに送る |
どのツールも読み取り専用で、データを書き換えることはありません。同じクエリの結果は30分間保存して使い回します。
MCPサーバーは、接続したLLMに使い方の説明(src/tools.jsのINSTRUCTIONS)を渡します。質問の内容ごとにどのデータを使うかと、文章の質問を分けて検索する手順、一覧や件数の質問はsparqlの集計で1回にまとめること、データをまたいで突き合わせる方法を書いています。
質問の例
次のような質問に、複数のデータを検索して答えます。
夏目漱石の作品で、いまの中学・高校の国語の教科書に載っているのはどれ?それぞれ何年に発表された作品?(教科書LOD、Wikidata)
小学4年の国語で「ごんぎつね」を学ぶと、学習指導要領ではどんな力を身につけることになっている?(教科書LOD、学習指導要領LOD)
手塚治虫が原作のテレビアニメを、放送が始まった順に10作品並べて(メディア芸術データベース)
ジャパンサーチにある葛飾北斎の版画のうち、制作年が分かるものを古い順に教えて(ジャパンサーチ)
国立国会図書館の件名「人形劇」の上位語と下位語を調べて、関連する資料をジャパンサーチで探して(Web NDL Authorities、ジャパンサーチ)
使い方
Node.js 18以上が必要です。
git clone https://github.com/Subara3/lod-mcp-jp.git
cd lod-mcp-jp
npm installClaude Codeに追加するときは、次のコマンドを実行します。
claude mcp add lod -- node /path/to/lod-mcp-jp/src/server.jsClaude Desktopに追加するときは、claude_desktop_config.jsonに次の設定を書き足します。
{
"mcpServers": {
"lod": { "command": "node", "args": ["/path/to/lod-mcp-jp/src/server.js"] }
}
}ブラウザで試すページ
site/index.htmlでは、次のことができます。
Claudeに質問する。自分のAnthropic APIキーを入力する方法と、審査用パスワードを入力する方法があります
キーワードで検索し、結果の内容と、ほかのデータとのリンクをたどる
「MCPのツールを試す」で、LLMが使うのと同じツールを引数を指定して実行し、LLMが受け取る結果をそのまま確認する
公開しているページは https://lod-mcp-jp.subara3.workers.dev/ です。手元で開くときは、このフォルダで次のコマンドを実行し、http://localhost:8767/site/ を開きます。
python -m http.server 8767自分のAPIキーで質問するときは、ブラウザからClaude APIを直接呼び出します。そのためにAnthropicのSDKを1ファイルにまとめたものをsite/vendor/anthropic.jsに置いています。SDKを更新したときは、次のコマンドで作り直します。
npm run vendorテスト
node test/smoke.mjs # 共通の関数と、クエリ例
node test/mcp.mjs # MCPのクライアントからツールを実行する
node test/chat.mjs # Claudeへの質問の処理(Claude APIには接続しない)
node test/endpoints.mjs # 7つのSPARQLエンドポイントに、各データの最初のクエリ例を送るsmoke.mjs、mcp.mjs、endpoints.mjsは、実際のエンドポイントにクエリを送ります。
.github/workflows/check.ymlは、毎日日本時間の6時に、公開しているMCPサーバー(test/remote.mjs)と7つのエンドポイント(test/endpoints.mjs)を確かめます。
リモート版
worker/index.jsは、同じツールをCloudflare Workersで動かすものです。
パス | 内容 |
/ | ブラウザで試すページ |
/mcp | MCPサーバー(Streamable HTTP)。パスワードなしで使える。Claudeのカスタムコネクタや、ChatGPTのカスタムMCPサーバー(認証なし)に、このURLを追加する |
/chat | 審査用。パスワードを知っている人が、Workerに登録したAPIキーでClaudeに質問できる |
/usage | 審査用の利用枠の残りを返す(パスワードが必要) |
/chatは、Claude APIのMCPコネクタに/mcpのURLを渡して、Claudeにツールを実行させます。利用額と質問の回数をKVに記録し、wrangler.tomlのBUDGET_USD(合計の米ドル)かDAILY_LIMIT(1日の質問の回数)に達すると、/chatは質問を受け付けなくなります。
デプロイするには、まず次の2つを実行します。
npx wrangler login
cp .secrets.example .secrets.secretsを開いてANTHROPIC_API_KEYとJUDGE_PASSWORDに値を入力してから、次を実行します。
bash scripts/deploy.sh共有用の画像(site/og.png)とファビコン(site/favicon.svg)は、python scripts/make-og.pyで作ります(Pillowが必要です)。
deploy.shは、scripts/build-site.mjsでsite/index.htmlと必要なファイルをdist/にまとめてから、Workerと一緒に公開します。公開したページは、同じWorkerの/mcpと/chatを使います。
リモート版のテストは次の2つです。
node test/worker.mjs # Workerの入口をNodeから実行する
node test/remote.mjs https://(WorkerのURL) # 動いているWorkerのMCPに接続するライセンス
このリポジトリのコードは、MIT No Attribution(MIT-0)で公開します。著作権表示を残さずに、自由に使用・改変・再配布できます。全文はLICENSEにあります。
site/vendor/anthropic.jsは、Anthropic SDK(@anthropic-ai/sdk)を1ファイルにまとめたもので、Apache License 2.0に従います(site/vendor/LICENSE-anthropic-sdk.txt)。1.0.0より前の版と、それまでに取り込まれた寄稿にはMIT Licenseが適用されます(site/vendor/LICENSE-MIT-anthropic-sdk.txt)。
ツールが取得するデータの利用条件は、データごとに異なります。list_datasetsの結果とページの「対応データ」の表に、それぞれの利用条件と出典の書き方を載せています。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only MCP tools for AI agent discovery, structured resources, and NIULAI information.
12 read-only MCP tools for AI communication rules, instruction linting & 25-model benchmarks.
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Summon Japan: one MCP endpoint for free Japan data tools and human hands for physical tasks.
Related MCP Servers
- AlicenseBqualityDmaintenanceThis MCP server provides 16 intelligent tools for searching, retrieving, and linking biomedical literature from PubMed and PMC. It enables LLM applications to perform complex queries, batch processing, and cross-database linking.168MIT
- FlicenseNot gradedqualityDmaintenanceEnables document search, read-only SQL querying, arithmetic calculation, and corpus introspection through MCP tools, allowing Claude to dynamically discover and chain these tools together to answer multi-step questions.-
- AlicenseNot gradedqualityBmaintenanceEnables Claude/ChatGPT users to cross-search Japanese policy documents and official statistics, providing policy recommendations from economic organizations/government and exact statistical values with sources via read-only MCP tools.2Apache 2.0

web-algebra-mcpofficial
AlicenseBqualityBmaintenanceEnables AI agents to load, query, and write RDF Linked Data and execute SPARQL operations through composable MCP tools, including LinkedDataHub-specific resource creation. Supports compiling complex workflows into atomic JSON operation plans for efficient multi-step execution.3457 PyPI57Apache 2.0