# Japan Diet Records Search MCP (`aflame_brigantine/kokkai-search-mcp`) Actor

国立国会図書館「国会会議録検索システム」をMCPツール化。発言・会議の検索、要約用抜粋の取得をLLMから呼び出せます。通常run（バッチ）呼び出しにも対応。

- **URL**: https://apify.com/aflame\_brigantine/kokkai-search-mcp.md
- **Developed by:** [Kameda Hyper](https://apify.com/aflame_brigantine) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 tool calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Japan Diet Records Search MCP

Search Japan's National Diet (parliament) proceedings — speeches and meeting records — via the [National Diet Library's official Kokkai (Diet Records) Search API](https://kokkai.ndl.go.jp/api.html), exposed as MCP tools for LLM agents (Claude, Cursor, etc.) plus a normal batch-run mode. This Actor is an independent tool and is **not affiliated with or endorsed by** the National Diet Library or the Diet.

国立国会図書館「[国会会議録検索システム 検索用API](https://kokkai.ndl.go.jp/api.html)」を使い、国会の発言・会議記録をLLMエージェント（Claude、Cursor等）から検索できるMCPツール群として提供するActorです。通常run（バッチ）呼び出しにも対応します。本Actorは非公式のツールであり、国立国会図書館や国会とは無関係です。

### What does this Actor do?

- Runs as an [Apify Standby](https://docs.apify.com/platform/actors/running/standby) MCP server exposing 4 tools: `search_speeches`, `search_meetings`, `get_speech`, `summarize_topic`
- Also runs as a normal (batch) Actor: give it JSON input with a `mode` field and it pushes results to a dataset, like any other Actor
- Caches search results and individual speech records for 24 hours to avoid repeat requests to the source API
- Returns excerpts (300 characters) with source URLs by default; full text is available per-speech (up to 5,000 characters) via `get_speech`, respecting the speaker's copyright in the underlying transcript

### Why use it?

Existing community MCP servers for this API exist but are unmaintained (the one listed Actor on Apify Store has a 0% success rate). This Actor wraps the same official, no-API-key-required NDL search API with request pacing, response-size safety limits, and result caching, and ships both as an MCP server and a regular Actor.

### How to use it — as an MCP server

1. Deploy this Actor (or use the published one) and note its Standby URL, e.g. `https://<username>--kokkai-search-mcp.apify.actor/mcp`.
2. Add it to your MCP client (Claude Desktop, Claude Code, Cursor, etc.) as a Streamable HTTP MCP server, passing your Apify API token as a Bearer token in the `Authorization` header.
3. Ask your LLM to search Diet speeches — it will call `search_speeches` / `search_meetings` / `get_speech` / `summarize_topic` as needed.

### How to use it — as a normal run

Give it input like:

```json
{ "mode": "search_speeches", "query": "消費税", "limit": 10 }
```

and it pushes the results to the default dataset, same as any batch Actor. Leave `mode` empty (or omit it) to start the MCP Standby server instead.

### Input

| Field | Type | Description |
|---|---|---|
| `mode` | string | Leave empty to run as an MCP Standby server. Otherwise: `search_speeches`, `search_meetings`, `get_speech`, or `summarize_topic`. |
| `query` | string | Full-text search term. One of `query` / `speaker` / `from` / `until` is required by the underlying API. |
| `speaker` | string | Speaker name (`search_speeches` / `summarize_topic` only; ignored by `search_meetings`, since meetings aren't tied to a single speaker). |
| `house` | string | `衆議院` / `参議院` / `両院` / `両院協議会`. |
| `from` / `until` | string (`YYYY-MM-DD`) | Meeting date range. |
| `limit` | integer | Max records (API hard limit: 100). |
| `speechId` | string | Required for `get_speech` — must come from a prior `search_speeches`/`summarize_topic` result (the API has no direct speechId lookup). |
| `maxChars` | integer | Max characters for `get_speech` full text (up to 5,000). |

### Output

```json
{
  "speechId": "122105261X01720260727_073",
  "meeting": "予算委員会",
  "house": "衆議院",
  "date": "2026-07-27",
  "speaker": "後藤祐一",
  "snippet": "○後藤（祐）委員　ブロックチェーンという技術で、暗号資産は…",
  "url": "https://kokkai.ndl.go.jp/txt/122105261X01720260727/73"
}
```

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel from the Output tab.

### Pricing

Pay-per-event:

| Event | Price | When |
|---|---|---|
| `tool-call` | $0.005 | Each MCP tool call (cached results are still charged) |
| `actor-start` | $0.02 | Once per normal (non-MCP) run |
| `speech-record` | $0.001 | Each record pushed to the dataset in a normal run |

This Actor runs in [Standby mode](https://docs.apify.com/platform/actors/running/standby) so the MCP server is ready without a cold start. As the caller, you are only ever charged the pay-per-event prices above — for a tool call or a dataset item pushed — never for the Actor simply sitting idle waiting for requests.

### Tips

- Results are cached for 24 hours per unique query, so repeated questions about the same topic within a session don't re-hit the source API or incur extra tool-call latency (though each MCP call is still charged — see above).
- `get_speech` only works for a `speechId` returned by a prior `search_speeches` or `summarize_topic` call in the same session, since the underlying API has no way to look up a speech by ID directly.
- This Actor does not call an LLM itself (no external API key needed) — `summarize_topic` just returns a larger batch of excerpts for your own LLM to summarize.

### FAQ, disclaimers, and support

- Speech text is subject to the speaker's own copyright; this Actor returns short excerpts by default and caps full-text retrieval at 5,000 characters per speech for information-analysis purposes.
- This Actor only uses the National Diet Library's official public search API (no login, no API key, no scraping).
- This Actor only searches public, official proceedings of sitting members of the Diet (public figures' public statements). It is not intended for — and should not be used for — collecting personal information about private individuals; it stores no personal data of its own beyond a 24-hour cache of NDL search results and speech records used to make `get_speech` work. Expired cache entries are removed on a best-effort basis (on read, and via a bounded background sweep) rather than guaranteed to disappear the instant they expire.
- Found a bug or have a feature request? Open an issue on the Actor's Issues tab.

# Actor input Schema

## `mode` (type: `string`):

MCPクライアントから使う場合は空欄のままにしてください（Standbyサーバーとして起動します）。通常runとして使う場合はいずれかを選択してください。

## `query` (type: `string`):

発言内容・会議名の検索語。query, speaker, from, until のいずれか一つは必須です。

## `speaker` (type: `string`):

発言者名（search\_speeches / summarize\_topic のみ。search\_meetings では無視されます）。

## `house` (type: `string`):

院名で絞り込みます。

## `from` (type: `string`):

開催日の下限（YYYY-MM-DD）。

## `until` (type: `string`):

開催日の上限（YYYY-MM-DD）。

## `limit` (type: `integer`):

取得件数上限。この件数分だけ speech-record イベントが課金されます。API上限は100件です。

## `speechId` (type: `string`):

get\_speech モードで指定する speechId（search\_speeches の結果から取得）。

## `maxChars` (type: `integer`):

get\_speech モードでの全文の文字数上限（既定・上限とも5,000字）。

## Actor input object example

```json
{
  "mode": "",
  "query": "",
  "speaker": "",
  "house": "",
  "from": "",
  "until": "",
  "limit": 10,
  "speechId": "",
  "maxChars": 5000
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("aflame_brigantine/kokkai-search-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("aflame_brigantine/kokkai-search-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call aflame_brigantine/kokkai-search-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,aflame_brigantine/kokkai-search-mcp"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ybffdBsDl5f5pdlC4/builds/moOToi4wkFJ7PIzIB/openapi.json
