MLIT Data Platform MCP Server
MCP server for the MLIT Data Platform that enables natural language search and retrieval of Japanese government infrastructure and transport data.
README
MLIT DATA PLATFORM MCP Server
目次
1. 概要
国土交通省が保有するデータと民間等のデータを連携し、一元的に検索・表示・ダウンロードを可能にする国土交通データプラットフォームが提供する利用者向けAPIと接続するMCP (Model Context Protocol) サーバー(α版)です。
本MCPサーバーを利用することで、大規模言語モデル(LLM)と直接連携し、対話形式で直感的にデータを検索・取得することが可能になります。APIに関する専門的な知識がなくても、誰でも簡単に国土交通データプラットフォームから曖昧な指示や複雑な条件設定でデータを検索・取得が可能な、新しいデータ活用のかたちを提供します。
2. 主な機能
国土交通データプラットフォームの利用者向けAPIを活用し、以下の機能を提供します:
search(キーワードの指定によりデータを検索します。並べ替えや件数の指定も可能です。)search_by_location_rectangle(指定した矩形範囲と交差するデータを検索します。)search_by_location_point_distance(指定した地点と半径からなる円形範囲と交差するデータを検索します。)search_by_attribute(カタログ名、データセット名、都道府県、市区町村などの属性を指定してデータを検索します。)get_data(データの詳細情報を取得します。)get_data_summary(データIDとタイトルなどのデータの基本情報を取得します。)get_data_catalog(データカタログやデータセットの詳細情報を取得します。)get_data_catalog_summary(IDやタイトルなどのデータカタログやデータセットの基本情報を取得します。)get_file_download_urls(ファイルのダウンロード用URLを取得します(有効期限:60秒)。)get_zipfile_download_url(複数ファイルをZIP形式でまとめたダウンロードURLを取得します(有効期限:60秒)。)get_thumbnail_urls(サムネイル画像のURLを取得します(有効期限:60秒)。)get_all_data(条件に一致する大量のデータを一括取得します。)get_count_data(条件に一致するデータ件数を取得します。)get_suggest(キーワード検索時の候補を取得します。)get_prefecture_data(都道府県名・コードの一覧を取得します。)get_municipality_data(市区町村名・コードの一覧を取得します。)get_mesh(指定したメッシュに含まれるデータを取得します。)normalize_codes(入力された都道府県名・市区町村名を正規化します。)
3. 動作環境
- OS:Windows 10 / 11 または macOS 13以降
- MCPホスト:Claude Desktopなど
- MCPサーバー実行環境:Python 3.10+
- メモリ:8GB以上推奨
- ストレージ:空き容量 1GB以上(キャッシュやログを含む)
4. インストールとセットアップ
前提条件
Claude DesktopなどのMCP対応AIアプリケーション および Python がインストールされていることを前提としています。以下は、Claude Desktopでの利用を想定した手順です。
手順
-
国土交通データプラットフォームでアカウントを作成し、APIキーを取得
詳しい手順は、こちらをご覧ください。
-
リポジトリをクローン
git clone https://github.com/MLIT-DATA-PLATFORM/mlit-dpf-mcp.git cd mlit-dpf-mcp -
仮想環境を作成 & 有効化
python -m venv .venv .venv\Scripts\activate # Windows source .venv/bin/activate # macOS/Linux -
依存ライブラリをインストール
pip install -e . pip install aiohttp pydantic tenacity python-json-logger mcp python-dotenv -
環境変数を設定
.env.exampleをコピーし、.envファイルを作成します:MLIT_API_KEY=your_api_key_here MLIT_BASE_URL=https://data-platform.mlit.go.jp/api/v1/あるいはコマンドラインから直接設定することも可能です:
export MLIT_API_KEY=your_api_key_here export MLIT_BASE_URL=https://data-platform.mlit.go.jp/api/v1/your_api_key_hereは必ず、手順1で取得したAPIキーに置き換えてください。 -
MCP サーバーの起動
python -m src.server -
Claude Desktopの設定ファイルを開く
- Windows:
C:\Users\<ユーザー名>\AppData\Roaming\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Claude Desktopアプリの設定画面にある「開発者」メニューの「設定を編集」ボタンをクリックして
claude_desktop_config.jsonを開くことも可能です。
- Windows:
-
MCPサーバーの構成を追加
{ "mcpServers": { "mlit-dpf-mcp": { "command": "......./mlit-dpf-mcp/.venv/Scripts/python.exe", "args": [ "....../mlit-dpf-mcp/src/server.py" ], "env": { "MLIT_API_KEY": "your_api_key_here", "MLIT_BASE_URL": "https://data-platform.mlit.go.jp/api/v1/", "PYTHONUNBUFFERED": "1", "LOG_LEVEL": "WARNING" } } } }commandとargsは必ず、実際のパスに変更してください。
your_api_key_hereは必ず、手順1で取得したAPIキーに置き換えてください。 -
Claude Desktop を再起動
5. ディレクトリ構成
mlit-dpf-mcp/
├─ src/
│ ├─ server.py # MCP サーバー & ツール定義
│ ├─ client.py # MLIT GraphQL API クライアント
│ ├─ schemas.py # Pydantic モデル(入力バリデーション)
│ ├─ config.py # 環境変数ロード & 設定検証
│ └─ utils.py # ロギング、タイマー、レート制限
├─ pyproject.toml
├─ README.md
└─ LICENSE
6. ライセンス
- 本リポジトリはMITライセンスで提供されています。ライセンスを参照してください。
7. 注意事項
- 本リポジトリで提供されるデータの利用に関しては、 国土交通データプラットフォームの利用規約に従う必要があります。ご使用前に国土交通データプラットフォームの利用規約を必ずご確認ください。
- 本リポジトリの個人情報の取り扱いは、国土交通データプラットフォームのプライバシーポリシーに準拠しております。
- 本リポジトリはα版として提供しているものです。動作保証は行っておりません。
- 本リポジトリの内容は予告なく変更・削除する可能性があります。
- 本リポジトリの利用により生じた損失及び障害等について、国土交通省及び国土交通データプラットフォームはいかなる責任も負わないものとします。
8. お問い合わせ
本リポジトリはα版です。お気づきの点があれば下記お問い合わせフォームまでご連絡下さい。
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.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.