japan-estat-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
japan-estat-mcp
A multi-user Model Context Protocol server for Japan's e-Stat API. It supports stdio and authenticated Streamable HTTP, with the skeleton's optional LangGraph agent, A2A endpoint, durable worker, Vault/Postgres persistence, and pg-boss scheduling.
This is a new, standalone adaptation of the MIT-licensed
skeleton-mcp, based on commit
bfbf26a6939a3c3c387a34bd2461f1bb5d0b8eec. The existing local API documents
were preserved. The e-Stat app ID is a credential, stored only in Vault; the
agent configuration, task and schedule state remain in scoped Postgres tables.
API versions and coverage
The adapter implements all callable operations and response formats listed in the official e-Stat specifications for versions 1.0, 2.0, 2.1, and 3.0. The machine-readable endpoint inventory and generated endpoint-to-tool coverage map every HTTP method/path and output-format variant to an MCP tool. There are 25 version-operation tools covering 65 documented endpoint-format combinations.
API version | Official specification | Operations |
1.0 | Official PDF (release 2014-10-31; document revision May 2018) |
|
2.0 | Official HTML (2015-01-30) | v1.0 operations plus |
2.1 | Official HTML (2016-07-14) | v2.0 operations plus |
3.0 | Official HTML (2019-07-26) | Seven operations, including |
The official specification index
notes that all versions are available over HTTPS. Implemented formats follow
each version's endpoint tables; the MCP schema rejects unsupported
version/operation/format combinations. XML, JSON, JSONP, and simple CSV outputs
are returned in their documented form. JSON is parsed as JSON; the other
formats are returned as redacted text. JSONP requires a validated callback.
Every API operation has a dedicated tool named
estat_v<major>_<minor>_<snake_case_operation>, for example
estat_v3_0_get_stats_data. Each tool takes a required format and a
version/operation-specific parameters object. Parameter names are from the
official versioned specification; appId is deliberately not accepted from
tool callers and is injected from Vault. Use estat_discover_operations for
the complete operation schemas and estat_suggest_query to produce a
schema-valid placeholder call without making a request.
getStatsDatas uses HTTP POST but is read-only. postDataset is mutating and
requires administrator authorization; processMode=D deletes a saved dataset.
Mutation requests are never retried. Read-only calls have a single bounded
retry for transient transport/upstream failures and honor Retry-After up to
one second. Requests time out after ESTAT_TIMEOUT_MS (default 15000 ms);
responses are capped at 5 MiB. Pagination uses the e-Stat startPosition /
NEXT_KEY flow. Errors and response bodies are scrubbed so the app ID is not
returned.
Related MCP server: estat-mcp
Credentials and identity
Register with e-Stat and obtain an application ID before calling API tools.
estat_credential_set provisions or rotates the authenticated principal's
credential in Vault. estat_credential_status reveals only whether it exists;
estat_credential_delete deletes the local Vault value but does not revoke the
ID at e-Stat. Credential tools require mcp:admin for OAuth callers, or a
configured MCP_ADMIN_AUTH_KEY in key-authorized mode. Rotation does not
invalidate the previous e-Stat ID; revoke it through e-Stat separately.
Credentials use an exact SHA-256 digest of (tenant_id, principal_type, principal_id) under MCP_SERVER_NAME/estat/credentials/. There is no
cross-user credential fallback. Identity is taken from authenticated context,
not caller-supplied tenant/principal fields. Stdio and static-token HTTP use
the configured default identity; use Vault-index tokens or verified OAuth
identities to isolate individual HTTP callers.
Read-only e-Stat tools need the caller's scoped app ID but no admin key.
postDataset additionally requires mcp:admin or the admin key; this gate
does not replace the authority and permissions of the e-Stat account itself.
All e-Stat tools are excluded from autonomous agent capabilities so caller
credentials and potentially large API responses cannot enter tasks,
checkpoints, or agent memory.
OAuth scope contract
HTTP OAuth uses introspection; this server does not issue tokens. Provider scope mappings are allowlists configured by the skeleton's OAuth environment variables. e-Stat itself uses an app ID, not an upstream OAuth scope.
MCP scope | Purpose and authorization |
| Required by default for Vault-index HTTP bearer tokens; permits authenticated invocation and is required for agent/A2A execution. |
| Accepted descriptive read capability; current direct read tools do not enforce it individually. |
| Authorizes ordinary mutating operations under OAuth-scope authorization; does not authorize |
| Admin-only Vault credentials/token lifecycle, agent administration, and e-Stat |
| Alternative scope for agent invocation where configured. |
| Tenant-bounded user/account and token administration. |
| Tenant-bounded cross-user agent configuration administration. |
| Trusted hosted-proxy caller initialization; only accepted with a configured trusted proxy identity. |
OAuth providers may require an admission scope such as mcp:invoke; configure
MCP_HTTP_OAUTH2_REQUIRED_SCOPES or the provider-specific equivalent. Configure
the OAuth client's requested scopes to match the server's admission and
authorization policy. In auto mode verified OAuth callers use scopes;
stdio/static-token callers use MCP_ADMIN_AUTH_KEY for protected operations.
The default Vault-index token verifier requires mcp:invoke.
Run locally
Requirements: Node.js 22+, Postgres, and Vault. Copy .env.example to .env,
provision infrastructure credentials locally, and never commit .env.
MCP_SERVER_NAME=japan-estat-mcp is the sole namespace source for Vault paths,
Postgres tables/schemas, checkpoint schema, and queue names. Changing it
changes the persistence namespace and requires an explicit migration plan.
APP_NAME is only a legacy migration input.
npm ci
npm run start:stdio
# or:
npm run start:http
npm run start:bothPersistence and External Services Mode
For local containers, docker compose up starts Postgres, Raft-backed Vault,
the MCP HTTP server, and the dedicated agent worker. Run server and worker
with the same MCP_SERVER_NAME, database and Vault settings. Agent scheduling
requires MCP_AGENT_WORKER_ENABLED=true and PGBOSS_ENABLED=true; the worker
is a separate npm run start:agent-worker process. The supported external
services path is docker-compose.external.yml; configure POSTGRES_HOST,
POSTGRES_PORT, POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD,
VAULT_ADDR, and VAULT_TOKEN through deployment secrets. Keep queue and
application tables in the same Postgres database for transactional dispatch.
Agent inference is not configured automatically. Use the existing
agent_config_* tools and Vault credential tools to set up inference after
deployment. Agent readiness is distinct from Vault/Postgres health. See the
inherited skeleton operations reference, the
onboarding playbook, and
vault-production/README.md for agent, A2A,
schedule, Vault Raft, managed unseal, backup, and recovery details.
HTTP TLS
MCP_HTTP_TLS_ENABLED=false is the default, matching .env.example. HTTP is
for loopback development or a trusted internal connection behind a
TLS-terminating reverse proxy. Native TLS remains configurable:
Set
MCP_HTTP_TLS_ENABLED=true.Provision
MCP_HTTP_TLS_CERT_PATHandMCP_HTTP_TLS_KEY_PATHexternally.Optionally configure
MCP_HTTP_TLS_KEY_PASSPHRASEandMCP_HTTP_TLS_MIN_VERSION(defaultTLSv1.2).Mount certificate and key files read-only in containers.
Startup fails if TLS files are missing or unreadable; it never falls back to
plaintext HTTP. Renew/rotate certificates externally and restart the process.
Use HTTPS client URLs and set MCP_A2A_PUBLIC_URL to the HTTPS address. Do not
expose plaintext HTTP outside loopback or a trusted TLS-terminating proxy.
HTTP retains bearer/OAuth authentication, request body limits, rate limits, and optional IP/origin controls. The default listener is loopback.
Configuration and checks
Common service variables:
Variable | Purpose | Default |
| Server identity and persistence namespace |
|
| e-Stat request timeout |
|
| Native HTTP TLS listener |
|
|
|
|
|
|
|
| Agent worker activation | Set |
| Durable queues/scheduler |
|
See .env.example and the skeleton environment reference
for Postgres, Vault, OAuth, token, agent, worker, A2A, and HTTP hardening
settings. docker-compose.yml preserves the vault-unseal-key-init startup
ordering. Do not commit credentials, Vault data, or unseal-key material.
Reproducible inventory and local test commands:
npm run inventory:generate
npm run inventory:check
npm testinventory:check verifies deterministic output, unique documented endpoints,
tool mappings, required parameters, and test mapping. GitHub Actions runs
inventory and tests on pull requests and pushes. Install the versioned
pre-push check after Git initialization with
git config core.hooksPath .githooks; it runs inventory validation and tests.
Unit and mocked transport tests do not imply live API or infrastructure verification. Disposable Postgres/Vault integration tests are opt-in and may skip when services are unavailable. Controlled inference, live e-Stat, and GitHub Actions checks require their respective external setup. No paid inference provider or production credential is required for this build.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
政府統計 (e-Stat) の API を通じて、統計データやメタ情報を取得するためのサービスです。
Remote MCP for Japan's EDINET DB — 3,800 listed companies' financials & filings (OAuth)
Read-only MCP for Japanese business systems: APIs, authentication, integration routes and live status, each with source URL and survey date. Website: https://renkeimap.jp Systems: https://renkeimap.jp/system Live status and outages: https://renkeimap.jp/status Integration tools: https://renkeimap.jp/tool AI and automation tools: https://renkeimap.jp/ai Guides: https://renkeimap.jp/guide How to use this MCP: https://renkeimap.jp/guide/learn/our-mcp-server 日本の業務システムの API・認証・接続方式・稼働状況を、出典と調査日つきで返す読み取り専用 MCP(IT連携マップ)。 システム一覧:https://renkeimap.jp/system 稼働状況・障害情報:https://renkeimap.jp/status 記事・ガイド:https://renkeimap.jp/guide この MCP の使い方:https://renkeimap.jp/guide/learn/our-mcp-server 訂正窓口:https://renkeimap.jp/request
Authoritative JLPT-graded Japanese dataset (kanji, vocab, grammar, history) via MCP and REST.
Related MCP Servers
- AlicenseCqualityBmaintenanceEnables access to Japan's official government statistics portal (e-Stat) API to search, retrieve, and analyze statistical data including census data, economic indicators, and demographic information across 17 statistical fields.13MIT
- 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.173 PyPI10Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables querying Japanese government statistics from e-Stat, including metadata, data observations, and catalog browsing.79 npmMIT
- AlicenseBqualityDmaintenanceMCP server for accessing Japanese government statistics portal 'e-Stat' API, enabling language models to search and retrieve statistical data.577 PyPI21MIT