Skip to content

Commit 26266b9

Browse files
authored
Add basic MCP community tests to test/e2e/path (#869)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent cc4262f commit 26266b9

2 files changed

Lines changed: 211 additions & 0 deletions

File tree

test/e2e/path/hurl/mcp.all.hurl

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
GET {{base}}/v1/catalog/self/v1/mcp
2+
HTTP 405
3+
Content-Type: application/json
4+
Access-Control-Allow-Origin: http://localhost:8000
5+
Link: </v1/catalog/self/v1/schemas/mcp/response>; rel="describedby"
6+
[Captures]
7+
last_response: body
8+
schema_path: header "Link" regex "</v1/catalog([^>]+)>"
9+
[Asserts]
10+
jsonpath "$.jsonrpc" == "2.0"
11+
jsonpath "$.id" not exists
12+
jsonpath "$.error.code" == 4
13+
jsonpath "$.error.message" == "Method not allowed"
14+
15+
POST {{base}}/v1/catalog/self/v1/api/schemas/evaluate{{schema_path}}
16+
```
17+
{{last_response}}
18+
```
19+
HTTP 200
20+
[Asserts]
21+
jsonpath "$.valid" == true
22+
23+
DELETE {{base}}/v1/catalog/self/v1/mcp
24+
HTTP 405
25+
Content-Type: application/json
26+
Access-Control-Allow-Origin: http://localhost:8000
27+
Link: </v1/catalog/self/v1/schemas/mcp/response>; rel="describedby"
28+
[Captures]
29+
last_response: body
30+
schema_path: header "Link" regex "</v1/catalog([^>]+)>"
31+
[Asserts]
32+
jsonpath "$.jsonrpc" == "2.0"
33+
jsonpath "$.id" not exists
34+
jsonpath "$.error.code" == 4
35+
jsonpath "$.error.message" == "Method not allowed"
36+
37+
POST {{base}}/v1/catalog/self/v1/api/schemas/evaluate{{schema_path}}
38+
```
39+
{{last_response}}
40+
```
41+
HTTP 200
42+
[Asserts]
43+
jsonpath "$.valid" == true
44+
45+
PUT {{base}}/v1/catalog/self/v1/mcp
46+
HTTP 405
47+
Content-Type: application/json
48+
Access-Control-Allow-Origin: http://localhost:8000
49+
Link: </v1/catalog/self/v1/schemas/mcp/response>; rel="describedby"
50+
[Captures]
51+
last_response: body
52+
schema_path: header "Link" regex "</v1/catalog([^>]+)>"
53+
[Asserts]
54+
jsonpath "$.jsonrpc" == "2.0"
55+
jsonpath "$.id" not exists
56+
jsonpath "$.error.code" == 4
57+
jsonpath "$.error.message" == "Method not allowed"
58+
59+
POST {{base}}/v1/catalog/self/v1/api/schemas/evaluate{{schema_path}}
60+
```
61+
{{last_response}}
62+
```
63+
HTTP 200
64+
[Asserts]
65+
jsonpath "$.valid" == true
66+
67+
OPTIONS {{base}}/v1/catalog/self/v1/mcp
68+
HTTP 204
69+
[Asserts]
70+
bytes count == 0
71+
header "Access-Control-Allow-Origin" == "http://localhost:8000"
72+
header "Access-Control-Allow-Methods" == "POST, OPTIONS"
73+
header "Access-Control-Allow-Headers" == "Content-Type, MCP-Protocol-Version"
74+
header "Access-Control-Max-Age" == "3600"
75+
76+
# The MCP route is mounted under /v1/catalog. Requests without the base path
77+
# must not match.
78+
79+
GET {{base}}/self/v1/mcp
80+
HTTP 404
81+
Content-Type: application/problem+json
82+
Access-Control-Allow-Origin: *
83+
[Asserts]
84+
jsonpath "$.status" == 404
85+
jsonpath "$.title" == "sourcemeta:one/not-found"
86+
87+
POST {{base}}/self/v1/mcp
88+
Content-Type: application/json
89+
```
90+
{ "jsonrpc": "2.0", "id": 1, "method": "ping" }
91+
```
92+
HTTP 404
93+
94+
OPTIONS {{base}}/self/v1/mcp
95+
HTTP 404
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
POST {{base}}/v1/catalog/self/v1/mcp
2+
Content-Type: application/json
3+
```
4+
{
5+
"jsonrpc": "2.0",
6+
"id": 1,
7+
"method": "initialize",
8+
"params": {
9+
"protocolVersion": "2025-11-25",
10+
"capabilities": {},
11+
"clientInfo": { "name": "hurl", "version": "1.0.0" }
12+
}
13+
}
14+
```
15+
HTTP 200
16+
Content-Type: application/json
17+
Access-Control-Allow-Origin: http://localhost:8000
18+
Link: </v1/catalog/self/v1/schemas/mcp/response>; rel="describedby"
19+
[Captures]
20+
last_response: body
21+
schema_path: header "Link" regex "</v1/catalog([^>]+)>"
22+
[Asserts]
23+
jsonpath "$.jsonrpc" == "2.0"
24+
jsonpath "$.id" not exists
25+
jsonpath "$.error.code" == 1
26+
jsonpath "$.error.message" == "Enterprise edition required"
27+
jsonpath "$.error.data" == "MCP support is only available in the Enterprise edition of Sourcemeta One"
28+
29+
POST {{base}}/v1/catalog/self/v1/api/schemas/evaluate{{schema_path}}
30+
```
31+
{{last_response}}
32+
```
33+
HTTP 200
34+
[Asserts]
35+
jsonpath "$.valid" == true
36+
37+
POST {{base}}/v1/catalog/self/v1/mcp
38+
Content-Type: application/json
39+
```
40+
{ "jsonrpc": "2.0", "method": "notifications/initialized" }
41+
```
42+
HTTP 200
43+
Content-Type: application/json
44+
Access-Control-Allow-Origin: http://localhost:8000
45+
Link: </v1/catalog/self/v1/schemas/mcp/response>; rel="describedby"
46+
[Captures]
47+
last_response: body
48+
schema_path: header "Link" regex "</v1/catalog([^>]+)>"
49+
[Asserts]
50+
jsonpath "$.jsonrpc" == "2.0"
51+
jsonpath "$.id" not exists
52+
jsonpath "$.error.code" == 1
53+
jsonpath "$.error.message" == "Enterprise edition required"
54+
jsonpath "$.error.data" == "MCP support is only available in the Enterprise edition of Sourcemeta One"
55+
56+
POST {{base}}/v1/catalog/self/v1/api/schemas/evaluate{{schema_path}}
57+
```
58+
{{last_response}}
59+
```
60+
HTTP 200
61+
[Asserts]
62+
jsonpath "$.valid" == true
63+
64+
POST {{base}}/v1/catalog/self/v1/mcp
65+
Content-Type: application/json
66+
```
67+
this is not even json
68+
```
69+
HTTP 200
70+
Content-Type: application/json
71+
Access-Control-Allow-Origin: http://localhost:8000
72+
Link: </v1/catalog/self/v1/schemas/mcp/response>; rel="describedby"
73+
[Captures]
74+
last_response: body
75+
schema_path: header "Link" regex "</v1/catalog([^>]+)>"
76+
[Asserts]
77+
jsonpath "$.jsonrpc" == "2.0"
78+
jsonpath "$.id" not exists
79+
jsonpath "$.error.code" == 1
80+
jsonpath "$.error.message" == "Enterprise edition required"
81+
jsonpath "$.error.data" == "MCP support is only available in the Enterprise edition of Sourcemeta One"
82+
83+
POST {{base}}/v1/catalog/self/v1/api/schemas/evaluate{{schema_path}}
84+
```
85+
{{last_response}}
86+
```
87+
HTTP 200
88+
[Asserts]
89+
jsonpath "$.valid" == true
90+
91+
POST {{base}}/v1/catalog/self/v1/mcp
92+
Content-Type: application/json
93+
```
94+
[ { "jsonrpc": "2.0", "id": 1, "method": "ping" } ]
95+
```
96+
HTTP 200
97+
Content-Type: application/json
98+
Access-Control-Allow-Origin: http://localhost:8000
99+
Link: </v1/catalog/self/v1/schemas/mcp/response>; rel="describedby"
100+
[Captures]
101+
last_response: body
102+
schema_path: header "Link" regex "</v1/catalog([^>]+)>"
103+
[Asserts]
104+
jsonpath "$.jsonrpc" == "2.0"
105+
jsonpath "$.id" not exists
106+
jsonpath "$.error.code" == 1
107+
jsonpath "$.error.message" == "Enterprise edition required"
108+
jsonpath "$.error.data" == "MCP support is only available in the Enterprise edition of Sourcemeta One"
109+
110+
POST {{base}}/v1/catalog/self/v1/api/schemas/evaluate{{schema_path}}
111+
```
112+
{{last_response}}
113+
```
114+
HTTP 200
115+
[Asserts]
116+
jsonpath "$.valid" == true

0 commit comments

Comments
 (0)