Content
# MLIT DATA PLATFORM MCP Server
## Table of Contents
- [MLIT DATA PLATFORM MCP Server](#mlit-data-platform-mcp-server)
- [Table of Contents](#table-of-contents)
- [1. Overview](#1-overview)
- [2. Main Features](#2-main-features)
- [3. Operating Environment](#3-operating-environment)
- [4. Installation and Setup](#4-installation-and-setup)
- [Prerequisites](#prerequisites)
- [Procedure](#procedure)
- [5. Directory Structure](#5-directory-structure)
- [6. License](#6-license)
- [7. Precautions](#7-precautions)
- [8. Inquiry](#8-inquiry)
## 1. Overview
The Ministry of Land, Infrastructure, Transport and Tourism provides the [National Land and Transportation Data Platform](https://data-platform.mlit.go.jp/), which enables integrated search, display, and download of data owned by the Ministry and private sector data. This is an MCP (Model Context Protocol) server (alpha version) that connects to the user API provided by the National Land and Transportation Data Platform.
By using this MCP server, you can directly link with large language models (LLM) and interactively search and retrieve data in a conversational manner. Even without specialized knowledge of APIs, anyone can easily search and retrieve data from the National Land and Transportation Data Platform with ambiguous instructions or complex condition settings, providing a new form of data utilization.
## 2. Main Features
Utilizing the user API of the National Land and Transportation Data Platform, the following features are provided:
* `search` (search data by specifying keywords, with options for sorting and specifying the number of results)
* `search_by_location_rectangle` (search data intersecting with a specified rectangular range)
* `search_by_location_point_distance` (search data intersecting with a circular range consisting of a specified point and radius)
* `search_by_attribute` (search data by specifying attributes such as catalog name, dataset name, prefecture, and municipality)
* `get_data` (retrieve detailed information of data)
* `get_data_summary` (retrieve basic information of data such as data ID and title)
* `get_data_catalog` (retrieve detailed information of data catalogs and datasets)
* `get_data_catalog_summary` (retrieve basic information of data catalogs and datasets such as ID and title)
* `get_file_download_urls` (retrieve file download URLs with a validity period of 60 seconds)
* `get_zipfile_download_url` (retrieve a download URL for multiple files summarized in ZIP format with a validity period of 60 seconds)
* `get_thumbnail_urls` (retrieve thumbnail image URLs with a validity period of 60 seconds)
* `get_all_data` (retrieve a large amount of data that matches conditions in bulk)
* `get_count_data` (retrieve the number of data that matches conditions)
* `get_suggest` (retrieve candidates for keyword search)
* `get_prefecture_data` (retrieve a list of prefecture names and codes)
* `get_municipality_data` (retrieve a list of municipality names and codes)
* `get_mesh` (retrieve data included in a specified mesh)
* `normalize_codes` (normalize input prefecture and municipality names)
## 3. Operating Environment
* OS: Windows 10 / 11 or macOS 13 or later
* MCP Host: Claude Desktop, etc.
* MCP Server Execution Environment: Python 3.10+
* Memory: 8GB or more recommended
* Storage: 1GB or more free space (including cache and logs)
## 4. Installation and Setup
### Prerequisites
It is assumed that a Claude Desktop or other MCP-compatible AI application and Python are installed. The following procedure assumes usage with Claude Desktop.
### Procedure
1. **Create an account and obtain an API key on the National Land and Transportation Data Platform**
For detailed instructions, please refer to [here](https://data-platform.mlit.go.jp/api_docs/usage/introduction.html).
2. **Clone the repository**
```bash
git clone https://github.com/MLIT-DATA-PLATFORM/mlit-dpf-mcp.git
cd mlit-dpf-mcp
```
3. **Create and activate a virtual environment**
```bash
python -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # macOS/Linux
```
4. **Install dependent libraries**
```bash
pip install -e .
pip install aiohttp pydantic tenacity python-json-logger mcp python-dotenv
```
5. **Set environment variables**
Copy `.env.example` and create a `.env` file:
```
MLIT_API_KEY=your_api_key_here
MLIT_BASE_URL=https://data-platform.mlit.go.jp/api/v1/
```
Alternatively, you can set directly from the command line:
```bash
export MLIT_API_KEY=your_api_key_here
export MLIT_BASE_URL=https://data-platform.mlit.go.jp/api/v1/
```
Replace `your_api_key_here` with the API key obtained in step 1.
6. **Start the MCP server**
```bash
python -m src.server
```
7. **Open the configuration file of Claude Desktop**
* **Windows:** `C:\Users\<user_name>\AppData\Roaming\Claude\claude_desktop_config.json`
* **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
* You can also open `claude_desktop_config.json` by clicking the "Edit settings" button in the "Developer" menu of the Claude Desktop app.
8. **Add the MCP server configuration**
```json
{
"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"
}
}
}
}
```
Be sure to change `command` and `args` to the actual paths.
Replace `your_api_key_here` with the API key obtained in step 1.
9. **Restart Claude Desktop**
## 5. Directory Structure
```
mlit-dpf-mcp/
├─ src/
│ ├─ server.py # MCP server & tool definitions
│ ├─ client.py # MLIT GraphQL API client
│ ├─ schemas.py # Pydantic models (input validation)
│ ├─ config.py # Environment variable loading & setting verification
│ └─ utils.py # Logging, timer, rate limiting
├─ pyproject.toml
├─ README.md
└─ LICENSE
```
## 6. License
* This repository is provided under the MIT license. Please refer to [License](./LICENSE).
## 7. Precautions
* Regarding the use of data provided in this repository, please comply with the [Terms of Use of the National Land and Transportation Data Platform](https://data-platform.mlit.go.jp/assets/policy/%E5%9B%BD%E5%9C%9F%E4%BA%A4%E9%80%9A%E3%83%87%E3%83%BC%E3%82%BF%E3%83%97%E3%83%A9%E3%83%83%E3%83%88%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0%E5%88%A9%E7%94%A8%E8%A6%8F%E7%B4%84.pdf). Be sure to check the Terms of Use before using.
* The handling of personal information in this repository is in accordance with the [Privacy Policy of the National Land and Transportation Data Platform](https://data-platform.mlit.go.jp/assets/policy/%E5%9B%BD%E5%9C%9F%E4%BA%A4%E9%80%9A%E3%83%87%E3%83%BC%E3%82%BF%E3%83%97%E3%83%A9%E3%83%83%E3%83%88%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0_%E3%83%97%E3%83%A9%E3%82%A4%E3%83%90%E3%82%B7%E3%83%BC%E3%83%9E%E3%83%AA%E3%82%B7%E3%83%BC.pdf).
* This repository is provided as an alpha version. No operational guarantee is provided.
* The contents of this repository may be changed or deleted without notice.
* The Ministry of Land, Infrastructure, Transport and Tourism and the National Land and Transportation Data Platform shall not be responsible for any losses or damages incurred due to the use of this repository.
## 8. Inquiry
This repository is an alpha version. If you have any questions or concerns, please contact us using the following inquiry form:
* [National Land and Transportation Data Platform Inquiry Form](https://docs.google.com/forms/d/e/1FAIpQLScHlMUInwpoyREX672SFJuwo8ZfpllQUatPuYNRiKYZkoe6nQ/viewform)
Connection Info
You Might Also Like
markitdown
Python tool for converting files and office documents to Markdown.
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.