e-Stat MCP server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@e-Stat MCP server2023年の東京都の人口統計を検索して"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
e-Stat MCP server
Model Context Protocol (MCP) サーバーで、日本の政府統計ポータルサイト「e-Stat」のAPIにアクセスするための機能を提供します。言語モデルが統計データを検索・取得できるようになります。
ツール
このサーバーは以下のツールを提供しています:
search_e_stat_tables: キーワードと調査年で統計表を検索しますget_e_stat_meta_info: 統計表IDに対応するメタ情報を取得しますget_specific_e_stat_data: 統計表IDまたはデータセットIDに対応する統計データを取得しますget_e_stat_ref_dataset: データセットの絞り込み条件等を参照しますget_e_stat_data_catalog: 統計表ファイルおよび統計データベースの情報を取得します
Related MCP server: houjin-bangou-api-mcp
使い方
このサーバーを使用するには、e-Stat APIのアプリケーションIDが必要です。以下の手順で取得できます:
e-Stat API機能にアクセス
ユーザ登録を行う
利用規約に同意してアプリケーションIDを取得
Claude Desktop
On MacOS:
~/Library/Application\ Support/Claude/claude_desktop_config.jsonOn Windows:
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"e-stat": {
"command": "uv",
"args": [
"--directory",
"/path/to/estat-mcp-server",
"run",
"server.py"
],
"env": {
"E_STAT_APP_ID": "YOUR_E_STAT_APP_ID"
}
}
}
}{
"mcpServers": {
"e-stat": {
"command": "uvx",
"args": [
"estat-mcp-server"
],
"env": {
"E_STAT_APP_ID": "YOUR_E_STAT_APP_ID"
}
}
}
}使用例
接続後、Claudeに以下のような質問ができます:
"2023年の東京都の人口統計を検索して"
"アイスクリームの需要に関する統計を取得して"
"都道府県別の高齢化率を比較して"
ライセンス
このプロジェクトはMITライセンスの下で提供されています
詳細はLICENSEファイルを参照してください。
Available Tools
5 toolsget_e_stat_data_catalogB
Retrieves the data catalog from the E-Stat API.
機能名:データカタログ情報取得
政府統計の総合窓口(e-Stat)で提供している統計表ファイルおよび統計データベースの情報を取得できます。
統計表情報取得機能同様に、リクエストパラメータの指定により条件を絞った情報の取得も可能です。
Args:
search_word (str): Search keyword for statistics tables.
Use "AND", "OR", or "NOT" to specify multiple words for search.
Examples:
- "東京 AND 人口"
- "東京 OR 大阪"
surveyYears (str): The survey years for the statistics tables.
Must be in one of the following formats:
- yyyy: Unified year.
- yyyymm: Unified month.
- yyyymm-yyyymm: Unified month range.
Example: "2023" or "202301-202312" or "202301"
startPosition (int, optional): Start position for the search results.
Defaults to 1. For example:
- To get the first 100 results, set startPosition to 1.
- To get the next 100 results, set startPosition to 101.
limit (int, optional): Maximum number of results to retrieve. Defaults to 100.
Example:
search_word = "東京 AND 人口"
surveyYears = "2023"
startPosition = 1
limit = 100
Returns:
str: The response text from the E-Stat API.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| search_word | Yes | ||
| surveyYears | Yes | ||
| startPosition | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses that it returns the API response text and explains parameter behavior, but it does not disclose the response structure, potential errors, rate limits, or whether it is a read-only operation. This is a significant gap for a tool with no annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is structured with headings (Args, Example, Returns) and is mostly concise. However, it includes redundant Japanese text that repeats the English purpose, slightly increasing length without adding new information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description explains the parameters well and includes pagination behavior, but it provides minimal return value details ('response text from the E-Stat API') without describing the format or content of the catalog. It also omits any constraints or error handling. For a moderate-complexity tool with no output schema, this is only partially complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has no descriptions (0% coverage), and the description fully compensates by explaining each parameter: search_word with AND/OR/NOT examples, surveyYears with format constraints, startPosition with pagination examples, and limit with default value. It also provides a combined usage example, adding substantial meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states it 'Retrieves the data catalog from the E-Stat API' with a specific verb and resource. It also explains it can retrieve information about statistical table files and databases, which is clear. However, it does not explicitly differentiate from sibling tools like search_e_stat_tables, so it misses full differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description says 'Similar to the statistical table information acquisition function, it is also possible to obtain information narrowed down by request parameters,' but it does not state when to use this tool versus alternatives. There is no explicit guidance on when to choose this catalog tool over sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_e_stat_meta_infoA
Retrieves meta information from the E-Stat API.
機能名:メタ情報取得
指定した統計表IDに対応するメタ情報(表章事項、分類事項、地域事項等)を取得します。
Args:
stats_data_id (str): The ID of the statistics data(統計表ID).
Example: "0000010201".
Returns:
str: The response text from the E-Stat API.
| Name | Required | Description | Default |
|---|---|---|---|
| stats_data_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It indicates a read-only retrieval from an external API and specifies the return type as a string. It lacks details on authentication, rate limits, or potential errors, so it is minimally adequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is structured with clear sections but is somewhat redundant due to repeating the same information in English and Japanese. The front-loaded summary is good, but every sentence does not earn its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter tool with no output schema, the description covers the essential purpose, parameter, and return type. It could include error handling or response format details, but is reasonably complete for a straightforward API wrapper.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The only parameter, stats_data_id, is explained beyond the schema with a description and example (e.g., '0000010201'). This compensates for the 0% schema description coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves meta information from the E-Stat API based on a stats_data_id, listing the types of meta info (table, classification, regional). This distinguishes it from sibling tools that search tables or get specific data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by specifying it operates on a given statistics table ID, making it clear this is for fetching metadata for a specific table. However, it does not explicitly mention alternatives or when not to use this tool, so a perfect score is not warranted.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_e_stat_ref_datasetC
Retrieves the reference dataset from the E-Stat API.
機能名:データセット参照
登録されているデータセットの絞り込み条件等を参照します。
データセットIDが指定されていない場合は、利用者が使用できるデータセットの一覧が参照可能です。
Args:
data_set_id (str): The ID of the dataset to retrieve(データセットID).
Returns:
str: The response text from the E-Stat API.
| Name | Required | Description | Default |
|---|---|---|---|
| data_set_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full responsibility for behavioral transparency. It mentions that omitting the dataset ID yields a list, but this contradicts the schema's required parameter. Additionally, it does not disclose authentication needs, rate limits, or any details about the response structure beyond 'response text from the E-Stat API.'
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is moderately sized but includes redundant bilingual content (English and Japanese) that adds length without much new information. The Args/Returns structure is clear, but the Japanese section could be condensed to improve conciseness for an English-speaking agent.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no output schema and no annotations, so the description must explain return values and edge cases. It only says the return is a string of response text from the E-Stat API, omitting details on response structure, error handling, or the conflict between the optional dataset ID behavior and the required schema field. This leaves the tool inadequately specified.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema coverage, the description must compensate for the parameter, but it only states 'The ID of the dataset to retrieve' and provides a Japanese translation. It implies the dataset ID is optional in one scenario while the schema marks it required, creating confusion. It does not explain where to obtain the ID or expected format.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves a reference dataset from the E-Stat API and explains its function (referring to registered dataset filtering conditions). It also distinguishes that omitting the dataset ID returns a list of available datasets. However, it does not explicitly differentiate from sibling tools like get_e_stat_data_catalog or search_e_stat_tables.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a usage scenario: if the dataset ID is not specified, a list of datasets available to the user can be referenced. However, it lacks explicit guidance on when to use this tool vs alternatives, such as search_e_stat_tables or get_e_stat_data_catalog, and does not mention any exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_specific_e_stat_dataA
Retrieves specific statistics data from the E-Stat API.
機能名:統計データ取得
指定した統計表ID又はデータセットIDに対応する統計データ(数値データ)を取得します。
Args:
data_set_id (str or None): The ID of the dataset(データセットID).
stats_data_id (str or None): The ID of the statistics data(統計表ID).
# Ensure that either data_set_id or stats_data_id is provided, but not both
if not data_set_id and not stats_data_id:
raise ValueError("Either 'data_set_id' or 'stats_data_id' must be provided.")
if data_set_id and stats_data_id:
raise ValueError("Only one of 'data_set_id' or 'stats_data_id' should be provided.")
startPosition (int): The starting position for the search results.
Defaults to 1. For example:
- To get the first 100 results, set startPosition to 1.
- To get the next 100 results, set startPosition to 101.
limit (int): The maximum number of results to retrieve.
Defaults to 100.
Returns:
str: The response text from the E-Stat API.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| data_set_id | No | ||
| startPosition | No | ||
| stats_data_id | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses the validation rule (exactly one of the two IDs), pagination via startPosition and limit, and the return type as a string. This goes beyond the schema, though it does not discuss error handling or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is structured but includes redundant Japanese and English text and embeds Python validation code, which adds unnecessary length. The core information is clear but could be more concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers parameter usage and pagination well, but it provides minimal detail on the response format (only 'response text') and no error or edge-case behavior. Given no output schema or annotations, this leaves some gaps for the agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description fully explains all four parameters: the two ID types, startPosition with an example for pagination, and limit. It also adds the critical constraint that exactly one ID must be provided, which is not in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves specific statistics data from the E-Stat API using a specific verb and resource. It distinguishes itself from sibling tools such as search_e_stat_tables and get_e_stat_meta_info by focusing on data retrieval by ID.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by requiring either data_set_id or stats_data_id, but it does not explicitly compare to sibling tools or state when not to use it. No exclusions or alternatives are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_e_stat_tablesA
Retrieves a list of statistics tables from the E-Stat API.
名称:統計表情報取得
政府統計の総合窓口(e-Stat)で提供している統計表の情報を取得します。
リクエストパラメータの指定により条件を絞った情報の取得も可能です。
Args:
search_word (str): Search keyword for statistics tables.
Use "AND", "OR", or "NOT" to specify multiple words for search.
Examples:
- "東京 AND 人口"
- "東京 OR 大阪"
surveyYears (str): Survey years for the statistics tables.
Must be in one of the following formats:
- yyyy: Unified year.
- yyyymm: Unified month.
- yyyymm-yyyymm: Unified month range.
Example: "2023" or "202301-202312" or "202301"
startPosition (int, optional): Start position for the search results.
Defaults to 1. For example:
- To get the first 100 results, set startPosition to 1.
- To get the next 100 results, set startPosition to 101.
limit (int, optional): Maximum number of results to retrieve. Defaults to 100.
Example:
search_word = "東京 AND 人口"
surveyYears = "2023"
startPosition = 1
limit = 100
Returns:
str: The response text from the E-Stat API.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| search_word | Yes | ||
| surveyYears | Yes | ||
| startPosition | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden of behavioral disclosure. It explains pagination behavior (startPosition examples) and date formats, but the Returns field only says 'response text from the E-Stat API', which is vague. It does not mention authentication, error handling, or response structure, leaving notable gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with Args, Example, and Returns sections, making it easy to parse. However, it opens with both English and Japanese versions of the same purpose, which is redundant. The example at the end repeats parameter examples already given, adding slight redundancy, but overall it remains efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description thoroughly covers input parameters, which is valuable. However, for a tool with no annotations and no output schema, the Returns is insufficiently detailed ('response text'). It lacks information about the response format, potential errors, or authentication requirements, making it incomplete for fully autonomous invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must fully compensate. It does so excellently: search_word includes boolean operators and examples, surveyYears specifies exact formats, startPosition has pagination examples, and limit has a default. This adds substantial meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Retrieves a list of statistics tables from the E-Stat API' with a specific verb and resource. It also includes the Japanese equivalent, reinforcing the purpose. This distinguishes it from siblings like get_e_stat_meta_info or get_specific_e_stat_data, which focus on other aspects.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides detailed parameter usage and an example, but it does not explicitly mention when to use this tool versus the sibling tools. There is no 'when-not-to-use' or alternative tool reference, so the usage context is implied rather than explicitly differentiated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.3- First observed
get_e_stat_data_catalog - First observed
get_e_stat_meta_info - First observed
get_e_stat_ref_dataset - First observed
get_specific_e_stat_data - First observed
search_e_stat_tables
TDQS
Scored across 5 tools
Most tools have distinct purposes, but search_e_stat_tables and get_e_stat_data_catalog both accept similar search parameters and return resource information, which could cause confusion. The descriptions help somewhat, but the boundary between 'tables' and 'data catalog' is subtle.
The naming follows a consistent verb_e_stat_noun pattern, e.g., search_e_stat_tables, get_e_stat_meta_info, get_e_stat_data_catalog. However, get_specific_e_stat_data inserts 'specific' in the middle, and get_e_stat_ref_dataset uses the abbreviation 'ref', breaking the pattern slightly.
Five tools is a well-scoped count for an e-Stat API wrapper, covering the main read operations without unnecessary bloat. Each tool serves a clear step in the data discovery and retrieval workflow.
The set covers search, metadata, dataset reference, and data retrieval, but get_specific_e_stat_data lacks parameters for specifying classification codes or other conditions, which is a significant limitation when trying to extract precise data. Additionally, the overlap between search_e_stat_tables and get_e_stat_data_catalog could be consolidated.
Maintenance
Related MCP Connectors
MCP server for Japan geodata: cadastral lot numbers (chiban) and reverse geocoding, for AI agents.
政府統計 (e-Stat) の API を通じて、統計データやメタ情報を取得するためのサービスです。
e-Stat (Japan) MCP — government statistics
This MCP server provides seamless access to Malaysia's government open data, including datasets, w…
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceMCP server for Japan's e-Stat (Government Statistics Portal). Search statistical datasets, retrieve data tables, and access metadata from official Japanese government statistics.9Apache 2.0
- AlicenseBqualityDmaintenanceMCP server for the Japan National Tax Agency Corporate Number API, enabling corporate number lookup and search via local AI clients.31MIT
- AlicenseAqualityDmaintenanceMCP server for searching and retrieving Japanese laws from the e-Gov API, enabling natural language queries for legal information.36 npmMIT
- FlicenseBqualityDmaintenanceMCP server for searching Japanese government procurement notices via the Kanpou API. Enables LLMs to search by date, keyword, or detailed criteria.31-