stack-service-base 0.0.61 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b2a0c9fe77d015ea98f8faa3dbc2a8223e0a11e98350f52441fc548b2e28b8b
|
|
4
|
+
data.tar.gz: 2a25d592bc25d53f153115e41dedfa28f24b0fc3614a4b66a9452a29c8763914
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 022a58977a0306566c0ffc6e9ca3114444823d8635c7096f67adaa85d1be448e9c05965f9280e8779646bd38a0c7da5e4ae03baf7d0acafe13600fb8b69c3513
|
|
7
|
+
data.tar.gz: fddfab6fccc631fdf4a9620300ad87c5b660b6b8a137e2862e33f10d3ecfedb881885a70c6e89c17a5159437c79c95a9f43452e7c1848fb4d69516944fba8cfd
|
|
@@ -44,7 +44,7 @@ class McpProcessor
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def list_tools
|
|
47
|
-
{ tools: ToolRegistry.list, nextCursor:
|
|
47
|
+
{ tools: ToolRegistry.list, nextCursor: 'no-more' }
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
def root_response
|
|
@@ -62,9 +62,12 @@ class McpProcessor
|
|
|
62
62
|
def handle(method:, params:, body: )
|
|
63
63
|
case method
|
|
64
64
|
when "tools/list" then list_tools
|
|
65
|
+
# when "resources/list" then {}
|
|
66
|
+
# when "prompts/list" then {}
|
|
65
67
|
when "tools/call" then call_tool(params || {})
|
|
66
68
|
when "initialize" then initialize_(body)
|
|
67
|
-
when "initialized" then {}
|
|
69
|
+
when "notifications/initialized" then LOGGER.debug params; {}
|
|
70
|
+
when "logging/setLevel" then LOGGER.debug params; {}
|
|
68
71
|
else
|
|
69
72
|
rpc_error!(-32601, "Unknown method #{method}")
|
|
70
73
|
end
|
|
@@ -73,13 +76,12 @@ class McpProcessor
|
|
|
73
76
|
# https://gist.github.com/ruvnet/7b6843c457822cbcf42fc4aa635eadbb
|
|
74
77
|
|
|
75
78
|
def initialize_(body)
|
|
76
|
-
body[:serverInfo] = {
|
|
77
|
-
name: 'mcp-server',
|
|
78
|
-
title: 'MCP Server',
|
|
79
|
-
version: '1.0.0'
|
|
80
|
-
}
|
|
81
|
-
# result
|
|
82
79
|
{
|
|
80
|
+
serverInfo: {
|
|
81
|
+
name: 'mcp-server',
|
|
82
|
+
title: 'MCP Server',
|
|
83
|
+
version: '1.0.0'
|
|
84
|
+
},
|
|
83
85
|
protocolVersion: PROTOCOL_VERSION,
|
|
84
86
|
capabilities: {
|
|
85
87
|
logging: {},
|
|
@@ -195,16 +195,21 @@ module RackHelpers
|
|
|
195
195
|
end
|
|
196
196
|
|
|
197
197
|
app.use Rack.middleware_klass do |env, app|
|
|
198
|
-
code, headers, body = env['REQUEST_METHOD'] == 'OPTIONS' ? [
|
|
198
|
+
code, headers, body = env['REQUEST_METHOD'] == 'OPTIONS' ? [204, {}, []] : app.call(env)
|
|
199
199
|
|
|
200
200
|
# scheme = env['rack.url_scheme']
|
|
201
201
|
# referer = URI.parse env['HTTP_REFERER']
|
|
202
|
+
origin = env['HTTP_ORIGIN'] || '*'
|
|
202
203
|
headers.merge!(
|
|
203
204
|
# 'Access-Control-Allow-Origin' => "#{referer.scheme}://#{referer.host}",
|
|
204
|
-
'Access-Control-Allow-Origin' =>
|
|
205
|
+
'Access-Control-Allow-Origin' => origin,
|
|
206
|
+
'Vary' => 'Orign',
|
|
205
207
|
'Access-Control-Allow-Methods' => 'GET, PUT, POST, PATCH, DELETE, HEAD, OPTIONS',
|
|
206
208
|
'Access-Control-Allow-Headers' => '*',
|
|
207
|
-
'Access-Control-
|
|
209
|
+
'Access-Control-Expose-Headers' => '*', # 'mcp-session-id'
|
|
210
|
+
'Access-Control-Allow-Credentials' => 'true',
|
|
211
|
+
'Access-Control-Max-Age' => '6000'
|
|
212
|
+
)
|
|
208
213
|
[code, headers, body]
|
|
209
214
|
end
|
|
210
215
|
|