shtap mcp, which exposes two tools over stdio. Under the hood the MCP server is itself a client of a running shtap serve, so start the engine first.
The tools
ask_expert(question, topic, kind='freeform.answer', context?, dedup_key?)
Submits a request as the
mcp consumer and returns immediately.Returns { request_id, status, answer? }. The answer is present only when the call resolved instantly via a dedup hit against an already-accepted proposal; otherwise the answer arrives out-of-band and you poll for it.The HTTP API returns this identifier as
id; the MCP tool renames it to request_id. Use request_id when calling check_answer.check_answer(request_id)
Polls a request’s status. Returns
{ status, answer? }. The answer key appears once a proposal exists; when the expert’s reply couldn’t be structured, it falls back to { "summary": "<raw reply>" }.Connect from an agent
Spawnshtap mcp over stdio and call the tools with any MCP client:
Resuming once the answer lands
Becauseask_expert returns before a human has replied, a real agent needs a resume strategy:
Poll
Call
check_answer(request_id) on a later turn until status is accepted and an answer is present. Simplest to wire into an agent loop.Webhook
Register a webhook consumer and resume from the
on_proposal_accepted callback instead of polling. Better for long waits. See Webhooks.examples/langgraph_agent/ directory in the repository shows this end to end: a small runnable MCP client wrapper (shouldertap_mcp_client.py) and a LangGraph node (tap_expert_if_unsure) that taps a human on the agent’s low-confidence path.