australia-parliament-mcp-server
by cyanheads
README.md
<div align="center">
<h1>@cyanheads/australia-parliament-mcp-server</h1>
<p><b>Search Australian federal Hansard, read divisions and votes, and look up parliamentarians via MCP. STDIO or Streamable HTTP.</b></p>
<div>5 live tools · 2 optional mirror tools</div>
</div>
<div align="center">
 [](./LICENSE) [](https://www.npmjs.com/package/@cyanheads/australia-parliament-mcp-server) [](https://bun.sh/)
</div>
<div align="center">
[](https://github.com/cyanheads/australia-parliament-mcp-server/releases/latest/download/australia-parliament-mcp-server.mcpb) [](https://cursor.com/en/install-mcp?name=australia-parliament-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBjeWFuaGVhZHMvYXVzdHJhbGlhLXBhcmxpYW1lbnQtbWNwLXNlcnZlciJdfQ==) [](https://vscode.dev/redirect?url=vscode:mcp/install?%7B%22name%22%3A%22australia-parliament-mcp-server%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40cyanheads%2Faustralia-parliament-mcp-server%22%5D%7D)
[](https://www.npmjs.com/package/@cyanheads/mcp-ts-core)
</div>
## Overview
Read Australian federal House and Senate proceedings from 7 February 2006 onward and look up federal parliamentarians across all parliaments. The five live tools use public sources without an API key. The two cross-sitting search tools use an optional local SQLite mirror.
### Tools
| Tool | Availability | Operation |
|:---|:---|:---|
| [`auparl_get_sitting`](#auparl_get_sitting) | Live or mirror | Read a day's proceedings or the exchange around a speech. |
| [`auparl_get_division`](#auparl_get_division) | Live or mirror | Read a recorded vote, party tallies and pairs. |
| [`auparl_search_members`](#auparl_search_members) | Live | Find current and former federal parliamentarians. |
| [`auparl_get_member`](#auparl_get_member) | Live | Look up official service histories and seat terms. |
| [`auparl_list_reference`](#auparl_list_reference) | Live | Find sitting dates, coverage, accepted values and identifier formats. |
| [`auparl_search_speeches`](#auparl_search_speeches) | Ready mirror | Search speeches across sitting days. |
| [`auparl_search_divisions`](#auparl_search_divisions) | Ready mirror | Search recorded divisions and follow a member's votes. |
## Capability reference
### `auparl_get_sitting`
- Supply `house` and `date`, or a `speech_id`. The sitting outline includes headings, speech IDs, division summaries and bill tags.
- Set `include_text: true` for a page of complete speeches. Pass `next_start` back as `start` to continue. A speech ID starts the text page at that speech by default.
- For a confirmed non-sitting date, look at the nearest sitting dates. If a speech ID became stale, use the current outline to locate the speech again.
### `auparl_get_division`
- Supply `house`, `date` and division `number`, or a `division_id`.
- Returns the recorded ayes, noes and pairs, dated party tallies, and the preceding speech's final paragraph when available. Pairs have no vote side. Reported totals and tellers are separate from the tally of listed voters.
### `auparl_search_members`
- Search by name or narrow by house, party, state, electorate or parliament. Set `sitting_now: true` to restrict to current members.
- Use the returned parliamentary Handbook identifier (PHID) for member details and vote or speech searches.
### `auparl_get_member`
- Supply `ids` as an array of PHIDs or prefixed OpenAustralia identifiers. Send back any `deferred_ids` in another call after the first 25 lookups.
- Returns service history, roles, ministries and OpenAustralia seat terms when available. A ready mirror adds counts and first and last dates for speeches and recorded votes within its coverage. Vote counts exclude pairs.
### `auparl_list_reference`
- Pass a `topic`. Use `coverage` for recent source dates, mirror readiness and known import failures. Use `sitting_days` with a `house` and `year` to find dates for live reads.
- Other topics include `houses`, `parliaments`, `parties`, `electorates`, `states`, `talk_types`, `search_syntax` and `id_formats`.
### `auparl_search_speeches`
- Search words, quoted phrases, uppercase `OR` or a trailing `*` on a word. Omit the query to browse by filters, including date, speaker, party, heading or bill.
- Results include excerpts by default. Set `include_full_text: true` for complete speeches. Interjections are excluded by default. Party reflects the date of the speech, and House days with unresolved venue are excluded by venue filters.
### `auparl_search_divisions`
- Narrow by house, date, heading or bill. Supply `member` to see that person's recorded vote status for each matching division.
- Status distinguishes aye, no, paired, did not vote and not a member. It can be unknown when service history is unavailable. Pass a returned `division_id` to read the full vote lists.
All three search tools return a filtered total and `next_offset` for pagination. Pages may shift when the underlying data refreshes.
## Features
Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core) with stdio and Streamable HTTP transports, pluggable auth (`none` / `jwt` / `oauth`), and structured logging with optional OpenTelemetry tracing.
- Proceedings and vote lists come from the [OpenAustralia bulk archive](https://data.openaustralia.org.au/). Member histories come from the [Parliamentary Handbook OData API](https://handbookapi.aph.gov.au/api/) and seat terms from [OpenAustralia's membership files](https://data.openaustralia.org.au/members/).
- Dates use the Canberra calendar (`YYYY-MM-DD`). The archive generally publishes the next morning Canberra time. A recent proof edition or a historical reparse can change text and shift or remove positional IDs.
- Use `representatives` or `senate` as the house. Keep the house prefix on speech and division IDs (`<house>/<date>.<n>.<m>`). The Federation Chamber, historically the Main Committee, is a House venue. Some House dates have an unresolved venue split.
- Bare member identifiers are PHIDs, including all-digit values. Prefix OpenAustralia IDs with `person/`, `member/` or `lord/`. Person IDs span terms. Member and lord IDs identify one seat term and constrain speech or vote searches to that term.
- Coverage is federal chamber proceedings from 7 February 2006. Bill tags point to relevant proceedings and ParlInfo pages. Bill text and progress, earlier Hansard, committees and Estimates, questions on notice and petition text are outside coverage.
## Getting started
For Claude Desktop, install the `.mcpb` from the badge above. The portable bundle runs the five live tools.
For Claude Code, use Node.js 24 or newer with:
```sh
claude mcp add australia-parliament-mcp-server -- npx -y @cyanheads/australia-parliament-mcp-server
```
For other stdio clients, add this to the MCP config file:
```json
{
"mcpServers": {
"australia-parliament-mcp-server": {
"command": "npx",
"args": ["-y", "@cyanheads/australia-parliament-mcp-server"]
}
}
}
```
With Bun 1.4.4 or newer, use `bunx --bun @cyanheads/australia-parliament-mcp-server` as the launch command. For example, start with `auparl_list_reference({"topic":"sitting_days","house":"senate","year":2025})`, then pass a returned date and `house: "senate"` to `auparl_get_sitting`.
## Configuration
| Variable | Description | Default |
|:---|:---|:---|
| `AUPARL_MIRROR_ENABLED` | Enable cross-sitting search and mirror coverage. Set `true` after running the separate initialization command with this same setting. | `false` |
| `AUPARL_MIRROR_PATH` | Persistent writable SQLite file, required when the mirror is enabled. Use an absolute path shared by the import and server processes. | unset |
| `MCP_TRANSPORT_TYPE` | Transport, either `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. | `/mcp` |
| `MCP_AUTH_MODE` | Authentication mode, one of `none`, `jwt` or `oauth`. | `none` |
| `MCP_LOG_LEVEL` | Minimum log level. | `info` |
| `OTEL_ENABLED` | Enable OpenTelemetry. | `false` |
| `MCP_USAGE_REPORTING` | Opt in to sending tool-call summaries to the maintainer. | `false` |
See [`.env.example`](./.env.example) for common framework overrides.
## Running the server
### Local development
```sh
git clone https://github.com/cyanheads/australia-parliament-mcp-server.git
cd australia-parliament-mcp-server
bun install
bun run rebuild
bun run start:stdio
```
For Streamable HTTP, run `bun run start:http` and connect to `http://127.0.0.1:3010/mcp`.
### Docker
```sh
docker run --rm -p 127.0.0.1:3010:3010 ghcr.io/cyanheads/australia-parliament-mcp-server:latest
```
The image defaults to Streamable HTTP with stateless sessions. To build locally, run `docker build -t australia-parliament-mcp-server .`.
### Optional Hansard mirror
Allow at least **12 GiB free** on the mirror volume. The initial import takes about an hour before retries and is resumable. Initialize the mirror in a separate process before using cross-sitting search.
```sh
export AUPARL_MIRROR_ENABLED=true
export AUPARL_MIRROR_PATH="$HOME/.local/share/auparl/hansard.sqlite"
npx -y @cyanheads/australia-parliament-mcp-server mirror init
npx -y @cyanheads/australia-parliament-mcp-server mirror verify
```
Pass both variables to the MCP client in the stdio server's `env` object or export them before launching HTTP. For the Claude Code plugin, fill in the mirror settings when configuring it. For the Codex plugin, export both variables before starting Codex. Run `npx -y @cyanheads/australia-parliament-mcp-server mirror refresh` to update a stdio mirror. Mirror-enabled HTTP schedules refresh at **03:15 UTC** each day after initialization.
For Docker, mount a persistent volume writable by the container's `bun` user. Use the same volume and path for the import and server:
```sh
docker run --rm --mount source=auparl-data,target=/usr/src/app/.mirror \
-e AUPARL_MIRROR_ENABLED=true -e AUPARL_MIRROR_PATH=/usr/src/app/.mirror/hansard.sqlite \
ghcr.io/cyanheads/australia-parliament-mcp-server:latest bun dist/index.js mirror init
docker run --rm -p 127.0.0.1:3010:3010 --mount source=auparl-data,target=/usr/src/app/.mirror \
-e AUPARL_MIRROR_ENABLED=true -e AUPARL_MIRROR_PATH=/usr/src/app/.mirror/hansard.sqlite \
ghcr.io/cyanheads/australia-parliament-mcp-server:latest
```
Use `auparl_list_reference` with `topic: "coverage"` to see both the latest available and latest loaded dates, along with failed days. Failed refreshes preserve the last successfully loaded copy.
## Project structure
| Directory | Purpose |
|:---|:---|
| `src/mcp-server/tools/definitions/` | Public MCP tool contracts. |
| `src/services/hansard/` | OpenAustralia XML and sitting parsing. |
| `src/services/members/` | Handbook snapshots and OpenAustralia identity joins. |
| `src/services/mirror/` | SQLite import and search. |
| `tests/` | Tests for source parsing, tools, mirror lifecycle and packaging. |
## Development guide
See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and [the design](./docs/design.md) for the source and data contracts.
## Contributing
[Issues are welcome](https://github.com/cyanheads/australia-parliament-mcp-server/issues). Run checks and tests before submitting:
```sh
bun run devcheck
bun run test
```
## License
The server code is licensed under the [Apache License 2.0](./LICENSE).
Hansard is Commonwealth of Australia material. The [Parliament of Australia copyright notice](https://www.aph.gov.au/Help/Disclaimer_Privacy_Copyright) specifies CC BY-NC-ND 4.0. [OpenAustralia's licensing notice](https://www.openaustralia.org.au/api/) cites CC BY-NC-ND 3.0 for parliamentary material and CC BY-SA 2.5 for OpenAustralia's own lists. Results credit the Parliament of Australia and the OpenAustralia Foundation, link to the source sitting, and identify text converted from XML or presented as an excerpt. The Handbook API supplies official service records and publishes no separate licence in its service document.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues