Skip to main content
Glama

Wikidata MCP Server

by zzaebok

Wikidata MCP サーバー

モデルコンテキストプロトコル(MCP)を用いたWikidata APIのサーバー実装。このプロジェクトは、識別子(エンティティとプロパティ)の検索メタデータ(ラベルと説明)の抽出SPARQLクエリの実行など、Wikidataを操作するためのツールを提供します。


インストール

Smithery経由でインストール

Smithery経由で Claude Desktop 用の Wikidata MCP サーバーを自動的にインストールするには:

npx -y @smithery/cli install @zzaebok/mcp-wikidata --client claude
手動でインストールする

まだインストールされていない場合はuvをインストールしてください。

$ curl -LsSf https://astral.sh/uv/install.sh | sh

次に、依存関係をインストールします。

$ git clone https://github.com/zzaebok/mcp-wikidata.git $ cd mcp-wikidata $ uv sync # if you want to run client example together $ uv sync --extra example

走る

次のコマンドでサーバーを実行します。

$ uv run src/server.py

単純なクライアント コード ( langchain-mcp-adaptersを使用) でテストする場合は、次のコマンドでクライアントを実行します。

# in another shell $ uv run src/client.py

LLM は有効なエンティティおよびプロパティ識別子を抽出し、Sparql クエリを実行し、最終的にポン・ジュノ監督の映画を推奨します。

{ "messages": [ HumanMessage( content="Can you recommend me a movie directed by Bong Joonho?", ), AIMessage( tool_calls=[ { "name": "search_entity", "args": {"query": "Bong Joon-ho"}, } ], ), ToolMessage( content="Q495980", name="search_entity", ), AIMessage( tool_calls=[ { "name": "get_properties", "args": {"entity_id": "Q495980"}, } ], ), ToolMessage( content='["P345", "P244", "P214", "P227", ...]', name="get_properties", ), AIMessage( tool_calls=[ { "name": "search_property", "args": {"query": "director"}, } ], ), ToolMessage( content="P57", name="search_property", ), AIMessage( tool_calls=[ { "name": "execute_sparql", "args": { "sparql_query": 'SELECT ?film ?filmLabel WHERE {\n ?film wdt:P57 wd:Q495980.\n SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }\n} LIMIT 1' }, } ], ), ToolMessage( content='[{"film": {"type": "uri", "value": "http://www.wikidata.org/entity/Q483761"}, "filmLabel": {"xml:lang": "en", "type": "literal", "value": "Mother"}}]', name="execute_sparql", ), AIMessage( content='I recommend the movie "Mother," which was directed by Bong Joon-ho.', ), ] }

Wikidata MCPツール

サーバーには次のツールが実装されています。

道具説明
search_entity(query: str)クエリで Wikidata エンティティ ID を検索します。
search_property(query: str)クエリで Wikidata プロパティ ID を検索します。
get_properties(entity_id: str)指定された Wikidata エンティティ ID に関連付けられたプロパティを取得します。
execute_sparql(sparql_query: str)Wikidata で SPARQL クエリを実行します。
get_metadata(entity_id: str, language: str = "en")指定された Wikidata エンティティ ID の英語のラベルと説明を取得します。

ライセンス

MITライセンス

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

モデル コンテキスト プロトコルを使用して Wikidata API と対話するためのサーバー実装。識別子の検索、メタデータの抽出、SPARQL クエリの実行のためのツールを提供します。

  1. インストール
    1. Smithery経由でインストール
    2. 手動でインストールする
  2. 走る
    1. Wikidata MCPツール
      1. ライセンス

    Related MCP Servers

    • -
      security
      A
      license
      -
      quality
      Enables programmatic interaction with Wikimedia APIs, offering features like searching content, retrieving page information, and accessing historical events across multiple languages.
      Last updated -
      6
      2
      Python
      MIT License
      • Apple
    • -
      security
      F
      license
      -
      quality
      A Model Context Protocol server utilizing Claude AI for generating intelligent queries and offering documentation assistance based on API documentation analysis.
      Last updated -
      3
      2
      TypeScript
    • -
      security
      A
      license
      -
      quality
      A Model Context Protocol server that enables Large Language Models to seamlessly interact with ClickHouse databases, supporting resource listing, schema retrieval, and query execution.
      Last updated -
      1
      Python
      MIT License
      • Linux
      • Apple
    • A
      security
      F
      license
      A
      quality
      A Model Context Protocol server that enables searching, reading, and editing wiki pages on Wizzypedia from MCP-enabled tools like Cursor or Claude Desktop.
      Last updated -
      6
      JavaScript
      • Apple

    View all related MCP servers

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/zzaebok/mcp-wikidata'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server