Skip to content

Commit d31c3da

Browse files
authored
Merge pull request #178 from koic/add_elicitation_skeleton
Add Elicitation skeleton
2 parents 14ef006 + dd458b1 commit d31c3da

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,12 @@ Set `stateless: true` in `MCP::Server::Transports::StreamableHTTPTransport.new`
151151
transport = MCP::Server::Transports::StreamableHTTPTransport.new(server, stateless: true)
152152
```
153153

154-
### Unsupported Features ( to be implemented in future versions )
154+
### Unsupported Features (to be implemented in future versions)
155155

156156
- Log Level
157157
- Resource subscriptions
158158
- Completions
159+
- Elicitation
159160

160161
### Usage
161162

lib/mcp/methods.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module Methods
2121

2222
ROOTS_LIST = "roots/list"
2323
SAMPLING_CREATE_MESSAGE = "sampling/createMessage"
24+
ELICITATION_CREATE = "elicitation/create"
2425

2526
# Notification methods
2627
NOTIFICATIONS_INITIALIZED = "notifications/initialized"
@@ -76,6 +77,8 @@ def ensure_capability!(method, capabilities)
7677
require_capability!(method, capabilities, :roots, :listChanged)
7778
when SAMPLING_CREATE_MESSAGE
7879
require_capability!(method, capabilities, :sampling)
80+
when ELICITATION_CREATE
81+
require_capability!(method, capabilities, :elicitation)
7982
when INITIALIZE, PING, NOTIFICATIONS_INITIALIZED, NOTIFICATIONS_PROGRESS, NOTIFICATIONS_CANCELLED
8083
# No specific capability required for initialize, ping, progress or cancelled
8184
end

lib/mcp/server.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def initialize(
8080
Methods::RESOURCES_UNSUBSCRIBE => ->(_) {},
8181
Methods::COMPLETION_COMPLETE => ->(_) {},
8282
Methods::LOGGING_SET_LEVEL => ->(_) {},
83+
Methods::ELICITATION_CREATE => ->(_) {},
8384
}
8485
@transport = transport
8586
end

test/mcp/methods_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ def ensure_capability_does_not_raise_for(method, capabilities: {})
7474

7575
ensure_capability_raises_error_for Methods::SAMPLING_CREATE_MESSAGE, required_capability_name: "sampling"
7676

77+
ensure_capability_raises_error_for Methods::ELICITATION_CREATE, required_capability_name: "elicitation"
78+
7779
# Methods and notifications of both server and client
7880
ensure_capability_does_not_raise_for Methods::PING
7981
ensure_capability_does_not_raise_for Methods::NOTIFICATIONS_PROGRESS

0 commit comments

Comments
 (0)