


Overview
Search the public Japanese-language minutes of Japan's National Diet from its first session in May 1947 onward. Coverage includes plenary sittings and committees of both houses, as well as conference committees. Find who said what, locate bills on published agendas, and read the debate around a particular speech. Recent minutes and PDFs appear as the source publishes them. National Diet Library coverage
Tools
| Tool |
Description |
kokkai_search_speeches |
Find speeches by Japanese terms or speaker, with excerpts or full source text |
kokkai_search_meetings |
Find sitting headers and their printed agendas |
kokkai_get_meeting |
Read a sitting's speech outline or a page of original Japanese text |
kokkai_list_reference |
Look up houses, eras, standing committees, session dates, and search syntax |
Capability reference
kokkai_search_speeches tool
- Supply at least one search filter, such as
keywords, speaker, meeting_name, house, issue_id, an inclusive date range, or a session or issue number. closing_only narrows another filter to recess sittings.
- Keywords match within spoken text. Separate AND terms with spaces and use separate calls for OR.
meeting_name and speaker accept space-separated alternatives. Use Gregorian dates or Japanese era dates such as 昭和22年5月20日.
- Results include the speech ID, speaker and sitting metadata, and a verbatim excerpt of up to 480 Unicode code points. Set
include_full_text: true for the entire source text. Ambiguous speaker filters report distinct matches on the current page.
- Both search tools default to 25 rows, clamp limits above 100, and return
next_start for the next page. Keep the filters and pass that value as start.
kokkai_search_meetings tool
- Search Japanese bill titles or other terms in sitting headers. Omit filters to browse recent sittings. Use
kokkai_search_speeches to match words spoken in debate.
- Each result includes the
issue_id and an agenda extracted from the printed header when available. If extraction is unavailable, follow the minutes or PDF link.
kokkai_get_meeting tool
- Pass one
issue_id for a complete speaker outline. Set include_text: true for original Japanese text and use start_order to select the exact first row. Order zero is the header.
- Pass one
speech_id to open the text page at that exact speech. The default text page contains up to 10 rows, with a maximum of 100. For subsequent pages, use the issue_id, include_text: true, and the returned next_order as start_order.
- A valid identifier or starting order with no matching record returns
found: false and guidance for finding the sitting or speech order.
kokkai_list_reference tool
- Pass
topic as houses, eras, standing_committees, sessions, or search_syntax. 両院 and 両院協議会 select conference committees. Omit house in a search to include both houses.
sessions returns the House of Representatives' official session table, newest first. standing_committees lists current statutory names. When searching historical records, use a name from minutes of the period.
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
- Source links. Results preserve links to the original minutes, speech, and PDF when available. The server identifies excerpts it cuts and agendas it extracts.
- OCR notices. Sessions 1–144 and machine-read ancillary records may contain errors. Check the original PDF before quoting. NDL search help
- Serial access. Each server process spaces its NDL minutes requests. Let a call finish before requesting more pages. NDL API terms
Getting started
The National Diet Library API requires no key. To register the local stdio server in Claude Code:
claude mcp add japan-parliament-mcp-server -- npx -y @cyanheads/japan-parliament-mcp-server
For other clients, add this to the MCP config file:
{
"mcpServers": {
"japan-parliament-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/japan-parliament-mcp-server"]
}
}
}
Try these tool arguments using the first plenary sitting of the House of Councillors on May 20, 1947. Original sitting record
| Tool |
Arguments |
kokkai_search_meetings |
{"house":"参議院","meeting_name":"本会議","from":"昭和22年5月20日","until":"昭和22年5月20日"} |
kokkai_search_speeches |
{"issue_id":"100115254X00119470520","keywords":"民主議会","limit":5} |
kokkai_get_meeting |
{"speech_id":"100115254X00119470520_025","limit":3} |
kokkai_list_reference |
{"topic":"eras"} |
Configuration
| Variable |
Description |
Default |
MCP_TRANSPORT_TYPE |
Transport, stdio or http. |
stdio |
MCP_HTTP_HOST |
HTTP bind address. |
127.0.0.1 |
MCP_HTTP_PORT |
HTTP server port. |
3010 |
MCP_HTTP_ENDPOINT_PATH |
HTTP MCP endpoint path. |
/mcp |
MCP_SESSION_MODE |
HTTP session mode, stateless, stateful, or auto. |
stateless |
MCP_AUTH_MODE |
HTTP authentication, none, jwt, or oauth. |
none |
MCP_LOG_LEVEL |
Minimum log level. |
info |
OTEL_ENABLED |
Enable OpenTelemetry. |
false |
See .env.example for more framework settings.
Running the server
Local development
Source builds require Bun v1.4.4 or higher. The start scripts and npm package use Node.js v24+.
git clone https://github.com/cyanheads/japan-parliament-mcp-server.git
cd japan-parliament-mcp-server && bun install
bun run rebuild
bun run start:http
# Or use stdio
bun run start:stdio
For Streamable HTTP, connect your MCP client to http://127.0.0.1:3010/mcp with the default settings.
Docker
docker run --rm -p 127.0.0.1:3010:3010 ghcr.io/cyanheads/japan-parliament-mcp-server:latest
The image defaults to HTTP transport and stateless sessions. For stdio, use "command": "docker" with "args": ["run", "-i", "--rm", "-e", "MCP_TRANSPORT_TYPE=stdio", "ghcr.io/cyanheads/japan-parliament-mcp-server:latest"]. To build locally, run docker build -t japan-parliament-mcp-server .. Set --build-arg OTEL_ENABLED=false to omit OpenTelemetry dependencies from the image.
Project structure
| Directory |
Purpose |
src/mcp-server/tools/ |
Four tool definitions, shared search filters, and result formatting |
src/services/ndl/ |
National Diet Library API client, request pacing, and response validation |
src/services/minutes/ |
Agenda extraction, speech excerpts, and metadata normalization |
src/services/reference/ |
House and committee names, era dates, and the official session table |
tests/ |
Tool contracts, source parsing, and server identity tests |
Development guide
See CLAUDE.md for development guidelines. Register tools in src/index.ts, validate source data before normalization, and preserve attribution, missing fields, and original text in both MCP result formats.
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
License
The server code is licensed under Apache 2.0.
Credit minutes to 国会会議録検索システム (National Diet Proceedings Search System) and keep the original links when quoting. Identify edits to source material. NDL's content terms follow Public Data License 1.0 for covered material. NDL holds rights to the database and its staff's speeches. Rights to other speeches generally belong to their speakers, subject to copyright expiry or applicable exceptions such as quotation or qualifying political speeches under Article 40. The conditions depend on the material and use, including whether the reuse compiles speeches by one author. NDL API terms · NDL content terms · Japan Copyright Act