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. Disclaimer](#7-disclaimer)
- [8. Contact](#8-contact)
## 1. Overview
This is an MCP (Model Context Protocol) server (alpha version) that connects to the user-oriented API provided by the [MLIT DATA PLATFORM](https://data-platform.mlit.go.jp/), which enables integrated search, display, and download by linking data held by the Ministry of Land, Infrastructure, Transport and Tourism with data from the private sector.
By using this MCP server, it becomes possible to directly link with Large Language Models (LLM) and intuitively search and acquire data in a conversational format. It provides a new form of data utilization that allows anyone to easily search and acquire data from the MLIT DATA PLATFORM with ambiguous instructions or complex condition settings, without requiring specialized knowledge of APIs.
## 2. Main Features
Utilizing the user-oriented API of the MLIT DATA PLATFORM, the following functions are provided:
* `search` (Search for data by specifying keywords. Sorting and specifying the number of results are also possible.)
* `search_by_location_rectangle` (Search for data that intersects with the specified rectangular range.)
* `search_by_location_point_distance` (Search for data that intersects with a circular range consisting of the specified point and radius.)
* `search_by_attribute` (Search for data by specifying attributes such as catalog name, dataset name, prefecture, and municipality.)
* `get_data` (Get detailed information about the data.)
* `get_data_summary` (Get basic information about the data, such as data ID and title.)
* `get_data_catalog` (Get detailed information about data catalogs and datasets.)
* `get_data_catalog_summary` (Get basic information about data catalogs and datasets, such as ID and title.)
* `get_file_download_urls` (Get URLs for downloading files (valid for 60 seconds).)
* `get_zipfile_download_url` (Get a download URL that combines multiple files in ZIP format (valid for 60 seconds).)
* `get_thumbnail_urls` (Get URLs for thumbnail images (valid for 60 seconds).)
* `get_all_data` (Get a large amount of data that matches the conditions at once.)
* `get_count_data` (Get the number of data that matches the conditions.)
* `get_suggest` (Get candidates for keyword search.)
* `get_prefecture_data` (Get a list of prefecture names and codes.)
* `get_municipality_data` (Get a list of municipality names and codes.)
* `get_mesh` (Get data included in the specified mesh.)
* `normalize_codes` (Normalize the entered 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 of free space (including cache and logs)
## 4. Installation and Setup
### Prerequisites
It is assumed that an MCP-compatible AI application such as Claude Desktop and Python are installed. The following is a procedure assuming usage with Claude Desktop.
### Procedure
1. **Create an account on the MLIT DATA PLATFORM and obtain an API key**
For detailed instructions, please see [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 & Activate a virtual environment**
```bash
python -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # macOS/Linux
```
4. **Install dependencies**
```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 it 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/
```
Be sure to replace `your_api_key_here` with the API key you obtained in step 1.
6. **Start the MCP server**
```bash
python -m src.server
```
7. **Open the Claude Desktop 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 open `claude_desktop_config.json` by clicking the "Edit Settings" button in the "Developer" menu of the Claude Desktop app settings screen.
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"
}
}
}
}
```
Be sure to change `command` and `args` to the actual paths.
Be sure to replace `your_api_key_here` with the API key you 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 Verification
│ └─ utils.py # Logging, Timer, Rate Limiting
├─ pyproject.toml
├─ README.md
└─ LICENSE
```
## 6. License
* This repository is provided under the MIT license. See [License](./LICENSE).
## 7. Disclaimer
* Regarding the use of data provided in this repository, it is necessary to comply with the [Terms of Use of the MLIT 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). Please be sure to check the Terms of Use of the MLIT DATA PLATFORM before use.
* The handling of personal information in this repository complies with the [Privacy Policy of the MLIT 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%9D%E3%83%AA%E3%82%B7%E3%83%BC.pdf).
* This repository is provided as an alpha version. We do not guarantee its operation.
* The contents of this repository are subject to change or deletion without notice.
* The Ministry of Land, Infrastructure, Transport and Tourism and the MLIT DATA PLATFORM shall not be liable for any loss or damage caused by the use of this repository.
## 8. Contact
This repository is an alpha version. If you have any comments, please contact us using the inquiry form below.
* [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.
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.