uk-parliament-mcp 1.1.0__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/PKG-INFO +58 -30
  2. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/README.md +57 -29
  3. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/__init__.py +1 -1
  4. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/config.py +1 -0
  5. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/server.py +2 -0
  6. uk_parliament_mcp-1.2.0/src/uk_parliament_mcp/tools/hansard.py +172 -0
  7. uk_parliament_mcp-1.2.0/src/uk_parliament_mcp/tools/written_questions.py +213 -0
  8. uk_parliament_mcp-1.2.0/tests/test_tools/test_hansard.py +375 -0
  9. uk_parliament_mcp-1.2.0/tests/test_tools/test_written_questions.py +355 -0
  10. uk_parliament_mcp-1.1.0/src/uk_parliament_mcp/tools/hansard.py +0 -39
  11. uk_parliament_mcp-1.1.0/tests/test_tools/test_hansard.py +0 -123
  12. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/.github/dependabot.yml +0 -0
  13. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/.github/workflows/ci.yml +0 -0
  14. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/.github/workflows/publish.yml +0 -0
  15. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/.gitignore +0 -0
  16. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/.pre-commit-config.yaml +0 -0
  17. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/.python-version +0 -0
  18. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/AGENTS.md +0 -0
  19. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/CHANGELOG.md +0 -0
  20. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/CLAUDE.md +0 -0
  21. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/CONTRIBUTING.md +0 -0
  22. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/IMPLEMENTATION_PLAN.md +0 -0
  23. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/IMPLEMENTATION_PLAN_IMPROVEMENTS.md +0 -0
  24. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/IMPROVEMENTS.md +0 -0
  25. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/PROMPT_build.md +0 -0
  26. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/PROMPT_plan.md +0 -0
  27. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/config/claude_desktop_config.json.example +0 -0
  28. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/config/vscode_mcp_config.json.example +0 -0
  29. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/bills-api.json +0 -0
  30. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/committees-api.json +0 -0
  31. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/commonsvotes-api.json +0 -0
  32. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/erskinemay-api.json +0 -0
  33. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/hansard-api.json +0 -0
  34. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/interests-api.json +0 -0
  35. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/lordsvotes-api.json +0 -0
  36. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/members-api.json +0 -0
  37. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/oralquestions-api.json +0 -0
  38. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/parliamentnow-api.json +0 -0
  39. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/readme.md +0 -0
  40. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/statutoryinstruments-api.json +0 -0
  41. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/treaties-api.json +0 -0
  42. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/whatson-api.json +0 -0
  43. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/context/writtenquestions-api.json +0 -0
  44. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/docs/IMPROVEMENT_PLAN.md +0 -0
  45. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/docs/PHASE1_QUICK_WINS.md +0 -0
  46. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/docs/PHASE2_CODE_QUALITY.md +0 -0
  47. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/docs/PHASE3_TESTING.md +0 -0
  48. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/docs/PHASE4_DOCUMENTATION.md +0 -0
  49. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/docs/PHASE5_ARCHITECTURE.md +0 -0
  50. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/loop.ps1 +0 -0
  51. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/loop.sh +0 -0
  52. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/pyproject.toml +0 -0
  53. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/specs/agent-guidance-spec.md +0 -0
  54. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/specs/improvement-spec.md +0 -0
  55. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/specs/python-migration-spec.md +0 -0
  56. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/specs/v2-improvements-spec.md +0 -0
  57. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/__main__.py +0 -0
  58. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/http_client.py +0 -0
  59. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/__init__.py +0 -0
  60. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/bills.py +0 -0
  61. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/committees.py +0 -0
  62. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/commons_votes.py +0 -0
  63. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/composite.py +0 -0
  64. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/core.py +0 -0
  65. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/erskine_may.py +0 -0
  66. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/interests.py +0 -0
  67. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/lords_votes.py +0 -0
  68. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/members.py +0 -0
  69. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/now.py +0 -0
  70. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/oral_questions.py +0 -0
  71. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/statutory_instruments.py +0 -0
  72. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/treaties.py +0 -0
  73. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/tools/whatson.py +0 -0
  74. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/src/uk_parliament_mcp/validators.py +0 -0
  75. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/__init__.py +0 -0
  76. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/conftest.py +0 -0
  77. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_http_client.py +0 -0
  78. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/__init__.py +0 -0
  79. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_bills.py +0 -0
  80. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_committees.py +0 -0
  81. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_commons_votes.py +0 -0
  82. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_composite.py +0 -0
  83. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_core.py +0 -0
  84. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_erskine_may.py +0 -0
  85. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_interests.py +0 -0
  86. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_lords_votes.py +0 -0
  87. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_members.py +0 -0
  88. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_now.py +0 -0
  89. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_oral_questions.py +0 -0
  90. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_statutory_instruments.py +0 -0
  91. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_treaties.py +0 -0
  92. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/tests/test_tools/test_whatson.py +0 -0
  93. {uk_parliament_mcp-1.1.0 → uk_parliament_mcp-1.2.0}/verify_readme_rendering.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uk-parliament-mcp
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: UK Parliament MCP Server - bridges AI assistants with UK Parliament APIs
5
5
  Author: Chris Brooksbank
6
6
  License: MIT
@@ -51,7 +51,7 @@ Access official UK Parliament data through AI assistants. Query MPs, Lords, bill
51
51
  - Use the `/parliament` slash command (in Claude Desktop or compatible MCP clients)
52
52
  - Or say "Hello Parliament" to initialize the session
53
53
 
54
- This gives your AI assistant the context it needs to effectively use the 92 available tools.
54
+ This gives your AI assistant the context it needs to effectively use the 105 available tools.
55
55
 
56
56
  ## Claude Desktop Setup
57
57
 
@@ -201,26 +201,26 @@ Show me the JSON returned from the last MCP call.
201
201
  <summary><strong>Members of Parliament</strong> (14 examples)</summary>
202
202
 
203
203
  - Show me the interests of Sir Keir Starmer
204
- - Who is Boris Johnson?
205
- - Who is the member with ID 1471?
206
- - Get the biography of member 172
204
+ - Tell me about Boris Johnson's parliamentary career
205
+ - Look up the MP with ID 1471
206
+ - Show me the biography for member 172
207
207
  - Show me contact details for member 4129
208
208
  - What are the registered interests of member 3743?
209
- - Show recent contributions from member 172
210
- - What is the Commons voting record for member 4129?
211
- - What is the Lords voting record for member 3743?
212
- - Show the professional experience of member 1471
209
+ - What speeches has member 172 made recently?
210
+ - Show me how member 4129 has voted in the Commons
211
+ - Show me how member 3743 has voted in the Lords
212
+ - What was member 1471's career before Parliament?
213
213
  - What policy areas does member 172 focus on?
214
- - Show early day motions submitted by member 1471
214
+ - What early day motions has member 1471 signed?
215
215
  - Get the constituency election results for member 4129
216
- - Show me the portrait and thumbnail images for member 172
216
+ - Show me photos of member 172
217
217
 
218
218
  </details>
219
219
 
220
220
  <details>
221
221
  <summary><strong>Bills and Legislation</strong> (14 examples)</summary>
222
222
 
223
- - What recent bills are about fishing?
223
+ - What bills about fishing are currently before Parliament?
224
224
  - What bills were updated recently?
225
225
  - Show me details of bill 425
226
226
  - What stages has bill 425 been through?
@@ -230,9 +230,9 @@ Show me the JSON returned from the last MCP call.
230
230
  - What news articles are there about bill 425?
231
231
  - Show me all bill types available
232
232
  - What are the different stages a bill can go through?
233
- - Search for bills containing the word "environment"
234
- - Get the RSS feed for all bills
235
- - Get the RSS feed for public bills only
233
+ - Find bills related to the environment
234
+ - Get the RSS feed to track all bills
235
+ - Get the RSS feed for public bills
236
236
  - Get the RSS feed for bill 425
237
237
 
238
238
  </details>
@@ -240,12 +240,26 @@ Show me the JSON returned from the last MCP call.
240
240
  <details>
241
241
  <summary><strong>Voting and Divisions</strong> (6 examples)</summary>
242
242
 
243
- - Search Commons Divisions for the keyword "refugee"
243
+ - How have MPs voted on refugee-related issues?
244
244
  - Show details of Commons division 1234
245
245
  - Show details of Lords division 5678
246
- - Get Commons divisions grouped by party for keyword "climate"
247
- - Get Lords divisions grouped by party for member 3743
248
- - How many divisions match the search term "brexit"?
246
+ - Show how parties voted on climate issues in the Commons
247
+ - How did Lords vote by party on issues involving member 3743?
248
+ - How many votes have there been on Brexit?
249
+
250
+ </details>
251
+
252
+ <details>
253
+ <summary><strong>Written Questions & Statements</strong> (8 examples)</summary>
254
+
255
+ - What written questions have MPs asked about climate change?
256
+ - Show me unanswered written questions to the Home Office
257
+ - Find written questions about the NHS from the last month
258
+ - Get details of written question 12345
259
+ - What written ministerial statements were made about the budget?
260
+ - Search for written statements about housing policy
261
+ - Show me the daily report of written questions for this week
262
+ - Has any MP asked written questions about artificial intelligence?
249
263
 
250
264
  </details>
251
265
 
@@ -253,29 +267,43 @@ Show me the JSON returned from the last MCP call.
253
267
  <summary><strong>Committees and Inquiries</strong> (9 examples)</summary>
254
268
 
255
269
  - Which committees are focused on women's issues?
256
- - List committee meetings scheduled for November 2024
270
+ - What committee meetings are scheduled this month?
257
271
  - Show me details of committee 789
258
- - What events has committee 789 held?
272
+ - What hearings has committee 789 held?
259
273
  - Who are the members of committee 789?
260
- - Search for committee publications about healthcare
261
- - Show me written evidence submitted to committee 789
262
- - Show me oral evidence from committee 789 hearings
274
+ - Find committee reports on healthcare
275
+ - What written evidence was submitted to committee 789?
276
+ - What oral evidence was given to committee 789?
263
277
  - What are all the committee types?
264
278
 
265
279
  </details>
266
280
 
281
+ <details>
282
+ <summary><strong>Hansard (Official Record)</strong> (8 examples)</summary>
283
+
284
+ - Search Hansard for recent debates on Brexit
285
+ - What was said about immigration in the Commons last month?
286
+ - Show me the full transcript of debate abc123-def456
287
+ - What did Keir Starmer say during the debate on the economy?
288
+ - Were there any votes during the NHS funding debate?
289
+ - What debates happened in the Commons on March 15th 2024?
290
+ - Which days in January 2024 had Commons sittings?
291
+ - Show me all speeches by member 4514 in debate xyz789
292
+
293
+ </details>
294
+
267
295
  <details>
268
296
  <summary><strong>Parliamentary Procedures</strong> (9 examples)</summary>
269
297
 
270
298
  - Search Erskine May for references to the Mace
271
- - Show oral question times for questions tabled in November 2024
272
- - Search Hansard for contributions on Brexit from November 2024
299
+ - What oral question times are coming up?
273
300
  - What government departments exist?
274
301
  - What are the answering bodies in Parliament?
275
302
  - What parties are represented in the House of Commons?
276
303
  - What parties are represented in the House of Lords?
277
- - Show parliamentary calendar events for Commons in December 2024
278
- - When is Parliament not sitting in January 2025?
304
+ - What's on the Commons calendar this month?
305
+ - When are the upcoming parliamentary recesses?
306
+ - What are the procedural rules for bill amendments?
279
307
 
280
308
  </details>
281
309
 
@@ -293,7 +321,7 @@ Show me the JSON returned from the last MCP call.
293
321
 
294
322
  - List all categories of members' interests
295
323
  - Get published registers of interests
296
- - Show staff interests for Lords members
324
+ - Show staff interests declared by Lords members
297
325
  - Search the register of interests for member 1471
298
326
 
299
327
  </details>
@@ -316,7 +344,7 @@ Show me the JSON returned from the last MCP call.
316
344
  - Show me the JSON returned from the last MCP call
317
345
  - Show me the API URL you just used
318
346
  - Search for bills sponsored by member 172 from the Environment department
319
- - Find all committee meetings about climate change between November and December 2024
347
+ - Find committee meetings about climate change in the last few months
320
348
 
321
349
  </details>
322
350
 
@@ -27,7 +27,7 @@ Access official UK Parliament data through AI assistants. Query MPs, Lords, bill
27
27
  - Use the `/parliament` slash command (in Claude Desktop or compatible MCP clients)
28
28
  - Or say "Hello Parliament" to initialize the session
29
29
 
30
- This gives your AI assistant the context it needs to effectively use the 92 available tools.
30
+ This gives your AI assistant the context it needs to effectively use the 105 available tools.
31
31
 
32
32
  ## Claude Desktop Setup
33
33
 
@@ -177,26 +177,26 @@ Show me the JSON returned from the last MCP call.
177
177
  <summary><strong>Members of Parliament</strong> (14 examples)</summary>
178
178
 
179
179
  - Show me the interests of Sir Keir Starmer
180
- - Who is Boris Johnson?
181
- - Who is the member with ID 1471?
182
- - Get the biography of member 172
180
+ - Tell me about Boris Johnson's parliamentary career
181
+ - Look up the MP with ID 1471
182
+ - Show me the biography for member 172
183
183
  - Show me contact details for member 4129
184
184
  - What are the registered interests of member 3743?
185
- - Show recent contributions from member 172
186
- - What is the Commons voting record for member 4129?
187
- - What is the Lords voting record for member 3743?
188
- - Show the professional experience of member 1471
185
+ - What speeches has member 172 made recently?
186
+ - Show me how member 4129 has voted in the Commons
187
+ - Show me how member 3743 has voted in the Lords
188
+ - What was member 1471's career before Parliament?
189
189
  - What policy areas does member 172 focus on?
190
- - Show early day motions submitted by member 1471
190
+ - What early day motions has member 1471 signed?
191
191
  - Get the constituency election results for member 4129
192
- - Show me the portrait and thumbnail images for member 172
192
+ - Show me photos of member 172
193
193
 
194
194
  </details>
195
195
 
196
196
  <details>
197
197
  <summary><strong>Bills and Legislation</strong> (14 examples)</summary>
198
198
 
199
- - What recent bills are about fishing?
199
+ - What bills about fishing are currently before Parliament?
200
200
  - What bills were updated recently?
201
201
  - Show me details of bill 425
202
202
  - What stages has bill 425 been through?
@@ -206,9 +206,9 @@ Show me the JSON returned from the last MCP call.
206
206
  - What news articles are there about bill 425?
207
207
  - Show me all bill types available
208
208
  - What are the different stages a bill can go through?
209
- - Search for bills containing the word "environment"
210
- - Get the RSS feed for all bills
211
- - Get the RSS feed for public bills only
209
+ - Find bills related to the environment
210
+ - Get the RSS feed to track all bills
211
+ - Get the RSS feed for public bills
212
212
  - Get the RSS feed for bill 425
213
213
 
214
214
  </details>
@@ -216,12 +216,26 @@ Show me the JSON returned from the last MCP call.
216
216
  <details>
217
217
  <summary><strong>Voting and Divisions</strong> (6 examples)</summary>
218
218
 
219
- - Search Commons Divisions for the keyword "refugee"
219
+ - How have MPs voted on refugee-related issues?
220
220
  - Show details of Commons division 1234
221
221
  - Show details of Lords division 5678
222
- - Get Commons divisions grouped by party for keyword "climate"
223
- - Get Lords divisions grouped by party for member 3743
224
- - How many divisions match the search term "brexit"?
222
+ - Show how parties voted on climate issues in the Commons
223
+ - How did Lords vote by party on issues involving member 3743?
224
+ - How many votes have there been on Brexit?
225
+
226
+ </details>
227
+
228
+ <details>
229
+ <summary><strong>Written Questions & Statements</strong> (8 examples)</summary>
230
+
231
+ - What written questions have MPs asked about climate change?
232
+ - Show me unanswered written questions to the Home Office
233
+ - Find written questions about the NHS from the last month
234
+ - Get details of written question 12345
235
+ - What written ministerial statements were made about the budget?
236
+ - Search for written statements about housing policy
237
+ - Show me the daily report of written questions for this week
238
+ - Has any MP asked written questions about artificial intelligence?
225
239
 
226
240
  </details>
227
241
 
@@ -229,29 +243,43 @@ Show me the JSON returned from the last MCP call.
229
243
  <summary><strong>Committees and Inquiries</strong> (9 examples)</summary>
230
244
 
231
245
  - Which committees are focused on women's issues?
232
- - List committee meetings scheduled for November 2024
246
+ - What committee meetings are scheduled this month?
233
247
  - Show me details of committee 789
234
- - What events has committee 789 held?
248
+ - What hearings has committee 789 held?
235
249
  - Who are the members of committee 789?
236
- - Search for committee publications about healthcare
237
- - Show me written evidence submitted to committee 789
238
- - Show me oral evidence from committee 789 hearings
250
+ - Find committee reports on healthcare
251
+ - What written evidence was submitted to committee 789?
252
+ - What oral evidence was given to committee 789?
239
253
  - What are all the committee types?
240
254
 
241
255
  </details>
242
256
 
257
+ <details>
258
+ <summary><strong>Hansard (Official Record)</strong> (8 examples)</summary>
259
+
260
+ - Search Hansard for recent debates on Brexit
261
+ - What was said about immigration in the Commons last month?
262
+ - Show me the full transcript of debate abc123-def456
263
+ - What did Keir Starmer say during the debate on the economy?
264
+ - Were there any votes during the NHS funding debate?
265
+ - What debates happened in the Commons on March 15th 2024?
266
+ - Which days in January 2024 had Commons sittings?
267
+ - Show me all speeches by member 4514 in debate xyz789
268
+
269
+ </details>
270
+
243
271
  <details>
244
272
  <summary><strong>Parliamentary Procedures</strong> (9 examples)</summary>
245
273
 
246
274
  - Search Erskine May for references to the Mace
247
- - Show oral question times for questions tabled in November 2024
248
- - Search Hansard for contributions on Brexit from November 2024
275
+ - What oral question times are coming up?
249
276
  - What government departments exist?
250
277
  - What are the answering bodies in Parliament?
251
278
  - What parties are represented in the House of Commons?
252
279
  - What parties are represented in the House of Lords?
253
- - Show parliamentary calendar events for Commons in December 2024
254
- - When is Parliament not sitting in January 2025?
280
+ - What's on the Commons calendar this month?
281
+ - When are the upcoming parliamentary recesses?
282
+ - What are the procedural rules for bill amendments?
255
283
 
256
284
  </details>
257
285
 
@@ -269,7 +297,7 @@ Show me the JSON returned from the last MCP call.
269
297
 
270
298
  - List all categories of members' interests
271
299
  - Get published registers of interests
272
- - Show staff interests for Lords members
300
+ - Show staff interests declared by Lords members
273
301
  - Search the register of interests for member 1471
274
302
 
275
303
  </details>
@@ -292,7 +320,7 @@ Show me the JSON returned from the last MCP call.
292
320
  - Show me the JSON returned from the last MCP call
293
321
  - Show me the API URL you just used
294
322
  - Search for bills sponsored by member 172 from the Environment department
295
- - Find all committee meetings about climate change between November and December 2024
323
+ - Find committee meetings about climate change in the last few months
296
324
 
297
325
  </details>
298
326
 
@@ -1,3 +1,3 @@
1
1
  """UK Parliament MCP Server - bridges AI assistants with UK Parliament APIs."""
2
2
 
3
- __version__ = "1.1.0"
3
+ __version__ = "1.2.0"
@@ -14,6 +14,7 @@ STATUTORY_INSTRUMENTS_API_BASE = "https://statutoryinstruments-api.parliament.uk
14
14
  TREATIES_API_BASE = "https://treaties-api.parliament.uk/api"
15
15
  ERSKINE_MAY_API_BASE = "https://erskinemay-api.parliament.uk/api"
16
16
  ORAL_QUESTIONS_API_BASE = "https://oralquestionsandmotions-api.parliament.uk"
17
+ WRITTEN_QUESTIONS_API_BASE = "https://writtenquestions-api.parliament.uk/api"
17
18
 
18
19
  # Common constants
19
20
  HOUSE_COMMONS = 1
@@ -18,6 +18,7 @@ from uk_parliament_mcp.tools import (
18
18
  statutory_instruments,
19
19
  treaties,
20
20
  whatson,
21
+ written_questions,
21
22
  )
22
23
  from uk_parliament_mcp.tools.core import SYSTEM_PROMPT
23
24
 
@@ -42,6 +43,7 @@ def create_server() -> FastMCP:
42
43
  statutory_instruments.register_tools(mcp)
43
44
  treaties.register_tools(mcp)
44
45
  erskine_may.register_tools(mcp)
46
+ written_questions.register_tools(mcp)
45
47
 
46
48
  # Register prompts (agent skills)
47
49
  core.register_prompts(mcp)
@@ -0,0 +1,172 @@
1
+ """Hansard API tools for searching the official parliamentary record."""
2
+
3
+ from mcp.server.fastmcp import FastMCP
4
+
5
+ from uk_parliament_mcp.config import HANSARD_API_BASE
6
+ from uk_parliament_mcp.http_client import build_url, get_result
7
+
8
+
9
+ def register_tools(mcp: FastMCP) -> None:
10
+ """Register Hansard tools with the MCP server."""
11
+
12
+ @mcp.tool()
13
+ async def search_hansard(
14
+ house: int,
15
+ start_date: str,
16
+ end_date: str,
17
+ search_term: str,
18
+ member_id: int | None = None,
19
+ skip: int = 0,
20
+ take: int = 20,
21
+ ) -> str:
22
+ """Search Hansard (official parliamentary record) for speeches and debates. Use when researching what was said in Parliament on specific topics, by specific members, or in specific time periods. House: 1=Commons, 2=Lords.
23
+
24
+ Args:
25
+ house: House number: 1 for Commons, 2 for Lords.
26
+ start_date: Start date in YYYY-MM-DD format.
27
+ end_date: End date in YYYY-MM-DD format.
28
+ search_term: Search term for speeches or debates (e.g. 'climate change', 'NHS').
29
+ member_id: Optional member ID to filter results to a specific MP/Lord.
30
+ skip: Number of results to skip for pagination (default 0).
31
+ take: Number of results to return (default 20, max varies by endpoint).
32
+
33
+ Returns:
34
+ Hansard records matching the search criteria.
35
+ """
36
+ url = build_url(
37
+ f"{HANSARD_API_BASE}/search.json",
38
+ {
39
+ "queryParameters.house": house,
40
+ "queryParameters.startDate": start_date,
41
+ "queryParameters.endDate": end_date,
42
+ "queryParameters.searchTerm": search_term,
43
+ "queryParameters.memberId": member_id,
44
+ "queryParameters.skip": skip,
45
+ "queryParameters.take": take,
46
+ },
47
+ )
48
+ return await get_result(url)
49
+
50
+ @mcp.tool()
51
+ async def get_debate_by_id(debate_section_id: str) -> str:
52
+ """Get full debate transcript | Hansard, speeches, contributions |
53
+ Use after search_hansard to get complete debate with all member speeches.
54
+ Returns debate title, date, house, and all contributions.
55
+
56
+ Args:
57
+ debate_section_id: External ID from search_hansard results.
58
+
59
+ Returns:
60
+ Full debate with all member contributions.
61
+ """
62
+ url = f"{HANSARD_API_BASE}/debates/debate/{debate_section_id}.json"
63
+ return await get_result(url)
64
+
65
+ @mcp.tool()
66
+ async def get_member_hansard_contributions(
67
+ member_id: int,
68
+ debate_section_id: str,
69
+ ) -> str:
70
+ """Get all speeches by a specific MP/Lord in a debate | Hansard, member speeches |
71
+ Use to extract just one member's contributions from a debate.
72
+ Returns all contributions by that member in the specified debate.
73
+
74
+ Args:
75
+ member_id: Parliament member ID (from members API).
76
+ debate_section_id: External ID of debate section (from search_hansard).
77
+
78
+ Returns:
79
+ All contributions by that member in the debate.
80
+ """
81
+ url = f"{HANSARD_API_BASE}/debates/memberdebatecontributions/{member_id}.json?debateSectionExtId={debate_section_id}"
82
+ return await get_result(url)
83
+
84
+ @mcp.tool()
85
+ async def get_debate_divisions(debate_section_id: str) -> str:
86
+ """Get votes that occurred during a debate | Hansard, divisions, voting |
87
+ Use to find divisions (votes) that took place in a specific debate.
88
+ Returns list of divisions with aye/noe counts.
89
+
90
+ Args:
91
+ debate_section_id: External ID of debate section (from search_hansard).
92
+
93
+ Returns:
94
+ List of divisions with vote counts.
95
+ """
96
+ url = f"{HANSARD_API_BASE}/debates/divisions/{debate_section_id}.json"
97
+ return await get_result(url)
98
+
99
+ @mcp.tool()
100
+ async def get_division_details(
101
+ division_id: str,
102
+ is_evel: bool = False,
103
+ ) -> str:
104
+ """Get full division details including how each member voted | Hansard, division, voting records |
105
+ Use to see individual voting records for a specific division.
106
+ Returns division with debate title, counts, and member voting records.
107
+
108
+ Args:
109
+ division_id: External ID of division (from get_debate_divisions).
110
+ is_evel: Filter to EVEL (English Votes for English Laws) voters only.
111
+
112
+ Returns:
113
+ Division details with member voting records.
114
+ """
115
+ url = build_url(
116
+ f"{HANSARD_API_BASE}/debates/division/{division_id}.json",
117
+ {"isEvel": is_evel if is_evel else None},
118
+ )
119
+ return await get_result(url)
120
+
121
+ @mcp.tool()
122
+ async def get_hansard_sitting_day(
123
+ sitting_date: str,
124
+ house: int,
125
+ ) -> str:
126
+ """Get full agenda/sections for a sitting day | Hansard, daily business, agenda |
127
+ Use to see all debates and business for a specific day.
128
+ Returns all debate sections for that day.
129
+
130
+ Args:
131
+ sitting_date: Date in YYYY-MM-DD format.
132
+ house: House number: 1 for Commons, 2 for Lords.
133
+
134
+ Returns:
135
+ All debate sections for that day.
136
+ """
137
+ url = build_url(
138
+ f"{HANSARD_API_BASE}/overview/sectionsforday.json",
139
+ {
140
+ "date": sitting_date,
141
+ "house": house,
142
+ },
143
+ )
144
+ return await get_result(url)
145
+
146
+ @mcp.tool()
147
+ async def get_hansard_calendar(
148
+ year: int,
149
+ month: int,
150
+ house: int,
151
+ ) -> str:
152
+ """Get all sitting dates for a month | Hansard, calendar, sitting days |
153
+ Use to discover which days have Hansard records available.
154
+ Returns list of sitting dates with Hansard available.
155
+
156
+ Args:
157
+ year: Year (e.g. 2024).
158
+ month: Month number (1-12).
159
+ house: House number: 1 for Commons, 2 for Lords.
160
+
161
+ Returns:
162
+ List of sitting dates for the month.
163
+ """
164
+ url = build_url(
165
+ f"{HANSARD_API_BASE}/overview/calendar.json",
166
+ {
167
+ "year": year,
168
+ "month": month,
169
+ "house": house,
170
+ },
171
+ )
172
+ return await get_result(url)