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)
- [Steps](#steps)
- [5. Directory Structure](#5-directory-structure)
- [6. License](#6-license)
- [7. Notes](#7-notes)
- [8. Contact Us](#8-contact-us)
## 1. Overview
This is the MCP (Model Context Protocol) server (alpha version) that connects to the user-oriented API provided by the [National Land and Transportation Data Platform](https://www.mlit-data.jp/), which integrates data held by the Ministry of Land, Infrastructure, Transport and Tourism and private entities, allowing for centralized search, display, and download.
By utilizing this MCP server, it becomes possible to directly interact with large language models (LLM) and intuitively search for and retrieve data in a conversational format. Even without specialized knowledge of APIs, anyone can easily search for and obtain data from the National Land and Transportation Data Platform using vague instructions or complex condition settings, offering a new way to utilize data.
## 2. Main Features
Utilizing the user API of the National Land and Transportation Data Platform, the following features are provided:
* `search` (Searches for data based on specified keywords. Sorting and specifying the number of results are also possible.)
* `search_by_location_rectangle` (Searches for data that intersects with the specified rectangular area.)
* `search_by_location_point_distance` (Searches for data that intersects with a circular area defined by a specified point and radius.)
* `search_by_attribute` (Searches for data by specifying attributes such as catalog name, dataset name, prefecture, and municipality.)
* `get_data` (Retrieves detailed information about the data.)
* `get_data_summary` (Retrieves basic information about the data, such as data ID and title.)
* `get_data_catalog` (Retrieves detailed information about the data catalog and datasets.)
* `get_data_catalog_summary` (Retrieves basic information about the data catalog and datasets, such as ID and title.)
* `get_file_download_urls` (Retrieves download URLs for files (valid for 60 seconds).)
* `get_zipfile_download_url` (Retrieves a download URL for multiple files packaged in ZIP format (valid for 60 seconds).)
* `get_thumbnail_urls` (Retrieves URLs for thumbnail images (valid for 60 seconds).)
* `get_all_data` (Bulk retrieves a large amount of data that matches the conditions.)
* `get_count_data` (Retrieves the count of data that matches the conditions.)
* `get_suggest` (Retrieves suggestions during keyword searches.)
* `get_prefecture_data` (Retrieves a list of prefecture names and codes.)
* `get_municipality_data` (Retrieves a list of municipality names and codes.)
* `get_mesh` (Retrieves data contained within the specified mesh.)
* `normalize_codes` (Normalizes the input prefecture names and municipality names.)
## 3. Operating Environment
* OS: Windows 10 / 11 or macOS 13 and later
* MCP Host: such as Claude Desktop
* MCP Server Runtime Environment: Python 3.10+
* Memory: Recommended 8GB or more
* Storage: At least 1GB of free space (including cache and logs)
## 4. Installation and Setup
### Prerequisites
It is assumed that MCP-compatible AI applications such as Claude Desktop and Python are installed. The following steps are intended for use with Claude Desktop.
### Steps
1. **Create an account on the National Land Transportation Data Platform and obtain an API key**
For detailed instructions, please refer to [here](https://www.mlit-data.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 the dependency libraries**
```bash
pip install -e .
pip install aiohttp pydantic tenacity python-json-logger mcp python-dotenv
```
5. **Set environment variables**
Copy `.env.example` to create a `.env` file:
```
MLIT_API_KEY=your_api_key_here
MLIT_BASE_URL=https://www.mlit-data.jp/api/v1/
```
Alternatively, you can set them directly from the command line:
```bash
export MLIT_API_KEY=your_api_key_here
export MLIT_BASE_URL=https://www.mlit-data.jp/api/v1/
```
Make sure to 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 for Claude Desktop**
* **Windows:** `C:\Users\<username>\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's settings screen.
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://www.mlit-data.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 & Configuration Validation
│ └─ utils.py # Logging, Timer, Rate Limiting
├─ pyproject.toml
├─ README.md
└─ LICENSE
```
## 6. License
* This repository is provided under the MIT License. Please refer to the [License](./LICENSE).
## 7. Notes
* The use of data provided in this repository must comply with the [Terms of Use of the National Land Transportation Data Platform](https://www.mlit-data.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). Please be sure to check the Terms of Use of the National Land Transportation Data Platform before use.
* The handling of personal information in this repository complies with the [Privacy Policy of the National Land Transportation Data Platform](https://www.mlit-data.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%9D%E3%83%AA%E3%82%B7%E3%83%BC.pdf).
* This repository is provided as an alpha version. No guarantees are made regarding its operation.
* The contents of this repository may change or be deleted without notice.
* The Ministry of Land, Infrastructure, Transport and Tourism and the National Land Transportation Data Platform shall not be liable for any losses or damages arising from the use of this repository.
## 8. Contact Us
This repository is in alpha version. If you have any comments or concerns, please contact us using the inquiry form below.
* [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 MCP
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Sequential Thinking
A structured MCP server for dynamic problem-solving and reflective thinking.
Fetch
Retrieve and process content from web pages by converting HTML into markdown format.
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.