feat(ST-1102): add 4 question-channel MCP tools (M11)

Vier nieuwe tools voor het Claude vraag-antwoord-kanaal:
- ask_user_question (write): post een gestructureerde vraag aan de actieve
  Scrum4Me-gebruiker over een story; default async (returnt direct met
  question_id + status='open'); optionele wait_seconds (max 600) polt elke 2s
  tot het antwoord er is of timeout — daarna status='pending' zodat Claude met
  get_question_answer later kan ophalen
- get_question_answer (read): huidige status + antwoord van een eerder
  gestelde vraag
- list_open_questions (read): eigen vragen met status open/answered, max 50,
  meest recente eerst
- cancel_question (write, asker-only): atomic UPDATE WHERE asked_by + status=
  'open' zodat alleen eigen open vragen geannuleerd worden

Allemaal achter access-check via userCanAccessStory/Product en demo-blok via
requireWriteAccess (volgt patroon van create-todo en bestaande log-tools).

Submodule vendor/scrum4me bumpt naar Scrum4Me commit 79367dd (M11 ST-1101) —
bevat het ClaudeQuestion-model en notify_question_change-trigger waar deze
tools tegen werken.

scripts/smoke-test.ts: 13 tools verwacht (was 9); list_open_questions
toegevoegd als read-tool-coverage. Build + tools/list groen — verdere e2e via
MCP Inspector na PR-merge omdat de seed een nieuwe API-token heeft
gegenereerd en .env een nieuwe waarde nodig heeft.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-04-28 01:00:59 +02:00
parent 2f82241696
commit 7b955d31ac
9 changed files with 361 additions and 2 deletions

View file

@ -53,7 +53,7 @@ async function main() {
const tools = await client.listTools()
log(
'tools/list',
tools.tools.length === 9,
tools.tools.length === 13,
`${tools.tools.length} tools: ${tools.tools.map((t) => t.name).join(', ')}`,
)
@ -75,6 +75,14 @@ async function main() {
log('get_claude_context', !ctx.isError, ctx.text)
}
// list_open_questions (M11 — read-only, geen write nodig voor smoke-test)
const openQs = await callTool(client, 'list_open_questions')
log('list_open_questions', !openQs.isError, openQs.text)
if (!openQs.isError) {
const parsed = JSON.parse(openQs.text) as { count: number }
log('list_open_questions.shape', typeof parsed.count === 'number', `count=${parsed.count}`)
}
// prompts/list
const prompts = await client.listPrompts()
log(