Content
# kokkai-mcp
MCP Server for Japanese Parliamentary Proceedings
The National Diet Library's [Parliamentary Proceedings Search System API](https://kokkai.ndl.go.jp/api.html) is used to provide speech search, meeting record retrieval, and meeting summary as MCP tools.
## Features
| Tool | Description |
|--------|------|
| `search_speeches` | Search speeches by keyword, speaker, meeting name, and period |
| `get_meeting` | Retrieve entire meeting record by issueID |
| `summarize_speeches` | Summarize speech list (brief / standard / detailed) |
| `summarize_meeting` | Retrieve and summarize entire meeting record |
## Setup
### 1. Install Dependencies
```bash
npm install
```
### 2. Configure Environment Variables
```bash
cp .env.example .env
# Edit .env to set ANTHROPIC_API_KEY
```
Required Environment Variables:
| Variable | Description |
|--------|------|
| `ANTHROPIC_API_KEY` | Anthropic Claude API key (obtain from https://console.anthropic.com/) |
### 3. Build
```bash
npm run build
```
### 4. Register with Claude Desktop
Add the following to `claude_desktop_config.json`:
```json
{
"mcpServers": {
"kokkai-mcp": {
"command": "node",
"args": ["/path/to/kokkai-mcp/dist/server.js"],
"env": {
"ANTHROPIC_API_KEY": "your-api-key-here"
}
}
}
}
```
## Development
```bash
npm run dev # Start with hot reload
npm test # Run tests
npm run lint # Run lint checks
npm run build # Build
```
## Usage Examples
### Speech Search
```
Search recent parliamentary discussions on generative AI.
→ search_speeches({ query: "generative AI", from: "2024-01-01", limit: 10 })
```
### Meeting Record Summary
```
Summarize the meeting record with issueID.
→ summarize_meeting({ issueID: "...", mode: "standard" })
```
## Architecture
- Node.js 20+ / TypeScript 5.x
- MCP SDK (stdio transport)
- Anthropic Claude API (claude-3-5-haiku default)
- Memory cache (TTL: speeches 1 day, meeting records and summaries 7 days)
See `docs/architecture/` for details.
## License
Use of this software is subject to the [Parliamentary Proceedings Search System Terms of Use](https://kokkai.ndl.go.jp/terms.html).