-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat(mcp): elicitation support #5965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements client support for the MCP (Model Context Protocol) elicitation feature, enabling MCP servers to request structured information from users via dynamic forms during tool execution. The implementation spans both Rust backend (agent logic, MCP client, message types) and TypeScript frontend (React form components, chat integration), with support for both CLI and desktop interfaces.
Key Changes
- Added
ActionRequiredManagerfor coordinating elicitation requests/responses between MCP servers and UI layers via async channels - Extended message types to support elicitation requests and responses with JSON Schema-based form definitions
- Implemented dynamic form rendering in desktop UI using
JsonSchemaFormcomponent with validation
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/goose/src/action_required_manager.rs | New global manager coordinating elicitation lifecycle with async channels and timeout handling |
| crates/goose/src/agents/agent.rs | Integrated elicitation message routing and response handling into agent reply loop |
| crates/goose/src/agents/mcp_client.rs | Implemented MCP ClientHandler::create_elicitation with 5-minute timeout |
| crates/goose/src/conversation/message.rs | Added Elicitation and ElicitationResponse variants to ActionRequiredData enum |
| crates/goose/src/context_mgmt/mod.rs | Added formatting for elicitation messages in conversation compacting |
| crates/goose-cli/src/session/mod.rs | Integrated CLI elicitation handling with cancellation support |
| crates/goose-cli/src/session/elicitation.rs | New CLI form collection with terminal UI for various JSON Schema field types |
| crates/goose-cli/src/session/output.rs | Added rendering for elicitation message types |
| crates/goose-cli/src/session/export.rs | Added markdown export formatting for elicitation content |
| ui/desktop/src/types/message.ts | Added helper functions for creating and extracting elicitation messages |
| ui/desktop/src/hooks/useChatStream.ts | Implemented submitElicitationResponse handler with streaming integration |
| ui/desktop/src/components/ui/JsonSchemaForm.tsx | New dynamic form component supporting string/number/boolean/enum types with validation |
| ui/desktop/src/components/ElicitationRequest.tsx | React component managing elicitation UI states (pending/submitted/cancelled) |
| ui/desktop/src/components/GooseMessage.tsx | Integrated ElicitationRequest rendering into message display |
| ui/desktop/src/components/ProgressiveMessageList.tsx | Threaded submitElicitationResponse callback through component hierarchy |
| ui/desktop/src/components/BaseChat.tsx | Passed elicitation handler from useChatStream to message list |
| ui/desktop/src/components/ToolCallConfirmation.tsx | Added type extraction for discriminated union safety |
| ui/desktop/src/api/types.gen.ts | Generated TypeScript types for elicitation action variants |
| ui/desktop/openapi.json | Extended OpenAPI schema with elicitation/elicitationResponse objects |
| crates/goose/src/lib.rs | Exported new action_required_manager module |
326f890 to
2bd5e18
Compare
2bd5e18 to
a1c408e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.
|
a great jump forward with MCP support, and something we have wanted for a long time, allows MCPs to basically be mini apps in a way. some feedback inline (and maybe some of the copilot feedback is legit - logic errors maybe)? Seemed like more code than I thought for cli, but that is ok (wasn't sure how this applied to cli - if we even want it in cli etc?) |
|
@michaelneale Thanks for review. Yes, I agree it was more code than I expected for CLI as well. I will see if I can whittle down the implementation to something simpler which asks for the inputs one by one with minimal code tomorrow. It has a lot of fancy formatting stuff right now. @michaelneale @zanesq Another question for all of us to ponder: how can we integration test this? It requires a sort of interactive mode of input by the user. |
|
The playwright e2e tests should be able to interact with it. I think we should strip tests those down to only main happy paths for high level smoke testing however. Currently they are a bit too granular. Planning on coming back to those soon and pruning/changing to be our release checklist steps. |
a1c408e to
aa9c7f3
Compare
aa9c7f3 to
408293b
Compare
408293b to
27b3a86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
27b3a86 to
db97f86
Compare
db97f86 to
a26e9c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
a26e9c8 to
b879c19
Compare
b879c19 to
2d3b2c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.
2d3b2c4 to
1770580
Compare
michaelneale
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think looks ok. would be nice if @zanesq thought so too.
I wonder if this needs some additional. support in goose web and goose-ios so when they see those message types they can deal/ignore it (depending on what level of broad support we want0.
|
Will take a look soon after I get the release out... |
zanesq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM!
- I wonder if we should use an open source JSON Schema Form library that supports all available things or do you think this is sufficient to support the things people can throw at it with the Elicitation standard?
- Can you add a quick local mcp example to test it? Like running quotes we would use it in our E2E tests. Tried asking goose to create one but didn't work. Could be a follow up also but figured it would be a nice way to verify this works for other people.
|
One more note we use tanstack forms with zod validation now so you could change this form to use that to be consistent. Also not a blocker can be a follow up. |
|
@zanesq Got it! Can you send me an example of another form that uses our intended best practice/std? |
|
@zanesq Thanks - I will look at the form in another change. See if I can replace it with an off-the-shelf or convert it to use our chosen underlying components (tanstack + zod) |
|
I will also look at URL mode elicitation in a followup |
* origin/main: feat(mcp): elicitation support (#5965) Onboarding detect provider from api key (#5955) Fix PATH on Windows for extensions (#6000) recipe(datahub): Add a recipe for searching & understanding data in DataHub (#5859) fix params not being substituted in activities (#5992) blog: MCP Sampling (#5987)
* 'main' of github.com:block/goose: (21 commits) Hide recipe icon in empty chat (#6022) docs: provider and model config (#6008) Show modal selector after configuring a provider (#6005) docs: additional mcp sampling resources (#6020) Flutter PR Code Review (#6011) feat(mcp): elicitation support (#5965) Onboarding detect provider from api key (#5955) Fix PATH on Windows for extensions (#6000) recipe(datahub): Add a recipe for searching & understanding data in DataHub (#5859) fix params not being substituted in activities (#5992) blog: MCP Sampling (#5987) Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) added sidebar contextual information for firefox (#5433) docs: council of mine MCP (#5979) docs: nano banana extension (#5977) fix: remove prompt change, read model from config (#5976) ... # Conflicts: # ui/desktop/src/api/sdk.gen.ts # ui/desktop/src/components/bottom_menu/DirSwitcher.tsx
* 'main' of github.com:block/goose: gov: new LF Projects LLC section (#6027) Cleanup: Remove Recipe Key Flow (#6015) chore(deps): bump mdast-util-to-hast from 13.2.0 to 13.2.1 in /documentation (#5963) remove problematic corrupted woff font (#6006) Added search bar / filtering for recipes (#6019) Hide recipe icon in empty chat (#6022) docs: provider and model config (#6008) Show modal selector after configuring a provider (#6005) docs: additional mcp sampling resources (#6020) Flutter PR Code Review (#6011) feat(mcp): elicitation support (#5965) Onboarding detect provider from api key (#5955) Fix PATH on Windows for extensions (#6000) recipe(datahub): Add a recipe for searching & understanding data in DataHub (#5859) fix params not being substituted in activities (#5992)
* 'main' of github.com:block/goose: (159 commits) Cleanup: Remove Recipe Key Flow (#6015) chore(deps): bump mdast-util-to-hast from 13.2.0 to 13.2.1 in /documentation (#5963) remove problematic corrupted woff font (#6006) Added search bar / filtering for recipes (#6019) Hide recipe icon in empty chat (#6022) docs: provider and model config (#6008) Show modal selector after configuring a provider (#6005) docs: additional mcp sampling resources (#6020) Flutter PR Code Review (#6011) feat(mcp): elicitation support (#5965) Onboarding detect provider from api key (#5955) Fix PATH on Windows for extensions (#6000) recipe(datahub): Add a recipe for searching & understanding data in DataHub (#5859) fix params not being substituted in activities (#5992) blog: MCP Sampling (#5987) Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) ...
…nses-streaming * 'main' of github.com:block/goose: blog: How to stop your ai agent from making unwanted code changes (#6055) Fix typo in prompt (#6007) Docs for new terminal integration feature (#6042) fix: linux goosed crashing libssl error (#6051) chore(release): release version 1.16.0 (minor) (#5985) fix: metrics on posthog (#6024) gov: new LF Projects LLC section (#6027) Cleanup: Remove Recipe Key Flow (#6015) chore(deps): bump mdast-util-to-hast from 13.2.0 to 13.2.1 in /documentation (#5963) remove problematic corrupted woff font (#6006) Added search bar / filtering for recipes (#6019) Hide recipe icon in empty chat (#6022) docs: provider and model config (#6008) Show modal selector after configuring a provider (#6005) docs: additional mcp sampling resources (#6020) Flutter PR Code Review (#6011) feat(mcp): elicitation support (#5965)
…oose into dkatz/openai-responses-streaming * 'dkatz/openai-responses-streaming' of github.com:block/goose: Rm stray leave errors in the context blog: How to stop your ai agent from making unwanted code changes (#6055) Fix typo in prompt (#6007) Docs for new terminal integration feature (#6042) fix: linux goosed crashing libssl error (#6051) chore(release): release version 1.16.0 (minor) (#5985) fix: metrics on posthog (#6024) gov: new LF Projects LLC section (#6027) Cleanup: Remove Recipe Key Flow (#6015) chore(deps): bump mdast-util-to-hast from 13.2.0 to 13.2.1 in /documentation (#5963) remove problematic corrupted woff font (#6006) Added search bar / filtering for recipes (#6019) Hide recipe icon in empty chat (#6022) docs: provider and model config (#6008) Show modal selector after configuring a provider (#6005) docs: additional mcp sampling resources (#6020) Flutter PR Code Review (#6011) feat(mcp): elicitation support (#5965)
Overview
Implements client support for MCP's Elicitation feature (form mode)
Arch
General MCP Message Flow (from MCP docs)
Flow Described in Goose Specific Components
Demos
CLI
Desktop