consult-user-mcp / mcp-server
CLAUDE.md39 starsChanged 4 months agoMITView on GitHub
The MCP server itself: the tool surface an agent sees, and the routing that turns a tool call into a spawned [[Dialog CLI]] process. TypeScript, built and tested with Bun. Four tools, one provider. ask, notify, tweak, propose_layout are registered in index.ts. Each defines a Zod schema, registers via server.registerTool(), and delegates to a method on DialogProvider. ask is a router, not a dialog — its type field selects the method: Platform lives behind the interface. createProvider() returns WindowsDialogProvider on…
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- container/CLAUDE.mdCLAUDE.md
- dialog-cli/CLAUDE.mdCLAUDE.md
- dialog-cli-windows/CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- macos-app/CLAUDE.mdCLAUDE.md
- sketch-cli/CLAUDE.mdCLAUDE.md
- test-cases/CLAUDE.mdCLAUDE.md
- windows-app/CLAUDE.mdCLAUDE.md
- beadsSkill
- release-appSkill
- windows-buildSkill
The file
Files
MCP Server
What this is
The MCP server itself: the tool surface an agent sees, and the routing that turns a tool call into a spawned [[Dialog CLI]] process. TypeScript, built and tested with Bun.
Mental model
Four tools, one provider. ask, notify, tweak, propose_layout are registered in index.ts. Each defines a Zod schema, registers via server.registerTool(), and delegates to a method on DialogProvider.
ask is a router, not a dialog — its type field selects the method:
ask type | Provider method |
confirm | provider.confirm() |
pick | provider.choose() |
text | provider.textInput() |
form | provider.questions() |
Platform lives behind the interface. createProvider() returns WindowsDialogProvider on win32, SwiftDialogProvider otherwise. Everything platform-specific is inside providers/; nothing above that layer branches on OS.
Responses are compacted before they reach the agent. compact.ts strips null fields, maps confirmed → answer, merges dismissed into cancelled. Priority when several states could apply: snoozed > askDifferently > feedbackText > cancelled > answer.
The tweak resolvers turn a description into a file location. css-resolver.ts handles selector + property; text-search-resolver.ts handles a {v} search pattern; resolve-utils.ts is shared. This is why tweak can be called without line numbers.
Important invariants
tweakandpropose_layoutare macOS-only.WindowsDialogProviderthrows for both, andpropose_layoutis removed from the tool list entirely onwin32. Keep the throw explicit.- The [[Baseprompt]] ships through the protocol, not through a file.
loadBasePrompt()reads the bundledbase-prompt.mdand returns it in theinstructionsfield. It is never inlined into aCLAUDE.md. See.claude/rules/baseprompt.md. propose_layoutis single-flight. A module-levelproposeLayoutActiveguard rejects a second concurrent call.- Every response shape must survive
compact.ts. A new field that should reach the agent has to be handled there or it is silently dropped. - Attachments bypass compaction on purpose.
takeAttachments()strips the image list off the raw response beforecompactResponse, andattachmentBlocks()turns it into MCP image content blocks. The base64 must never reachstructuredContent, which is echoed into the transcript as JSON. macOS only for now — the Windows CLI emits noattachments, and the absent key degrades to no images rather than an error. - Choices are validated.
validate-choices.tsrejects meta-options like "all of the above" — the dialog is for real choices.
Common change patterns
Adding a tool → Zod schema + registerTool in index.ts, types in types.ts, method on providers/interface.ts, both provider implementations, compaction in compact.ts, tests.
Adding a platform → implement DialogProvider in providers/<os>.ts and add a branch to createProvider(). Every method must return a well-formed cancel result rather than throwing when the user dismisses.
Changing a response shape → compact.ts and its tests, then both CLIs. Full list: .claude/rules/dialog-parity.md.
Verification
bun test # 144 tests, mostly compaction and validation
bun run build # compile
bun run dev # watch modecompact.ts is the highest-value thing to test — it is where response bugs become invisible.
Related context
../GLOSSARY.md— Layer Translation table: MCP name ↔ CLI command ↔ platform type../dialog-cli/CLAUDE.md,../dialog-cli-windows/CLAUDE.md— what the providers spawn.claude/rules/dialog-parity.mddocs/— the rewind-checkpoint limitation and other product-level caveats belong there, not here
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

