-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmcp-scoped.all.hurl
More file actions
339 lines (319 loc) · 9.61 KB
/
Copy pathmcp-scoped.all.hurl
File metadata and controls
339 lines (319 loc) · 9.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# A policy may be narrower than the whole instance, and the `mcp` policy here
# governs the MCP endpoint alone while `registry` governs everything. A key
# from the narrow policy therefore opens the transport without opening the
# schema surface, and every JSON-RPC message it sends still has to be checked
# for well-formedness against a schema that lives on that closed surface.
# Checking it as if the caller had asked for it refused the instance its own
# bookkeeping and aborted the process, so a bare ping on this key was enough to
# take the server down. The instance owns those schemas rather than serving
# them here, and this file holds that apart: the narrow key is answered, the
# closed surface stays closed to it, and malformed messages are still rejected.
# The narrow key cannot read the schema surface, which is what makes the rest
# of this file meaningful rather than incidental
GET {{base}}/self/v1/schemas/mcp/request
Authorization: Bearer mcp-secret-key
HTTP 401
Cache-Control: no-store
Content-Type: application/problem+json
WWW-Authenticate: Bearer realm="registry"
Link: </self/v1/schemas/api/error>; rel="describedby"
Access-Control-Allow-Origin: *
[Captures]
denied_body: body
error_schema: header "Link" regex "<([^>]+)>"
{
"type": "urn:sourcemeta:one:authentication-required",
"title": "Unauthorized",
"status": 401,
"detail": "This resource requires authentication"
}
# The round-trip runs on the wide key, since the evaluate endpoint is itself
# behind the policy that closes the instance
POST {{base}}/self/v1/api/schemas/evaluate{{error_schema}}
Authorization: Bearer full-secret-key
```
{{denied_body}}
```
HTTP 200
[Asserts]
jsonpath "$.valid" == true
# A bare ping is the whole regression: it names no schema and reads no
# content, and it once aborted the process
POST {{base}}/self/v1/mcp
Authorization: Bearer mcp-secret-key
MCP-Protocol-Version: 2025-11-25
Content-Type: application/json
```
{ "jsonrpc": "2.0", "id": 1, "method": "ping" }
```
HTTP 200
Cache-Control: no-store
Content-Type: application/json
Link: </self/v1/schemas/mcp/response>; rel="describedby"
Access-Control-Expose-Headers: Link, ETag
[Captures]
ping_body: body
mcp_schema: header "Link" regex "<([^>]+)>"
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}
POST {{base}}/self/v1/api/schemas/evaluate{{mcp_schema}}
Authorization: Bearer full-secret-key
```
{{ping_body}}
```
HTTP 200
[Asserts]
jsonpath "$.valid" == true
# The handshake answers on the narrow key too
POST {{base}}/self/v1/mcp
Authorization: Bearer mcp-secret-key
MCP-Protocol-Version: 2025-11-25
Content-Type: application/json
```
{ "jsonrpc": "2.0", "id": 2, "method": "initialize", "params": { "protocolVersion": "2025-11-25", "capabilities": {}, "clientInfo": { "name": "scoped", "version": "1" } } }
```
HTTP 200
Cache-Control: no-store
Content-Type: application/json
Link: </self/v1/schemas/mcp/response>; rel="describedby"
[Captures]
initialize_body: body
[Asserts]
jsonpath "$.error" not exists
jsonpath "$.jsonrpc" == "2.0"
jsonpath "$.id" == 2
jsonpath "$.result.protocolVersion" == "2025-11-25"
jsonpath "$.result.capabilities.resources" exists
jsonpath "$.result.capabilities.tools" exists
jsonpath "$.result.serverInfo.name" == "sourcemeta-one-enterprise"
jsonpath "$.result.serverInfo.title" == "Sourcemeta One Enterprise"
jsonpath "$.result.serverInfo.websiteUrl" == "{{base}}"
jsonpath "$.result.instructions" contains "Fully Private Sandbox"
POST {{base}}/self/v1/api/schemas/evaluate{{mcp_schema}}
Authorization: Bearer full-secret-key
```
{{initialize_body}}
```
HTTP 200
[Asserts]
jsonpath "$.valid" == true
# The tool list is the instance's own description of itself rather than
# catalog content, so the narrow key sees all of it
POST {{base}}/self/v1/mcp
Authorization: Bearer mcp-secret-key
MCP-Protocol-Version: 2025-11-25
Content-Type: application/json
```
{ "jsonrpc": "2.0", "id": 3, "method": "tools/list" }
```
HTTP 200
Cache-Control: no-store
Content-Type: application/json
Link: </self/v1/schemas/mcp/response>; rel="describedby"
[Captures]
tools_body: body
[Asserts]
jsonpath "$.error" not exists
jsonpath "$.jsonrpc" == "2.0"
jsonpath "$.id" == 3
jsonpath "$.result.tools" count == 12
jsonpath "$.result.tools[*].name" includes "list_directory"
jsonpath "$.result.tools[*].name" includes "search_schemas"
jsonpath "$.result.tools[*].name" includes "evaluate_schema"
jsonpath "$.result.tools[*].name" includes "trace_schema_evaluation"
jsonpath "$.result.tools[*].name" includes "instance_to_rdf"
jsonpath "$.result.tools[*].name" includes "get_schema_metadata"
jsonpath "$.result.tools[*].name" includes "get_schema_dependencies"
jsonpath "$.result.tools[*].name" includes "get_schema_dependents"
jsonpath "$.result.tools[*].name" includes "get_schema_health"
jsonpath "$.result.tools[*].name" includes "get_schema_locations"
jsonpath "$.result.tools[*].name" includes "get_schema_positions"
jsonpath "$.result.tools[*].name" includes "get_schema_stats"
POST {{base}}/self/v1/api/schemas/evaluate{{mcp_schema}}
Authorization: Bearer full-secret-key
```
{{tools_body}}
```
HTTP 200
[Asserts]
jsonpath "$.valid" == true
# Answering the transport is not the same as opening the catalog. Every schema
# on this instance sits behind the wide policy, so the narrow key enumerates
# nothing and the empty list is the whole body
POST {{base}}/self/v1/mcp
Authorization: Bearer mcp-secret-key
MCP-Protocol-Version: 2025-11-25
Content-Type: application/json
```
{ "jsonrpc": "2.0", "id": 4, "method": "resources/list" }
```
HTTP 200
Cache-Control: no-store
Content-Type: application/json
Link: </self/v1/schemas/mcp/response>; rel="describedby"
[Captures]
resources_body: body
[Asserts]
jsonpath "$.result.nextCursor" not exists
{
"jsonrpc": "2.0",
"id": 4,
"result": {
"resources": []
}
}
POST {{base}}/self/v1/api/schemas/evaluate{{mcp_schema}}
Authorization: Bearer full-secret-key
```
{{resources_body}}
```
HTTP 200
[Asserts]
jsonpath "$.valid" == true
# Naming a gated schema outright is refused rather than served
POST {{base}}/self/v1/mcp
Authorization: Bearer mcp-secret-key
MCP-Protocol-Version: 2025-11-25
Content-Type: application/json
```
{ "jsonrpc": "2.0", "id": 5, "method": "resources/read", "params": { "uri": "{{base}}/catalog/classified" } }
```
HTTP 200
Cache-Control: no-store
Content-Type: application/json
Link: </self/v1/schemas/mcp/response>; rel="describedby"
[Captures]
read_body: body
{
"jsonrpc": "2.0",
"id": 5,
"error": {
"code": -32010,
"message": "Authentication required"
}
}
POST {{base}}/self/v1/api/schemas/evaluate{{mcp_schema}}
Authorization: Bearer full-secret-key
```
{{read_body}}
```
HTTP 200
[Asserts]
jsonpath "$.valid" == true
# A tool that walks the catalog is refused the same way, as a tool result
# rather than a protocol error
POST {{base}}/self/v1/mcp
Authorization: Bearer mcp-secret-key
MCP-Protocol-Version: 2025-11-25
Content-Type: application/json
```
{ "jsonrpc": "2.0", "id": 6, "method": "tools/call", "params": { "name": "list_directory", "arguments": { "path": "/" } } }
```
HTTP 200
Cache-Control: no-store
Content-Type: application/json
Link: </self/v1/schemas/mcp/response>; rel="describedby"
[Captures]
call_body: body
{
"jsonrpc": "2.0",
"id": 6,
"result": {
"content": [
{
"type": "text",
"text": "Authentication required"
}
],
"isError": true
}
}
POST {{base}}/self/v1/api/schemas/evaluate{{mcp_schema}}
Authorization: Bearer full-secret-key
```
{{call_body}}
```
HTTP 200
[Asserts]
jsonpath "$.valid" == true
# Resolving those schemas apart from the caller must not stop them being
# applied, so a message the protocol forbids is still refused on the narrow key
POST {{base}}/self/v1/mcp
Authorization: Bearer mcp-secret-key
MCP-Protocol-Version: 2025-11-25
Content-Type: application/json
```
{ "jsonrpc": "2.0", "id": null, "method": "ping" }
```
HTTP 200
Cache-Control: no-store
Content-Type: application/json
Link: </self/v1/schemas/mcp/response>; rel="describedby"
[Captures]
malformed_body: body
{
"jsonrpc": "2.0",
"id": null,
"error": {
"code": -32600,
"message": "Invalid Request"
}
}
POST {{base}}/self/v1/api/schemas/evaluate{{mcp_schema}}
Authorization: Bearer full-secret-key
```
{{malformed_body}}
```
HTTP 200
[Asserts]
jsonpath "$.valid" == true
# A credential belonging to no policy is still refused at the transport
POST {{base}}/self/v1/mcp
Authorization: Bearer not-any-key
MCP-Protocol-Version: 2025-11-25
Content-Type: application/json
```
{ "jsonrpc": "2.0", "id": 7, "method": "ping" }
```
HTTP 401
Cache-Control: no-store
Content-Type: application/problem+json
WWW-Authenticate: Bearer realm="registry", resource_metadata="{{base}}/.well-known/oauth-protected-resource/self/v1/mcp"
Link: </self/v1/schemas/api/error>; rel="describedby"
[Captures]
wrong_body: body
{
"type": "urn:sourcemeta:one:authentication-required",
"title": "Unauthorized",
"status": 401,
"detail": "This resource requires authentication"
}
POST {{base}}/self/v1/api/schemas/evaluate{{error_schema}}
Authorization: Bearer full-secret-key
```
{{wrong_body}}
```
HTTP 200
[Asserts]
jsonpath "$.valid" == true
# The narrow policy reaches its own endpoint and no further, so the key that
# opens the transport does not open a sibling surface
GET {{base}}/self/v1/static/style.min.css
Authorization: Bearer mcp-secret-key
HTTP 401
Cache-Control: no-store
WWW-Authenticate: Bearer realm="registry"
[Asserts]
jsonpath "$.type" == "urn:sourcemeta:one:authentication-required"
jsonpath "$.status" == 401
GET {{base}}/catalog/example.json
Authorization: Bearer mcp-secret-key
HTTP 401
Cache-Control: no-store
WWW-Authenticate: Bearer realm="registry"
[Asserts]
jsonpath "$.type" == "urn:sourcemeta:one:authentication-required"
jsonpath "$.status" == 401