Skip to content

Commit a44b254

Browse files
semistrictJBUinfo
authored andcommitted
feat: implement MCP elicitation support (#413)
* Add ElicitationRequest, ElicitationResult, and related types to mcp/types.go * Implement server-side RequestElicitation method with session support * Add client-side ElicitationHandler interface and request handling * Implement elicitation in stdio and in-process transports * Add comprehensive tests following sampling patterns * Create elicitation example demonstrating usage patterns * Use 'Elicitation' prefix for type names to maintain clarity
1 parent 1279298 commit a44b254

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

server/session.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ type SessionWithElicitation interface {
5959
RequestElicitation(ctx context.Context, request mcp.ElicitationRequest) (*mcp.ElicitationResult, error)
6060
}
6161

62+
// SessionWithElicitation is an extension of ClientSession that can send elicitation requests
63+
type SessionWithElicitation interface {
64+
ClientSession
65+
// RequestElicitation sends an elicitation request to the client and waits for response
66+
RequestElicitation(ctx context.Context, request mcp.ElicitationRequest) (*mcp.ElicitationResult, error)
67+
}
68+
6269
// SessionWithStreamableHTTPConfig extends ClientSession to support streamable HTTP transport configurations
6370
type SessionWithStreamableHTTPConfig interface {
6471
ClientSession

0 commit comments

Comments
 (0)