- Notifications
You must be signed in to change notification settings - Fork 616
add: elicitation support #535
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
base: main
Are you sure you want to change the base?
add: elicitation support #535
Conversation
@QuantGeekDev we added your logic to MCPJam/inspector#88 to support elicitation on our client as well. Thank you for helping everyone with your ideas! 🎉 |
Hi @QuantGeekDev - we finally merged in some fixes to the input forms that were pending for a while, but unfortunately that led to some conflicts in this branch. Let me know if you want me to try resolving them, would definitely like to get your PR in soon. |
Thanks for the heads up. I will get this fixed up |
That is awesome :) I hope it was useful - I like your inspector |
Hasn't slipped my mind, just been a bit busy. Should be done within next 3 days |
As you get this one's conflicts resolved, I'll take a look at adding elicitations to our Everything server for in-project testing / demonstrating. |
Resolved conflicts by adopting the improved form input handling from main: - Standardized JsonSchemaType.required to only accept string arrays (JSON Schema standard) - Adopted enhanced object and array rendering with proper nested support - Improved boolean field rendering (removed extra wrapper div) - Enhanced array handling with add/remove functionality - Simplified required field validation logic This maintains elicitation functionality while benefiting from the form input fixes.
@QuantGeekDev Coming back to this question, and revising my answer. I think that it should be implemented like sampling on a separate tab. The reason being that while your examples are small, some servers might require a larger form than the modal could comfortably handle. |
I now have a PR for an elicitation tool in the |
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.
A few requests:
- Bump SDK version to 1.14.0
- Replace elicitation
reject
action withdecline
(last minute change to spec doc didn't make it in to schema so it was reverted in SDK version 1.14.0) - Fix
required
type injsonUtils.ts
(boolean vs string[] issue was merged last week, your branch is older) - Fix use of
enumNames
which did not make it into the JSON Schema spec and the recommended implementation of labeled enums is withconst
andoneOf
oranyOf
, e.g.,
{ "type": "string", "oneOf": [ { "const": "red", "title": "Stop" }, { "const": "amber", "title": "Caution" }, { "const": "green", "title": "Go" } ] }
package.json Outdated
@@ -46,7 +46,7 @@ | |||
"@modelcontextprotocol/inspector-cli": "^0.14.3", | |||
"@modelcontextprotocol/inspector-client": "^0.14.3", | |||
"@modelcontextprotocol/inspector-server": "^0.14.3", | |||
"@modelcontextprotocol/sdk": "^1.12.1", | |||
"@modelcontextprotocol/sdk": "^1.13.0", |
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.
"@modelcontextprotocol/sdk": "^1.13.0", | |
"@modelcontextprotocol/sdk": "^1.14.0", |
client/src/utils/jsonUtils.ts Outdated
description?: string; | ||
required?: boolean; | ||
required?: boolean | string[]; |
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.
Should only be array of strings. This was previously fixed. The boolean type here appears to be a regression. It isn't present on main
right now, so I assume you are working from an older branch, and this is one of the conflicts to be resolved.

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.
Indeed from older branch, moved to string array only
client/src/utils/jsonUtils.ts Outdated
pattern?: string; | ||
format?: string; | ||
enum?: string[]; | ||
enumNames?: string[]; |
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.
enumNames
is not part of the JSONSchema spec. The recommended way to describe enum labels is with oneOf
or anyOf
.
const schema = { | ||
type: "string" as const, | ||
enum: ["option1", "option2"], | ||
enumNames: ["Option 1", "Option 2"], |
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.
enumNames
is not part of the JSONSchema spec. The recommended way to describe enum labels is with oneOf
or anyOf
.
role: { | ||
type: "string", | ||
enum: ["admin", "user", "guest"], | ||
enumNames: ["Administrator", "User", "Guest"], |
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.
enumNames
is not part of the JSONSchema spec. The recommended way to describe enum labels is with oneOf
or anyOf
.
@@ -140,36 +140,144 @@ const DynamicJsonForm = ({ | |||
); | |||
} | |||
| |||
const isFieldRequired = (fieldPath: string[]): boolean => { | |||
if (typeof schema.required === "boolean") { |
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.
should only be a string array after fix to jsonUtils.ts
.
<option value="">Select an option...</option> | ||
{propSchema.enum.map((option, index) => ( | ||
<option key={option} value={option}> | ||
{propSchema.enumNames?.[index] || option} |
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.
enumNames
is not part of the JSONSchema spec. The recommended way to describe enum labels is with oneOf
or anyOf
.
const schema: JsonSchemaType = { | ||
type: "string", | ||
enum: ["val1", "val2"], | ||
enumNames: ["Label 1", "Label 2"], |
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.
enumNames
is not part of the JSONSchema spec. The recommended way to describe enum labels is with oneOf
or anyOf
.
country: { | ||
type: "string", | ||
enum: ["US", "UK", "CA"], | ||
enumNames: ["United States", "United Kingdom", "Canada"], |
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.
enumNames
is not part of the JSONSchema spec. The recommended way to describe enum labels is with oneOf
or anyOf
.
Received, will add this too. Out this weekend but adding it on Monday/Tuesday - does that work out? |
Co-authored-by: Cliff Hall <cliff@futurescale.com>
Co-authored-by: Cliff Hall <cliff@futurescale.com>
…enums - Make JsonSchemaType.type optional to support const-only schemas - Add JsonSchemaConst type for schema objects using const values - Update oneOf/anyOf to accept both full schemas and const schemas - Add comprehensive tests for oneOf with const and title patterns This fixes TypeScript compilation errors when using the JSON Schema specification's recommended approach for labeled enums: { "type": "string", "oneOf": [{ "const": "red", "title": "Stop" }] } Replaces deprecated enumNames pattern with spec-compliant implementation.
…v/mcp-debug into feature/elicitations
…v/mcp-debug into feature/elicitations
@QuantGeekDev you need to merge main into your branch. |
@cliffhall Updated with the feedback, thanks for taking the time to give it. I think this is ready for UAT. Here's a video showing the new functionality in action |
Part of me thinks it makes sense to redirect the user back to the tool call after they complete the elicitation @cliffhall, you can see that it's a bit awkward navigating back to the tool response |
Definitely, we should send the user back to the tool tab to view the response. |
Btw, there was a different elicitation demo change open for the Everything server here that was just buried in the other server PRs, I think we're going to use this one and close the other one: modelcontextprotocol/servers#2215 |
@QuantGeekDev another thing is, if the user declines elicitation, this current PR is not showing the result after the tool call. |
Added support for elicitation introduced in the 2025-06-18 specification update. Works across Tools, Resources and Prompts.
This PR depends on #532 for using elicitation from the sdk
Motivation and Context
Adds the ability for users to debug and test the new elicitation feature
How Has This Been Tested?
Here is a video showcasing the functionality and testing
Tested against a demo server I built to test elicitations mcp-elicitations server that implements elicitation in tools, prompts, and resources with the @modelcontextprotocol/sdk@0.1.13
The server is also accessible via this url
https://weekly-mink.mcpstudio.io/mcp
You can replicate results by checking out this branch, and connecting the inspector to the hosted server url via streamable-http. Then try to use any of the prompts, tools, or resources. I recommend increasing the request timeout in the inspector configuration
I would appreciate feedback on this - are modals a good way to represent elicitation in the inspector?
Breaking Changes
No, this is a new feature of the protocol that has to be specifically invoked in server code
Types of changes
Checklist