NSW Parliament Hansard MCP Server
Provides programmatic access to the New South Wales Parliament Hansard API, enabling search and retrieval of parliamentary transcripts, debates, and proceedings from 1991 to present.
README
NSW Parliament Hansard MCP Server
A Model Context Protocol (MCP) server that provides programmatic access to the New South Wales Parliament Hansard API. This server enables AI assistants and applications to search, retrieve, and analyse parliamentary transcripts, debates, and proceedings from September 1991 to the present day.
Table of Contents
- Features
- Installation
- Configuration
- Available Tools
- Available Resources
- Usage Examples
- API Reference
- Data Coverage
- Terms of Use
- License
- Contributing
- Support
Features
- Comprehensive Hansard Access: Search and retrieve parliamentary transcripts from both the Legislative Assembly (Lower House) and Legislative Council (Upper House)
- Multiple Search Methods: Search by year, date, speaker name, or bill name
- Multiple Output Formats: Access data in JSON, XML, or PDF formats
- Table of Contents: Retrieve structured tables of contents for any sitting day
- Speaker Search: Find speeches by specific members with wildcard support
- Bill Tracking: Search for all debates and mentions related to specific legislation
- Historical Data: Access records dating back to September 1991
- No Authentication Required: Free public access to all endpoints
Installation
Prerequisites
- Node.js 18.0.0 or higher
- npm or yarn package manager
Install from npm
npm install -g nsw-hansard-mcp
Install from Source
git clone https://github.com/lawquarter/nsw-hansard-mcp.git
cd nsw-hansard-mcp
npm install
npm run build
Configuration
Claude Desktop
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"nsw-hansard": {
"command": "npx",
"args": ["-y", "nsw-hansard-mcp"]
}
}
}
Claude Code
Add to your Claude Code MCP settings:
{
"mcpServers": {
"nsw-hansard": {
"command": "npx",
"args": ["-y", "nsw-hansard-mcp"]
}
}
}
Local Development
If running from source:
{
"mcpServers": {
"nsw-hansard": {
"command": "node",
"args": ["/path/to/nsw-hansard-mcp/dist/index.js"]
}
}
}
Available Tools
hansard_search_by_year
Search all Hansard records for a specific year.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
year |
integer | Yes | The year to search (1991 or later) |
Example:
{
"year": 2024
}
hansard_search_by_date
Get detailed Hansard information for a specific date.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
date |
string | Yes | Date in YYYY-MM-DD format |
Example:
{
"date": "2024-03-15"
}
hansard_get_fragment_xml
Retrieve the raw XML content of a specific Hansard fragment.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId |
string | Yes | Unique document identifier |
hansard_get_fragment_html
Retrieve a Hansard fragment as JSON with HTML content.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId |
string | Yes | Unique document identifier |
hansard_get_pdf_url
Get the URL for downloading a Hansard PDF (post-1991 documents).
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId |
string | Yes | Unique document identifier |
hansard_get_searchable_pdf_url
Get the URL for a searchable Hansard PDF (pre-1991 historical documents).
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId |
string | Yes | Unique document identifier |
hansard_get_table_of_contents_xml
Retrieve the table of contents for a sitting day in XML format.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId |
string | Yes | Unique document identifier |
hansard_get_table_of_contents_json
Retrieve the table of contents as structured JSON.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId |
string | Yes | Unique document identifier |
hansard_search_by_speaker
Search Hansard records by speaker name with optional filters.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
speakerName |
string | Yes | Speaker name (supports wildcards: *) |
parliamentSessionId |
integer | No | Limit to specific parliament session |
startDate |
string | No | Start date in YYYY/MM/DD format |
endDate |
string | No | End date in YYYY/MM/DD format |
houseCode |
string | No | LH (Lower House) or UH (Upper House) |
memberId |
integer | No | Unique member identifier |
rowLimit |
integer | No | Maximum results (default: 100) |
Example:
{
"speakerName": "Smith*",
"startDate": "2024/01/01",
"endDate": "2024/12/31",
"houseCode": "LH"
}
hansard_search_by_bill
Search Hansard records by bill name.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
billName |
string | Yes | Name of the bill (partial matching supported) |
Example:
{
"billName": "Environmental Planning"
}
hansard_list_sitting_dates
List all parliamentary sitting dates.
Parameters: None
hansard_list_sitting_date_types
List all types of sitting dates.
Parameters: None
Available Resources
hansard://info
Information about the NSW Parliament Hansard API, including coverage dates, available data, and usage notes.
hansard://terms
Copyright and conditions of use for NSW Parliament Hansard data.
Usage Examples
Searching for Recent Debates
To find all Hansard records from 2024:
Use hansard_search_by_year with year: 2024
Finding a Specific Day's Proceedings
To get the Hansard for a specific sitting day:
Use hansard_search_by_date with date: "2024-03-15"
Searching by Member
To find speeches by a specific member:
Use hansard_search_by_speaker with:
- speakerName: "Jones*"
- startDate: "2024/01/01"
- endDate: "2024/06/30"
- houseCode: "LH"
Tracking Legislation
To find all debates about a specific bill:
Use hansard_search_by_bill with billName: "Housing Amendment"
API Reference
This MCP server interfaces with the NSW Parliament Hansard API:
Base URL: https://api.parliament.nsw.gov.au/api
Endpoints Used
| Endpoint | Method | Description |
|---|---|---|
/hansard/search/year/{year} |
GET | Search by year |
/hansard/search/bydate |
GET | Search by date |
/hansard/search/daily/fragment/{documentId} |
GET | Get XML fragment |
/hansard/search/daily/fragment/html/{documentId} |
POST | Get HTML fragment |
/hansard/search/daily/pdf/{documentId} |
GET | Get PDF |
/hansard/search/daily/searchablepdf/{documentId} |
GET | Get searchable PDF |
/hansard/search/daily/tableofcontents/{documentId} |
GET | Get TOC XML |
/hansard/search/daily/tableofcontentsbydate/{documentId} |
POST | Get TOC JSON |
/hansard/search/byspeaker |
GET | Search by speaker |
/hansard/search/daily/bybill |
GET | Search by bill |
/sittingdate |
GET | List sitting dates |
/sittingdatetype |
GET | List sitting date types |
For complete API documentation, visit:
Data Coverage
Temporal Coverage
- Start Date: September 1991
- End Date: Present (updated regularly)
Content Types
- Daily transcripts (corrected and uncorrected)
- Table of contents
- PDF documents
- Speaker records
- Bill debates
Chambers
- Legislative Assembly (LH): The Lower House of NSW Parliament
- Legislative Council (UH): The Upper House of NSW Parliament
Terms of Use
NSW Parliament Copyright Notice
The material provided through this MCP server originates from the NSW Parliament Hansard API and is subject to copyright under the Copyright Act 1968 (Cth). Copyright is owned by the State of New South Wales through the Parliament of New South Wales.
Permitted Use
The Parliament of NSW encourages the availability, dissemination and exchange of public information. You may copy, distribute, display, download and otherwise deal with the material on the following conditions:
-
Non-commercial purposes: Use must not be for advertising, satire, or ridicule
-
No misrepresentation: Use must not misrepresent members of Parliament
-
Attribution required: You must include the copyright notice:
© State of New South Wales through the Parliament of New South Wales
Restrictions
- This permission does not extend to copyright in materials owned by others, such as papers tabled in Parliament
- Evidence, submissions and other material provided to committees should not be re-published or distributed without first being authorised by the relevant committee or House
- Use of the Parliamentary Crest is permitted only where reproduction is incidental to use of publications in accordance with the copyright notice
- The Parliament does not authorise any other use or reproduction of the Parliamentary Crest and other parliamentary symbols and logos without prior written permission
- Copyright of broadcast material belongs to NSW Parliament and no unauthorised use may be made of that material
Disclaimer
- The Hansard API is provided on an "as is" basis
- The Parliament of NSW is not liable for loss or damage arising from use of the material or from delays or interruptions in service
- The Parliament does not provide developers with any direct support for API usage beyond the available documentation
Full Terms
For the complete terms and conditions, please visit: NSW Parliament Copyright & Conditions of Use
License
This MCP server implementation is released under the MIT License.
MIT License
Copyright (c) 2025 Law Quarter
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Important: While this software implementation is MIT licensed, the data obtained through the NSW Parliament Hansard API is subject to the NSW Parliament's copyright and conditions of use as described in the Terms of Use section above.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Support
This MCP server is maintained by Law Quarter.
For issues related to this MCP server implementation, please open an issue on GitHub.
Note: The NSW Parliament does not provide direct support for API usage. For API-related queries, refer to the official documentation links provided above.
Acknowledgements
- NSW Parliament for providing the Hansard API
- Model Context Protocol for the MCP specification
- Data.NSW for API documentation and data hosting
Disclaimer: This project is not officially affiliated with or endorsed by the NSW Parliament. It is an independent implementation that interfaces with the publicly available Hansard API.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。