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 (MLIT) provides the [MLIT Data Platform](https://data-platform.mlit.go.jp/), which enables integrated search, display, and download of data owned by MLIT and private sector data. This is an MCP (Model Context Protocol) server (alpha version) that connects to the user API provided by the MLIT Data Platform.
By using this MCP server, you can directly interact with large language models (LLMs) and intuitively search and retrieve data through conversational interfaces. Even without specialized knowledge of APIs, anyone can easily search and retrieve data from the MLIT Data Platform using ambiguous instructions or complex condition settings, providing a new form of data utilization.
## 2. Main Features
Utilizing the user API of the MLIT 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 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 MCP-compatible AI applications such as Claude Desktop and Python are installed. The following procedure assumes usage with Claude Desktop.
### Procedure
1. **Create an account on the MLIT Data Platform and obtain an API key**
For detailed procedures, 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**
Create a `.env` file by copying `.env.example`:
```
MLIT_API_KEY=your_api_key_here
MLIT_BASE_URL=https://data-platform.mlit.go.jp/api/v1/
```
Alternatively, you can set environment variables 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/
```
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 Claude Desktop's configuration file**
* **Windows:** `C:\Users\<username>\AppData\Roaming\Claude\claude_desktop_config.json`
* **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
* You can also click the "Edit Settings" button in the "Developer" menu of the Claude Desktop app to open `claude_desktop_config.json`.
8. **Add 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"
}
}
}
}
```
Make sure to change `command` and `args` to 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
* When using data provided in this repository, you must comply with the [MLIT Data Platform Terms of Use](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%A7%E3%82%B2%E5%88%A9%E7%94%A8%E8%A6%8F%E7%B4%84.pdf). Please ensure you have read and understood the terms before using.
* The handling of personal information in this repository complies with the [MLIT Data Platform Privacy Policy](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 guarantees are made.
* The contents of this repository may be changed or deleted without notice.
* The Ministry of Land, Infrastructure, Transport and Tourism and the MLIT Data Platform disclaim any responsibility for losses or damages arising from 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:
* [MLIT Data Platform Inquiry Form](https://docs.google.com/forms/d/e/1FAIpQLScHlMUInwpoyREX672SFJuwo8ZfpllQUatPuYNRiKYZkoe6nQ/viewform)
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
markitdown
Python tool for converting files and office documents 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.