diff --git a/enterprise/e2e/auth/hurl/mcp-resources.all.hurl b/enterprise/e2e/auth/hurl/mcp-resources.all.hurl new file mode 100644 index 000000000..65780fa35 --- /dev/null +++ b/enterprise/e2e/auth/hurl/mcp-resources.all.hurl @@ -0,0 +1,1268 @@ +# `resources/list` is filtered against the caller's credential at request time. +# An anonymous caller enumerates only the public schemas plus the public +# `/self` API schemas. Every entry on every page is asserted so a protected +# schema cannot slip in unnoticed. + +POST {{base}}/self/v1/mcp +Accept: application/json, text/event-stream +MCP-Protocol-Version: 2025-11-25 +Content-Type: application/json +``` +{ + "jsonrpc": "2.0", + "id": 1, + "method": "resources/list" +} +``` +HTTP 200 +Cache-Control: no-store +Content-Type: application/json +Access-Control-Allow-Origin: {{base}} +Access-Control-Expose-Headers: Link, ETag +Link: ; rel="describedby" +MCP-Protocol-Version: 2025-11-25 +[Captures] +anonymous_list: body +anonymous_list_schema: header "Link" regex "<([^>]+)>" +[Asserts] +header "Vary" not exists +jsonpath "$.jsonrpc" == "2.0" +jsonpath "$.id" == 1 +jsonpath "$.result.resources" count == 50 +jsonpath "$.result.nextCursor" == "50" +jsonpath "$.result.resources[0].uri" == "{{base}}/private/open/shared" +jsonpath "$.result.resources[0].name" == "/private/open/shared" +jsonpath "$.result.resources[0].mimeType" == "application/schema+json" +jsonpath "$.result.resources[0].size" == 138 +jsonpath "$.result.resources[0].annotations.priority" == 0.5 +jsonpath "$.result.resources[1].uri" == "{{base}}/public/string" +jsonpath "$.result.resources[1].name" == "/public/string" +jsonpath "$.result.resources[1].mimeType" == "application/schema+json" +jsonpath "$.result.resources[1].size" == 131 +jsonpath "$.result.resources[1].annotations.priority" == 0.5 +jsonpath "$.result.resources[2].uri" == "{{base}}/self/v1/schemas/api/error" +jsonpath "$.result.resources[2].name" == "Sourcemeta One API Error" +jsonpath "$.result.resources[2].description" == "The error response format returned by the Sourcemeta One API endpoints" +jsonpath "$.result.resources[2].mimeType" == "application/schema+json" +jsonpath "$.result.resources[2].size" == 5693 +jsonpath "$.result.resources[2].annotations.priority" == 0.0 +jsonpath "$.result.resources[3].uri" == "{{base}}/self/v1/schemas/api/list/response" +jsonpath "$.result.resources[3].name" == "Sourcemeta One List API Response" +jsonpath "$.result.resources[3].description" == "The response format for the directory listing API endpoint" +jsonpath "$.result.resources[3].mimeType" == "application/schema+json" +jsonpath "$.result.resources[3].size" == 3581 +jsonpath "$.result.resources[3].annotations.priority" == 0.0 +jsonpath "$.result.resources[4].uri" == "{{base}}/self/v1/schemas/api/schemas/dependencies/response" +jsonpath "$.result.resources[4].name" == "Sourcemeta One Schema Dependencies API Response" +jsonpath "$.result.resources[4].description" == "The response format for the schema dependencies API endpoint" +jsonpath "$.result.resources[4].mimeType" == "application/schema+json" +jsonpath "$.result.resources[4].size" == 992 +jsonpath "$.result.resources[4].annotations.priority" == 0.0 +jsonpath "$.result.resources[5].uri" == "{{base}}/self/v1/schemas/api/schemas/dependents/response" +jsonpath "$.result.resources[5].name" == "Sourcemeta One Schema Dependents API Response" +jsonpath "$.result.resources[5].description" == "The response format for the schema dependents API endpoint" +jsonpath "$.result.resources[5].mimeType" == "application/schema+json" +jsonpath "$.result.resources[5].size" == 986 +jsonpath "$.result.resources[5].annotations.priority" == 0.0 +jsonpath "$.result.resources[6].uri" == "{{base}}/self/v1/schemas/api/schemas/evaluate/request" +jsonpath "$.result.resources[6].name" == "Sourcemeta One Schema Evaluate API Request" +jsonpath "$.result.resources[6].description" == "The JSON instance to validate against a schema in the catalog" +jsonpath "$.result.resources[6].mimeType" == "application/schema+json" +jsonpath "$.result.resources[6].size" == 417 +jsonpath "$.result.resources[6].annotations.priority" == 0.0 +jsonpath "$.result.resources[7].uri" == "{{base}}/self/v1/schemas/api/schemas/evaluate/response" +jsonpath "$.result.resources[7].name" == "Sourcemeta One Schema Evaluate API Response" +jsonpath "$.result.resources[7].description" == "The response format for the schema evaluation API endpoint" +jsonpath "$.result.resources[7].mimeType" == "application/schema+json" +jsonpath "$.result.resources[7].size" == 3049 +jsonpath "$.result.resources[7].annotations.priority" == 0.0 +jsonpath "$.result.resources[8].uri" == "{{base}}/self/v1/schemas/api/schemas/health/response" +jsonpath "$.result.resources[8].name" == "Sourcemeta One Schema Health API Response" +jsonpath "$.result.resources[8].description" == "The response format for the schema health API endpoint" +jsonpath "$.result.resources[8].mimeType" == "application/schema+json" +jsonpath "$.result.resources[8].size" == 1584 +jsonpath "$.result.resources[8].annotations.priority" == 0.0 +jsonpath "$.result.resources[9].uri" == "{{base}}/self/v1/schemas/api/schemas/locations/response" +jsonpath "$.result.resources[9].name" == "Sourcemeta One Schema Locations API Response" +jsonpath "$.result.resources[9].description" == "The response format for the schema frame locations API endpoint" +jsonpath "$.result.resources[9].mimeType" == "application/schema+json" +jsonpath "$.result.resources[9].size" == 2402 +jsonpath "$.result.resources[9].annotations.priority" == 0.0 +jsonpath "$.result.resources[10].uri" == "{{base}}/self/v1/schemas/api/schemas/metadata/response" +jsonpath "$.result.resources[10].name" == "Sourcemeta One Schema Metadata API Response" +jsonpath "$.result.resources[10].description" == "The response format for the schema metadata API endpoint" +jsonpath "$.result.resources[10].mimeType" == "application/schema+json" +jsonpath "$.result.resources[10].size" == 2840 +jsonpath "$.result.resources[10].annotations.priority" == 0.0 +jsonpath "$.result.resources[11].uri" == "{{base}}/self/v1/schemas/api/schemas/position" +jsonpath "$.result.resources[11].name" == "Sourcemeta One Schema Position" +jsonpath "$.result.resources[11].description" == "Represents a position in a JSON document as line start, column start, line end, and column end" +jsonpath "$.result.resources[11].mimeType" == "application/schema+json" +jsonpath "$.result.resources[11].size" == 446 +jsonpath "$.result.resources[11].annotations.priority" == 0.0 +jsonpath "$.result.resources[12].uri" == "{{base}}/self/v1/schemas/api/schemas/positions/response" +jsonpath "$.result.resources[12].name" == "Sourcemeta One Schema Positions API Response" +jsonpath "$.result.resources[12].description" == "The response format for the schema positions API endpoint" +jsonpath "$.result.resources[12].mimeType" == "application/schema+json" +jsonpath "$.result.resources[12].size" == 435 +jsonpath "$.result.resources[12].annotations.priority" == 0.0 +jsonpath "$.result.resources[13].uri" == "{{base}}/self/v1/schemas/api/schemas/search/response" +jsonpath "$.result.resources[13].name" == "Sourcemeta One Schema Search API Response" +jsonpath "$.result.resources[13].description" == "The response format for the schema search API endpoint" +jsonpath "$.result.resources[13].mimeType" == "application/schema+json" +jsonpath "$.result.resources[13].size" == 1341 +jsonpath "$.result.resources[13].annotations.priority" == 0.0 +jsonpath "$.result.resources[14].uri" == "{{base}}/self/v1/schemas/api/schemas/stats/response" +jsonpath "$.result.resources[14].name" == "Sourcemeta One Schema Stats API Response" +jsonpath "$.result.resources[14].description" == "The response format for the schema statistics API endpoint" +jsonpath "$.result.resources[14].mimeType" == "application/schema+json" +jsonpath "$.result.resources[14].size" == 2345 +jsonpath "$.result.resources[14].annotations.priority" == 0.0 +jsonpath "$.result.resources[15].uri" == "{{base}}/self/v1/schemas/api/schemas/trace/request" +jsonpath "$.result.resources[15].name" == "Sourcemeta One Schema Trace API Request" +jsonpath "$.result.resources[15].description" == "The JSON instance to trace evaluation against a schema in the catalog" +jsonpath "$.result.resources[15].mimeType" == "application/schema+json" +jsonpath "$.result.resources[15].size" == 419 +jsonpath "$.result.resources[15].annotations.priority" == 0.0 +jsonpath "$.result.resources[16].uri" == "{{base}}/self/v1/schemas/api/schemas/trace/response" +jsonpath "$.result.resources[16].name" == "Sourcemeta One Schema Trace API Response" +jsonpath "$.result.resources[16].description" == "The response format for the schema trace API endpoint" +jsonpath "$.result.resources[16].mimeType" == "application/schema+json" +jsonpath "$.result.resources[16].size" == 2118 +jsonpath "$.result.resources[16].annotations.priority" == 0.0 +jsonpath "$.result.resources[17].uri" == "{{base}}/self/v1/schemas/mcp/error" +jsonpath "$.result.resources[17].name" == "Sourcemeta One MCP Error Response" +jsonpath "$.result.resources[17].description" == "The error response Sourcemeta One returns when an MCP request fails" +jsonpath "$.result.resources[17].mimeType" == "application/schema+json" +jsonpath "$.result.resources[17].size" == 5991 +jsonpath "$.result.resources[17].annotations.priority" == 0.0 +jsonpath "$.result.resources[18].uri" == "{{base}}/self/v1/schemas/mcp/initialize/request" +jsonpath "$.result.resources[18].name" == "Sourcemeta One MCP Initialize Request" +jsonpath "$.result.resources[18].description" == "Connection handshake from a client" +jsonpath "$.result.resources[18].mimeType" == "application/schema+json" +jsonpath "$.result.resources[18].size" == 4617 +jsonpath "$.result.resources[18].annotations.priority" == 0.0 +jsonpath "$.result.resources[19].uri" == "{{base}}/self/v1/schemas/mcp/initialize/response" +jsonpath "$.result.resources[19].name" == "Sourcemeta One MCP Initialize Response" +jsonpath "$.result.resources[19].description" == "Sourcemeta One's response to a client's initialization" +jsonpath "$.result.resources[19].mimeType" == "application/schema+json" +jsonpath "$.result.resources[19].size" == 2524 +jsonpath "$.result.resources[19].annotations.priority" == 0.0 +jsonpath "$.result.resources[20].uri" == "{{base}}/self/v1/schemas/mcp/notifications/cancelled" +jsonpath "$.result.resources[20].name" == "Sourcemeta One MCP Cancelled Notification" +jsonpath "$.result.resources[20].description" == "Cancellation hint from a client for an in-flight request. Sourcemeta One accepts and discards these" +jsonpath "$.result.resources[20].mimeType" == "application/schema+json" +jsonpath "$.result.resources[20].size" == 1163 +jsonpath "$.result.resources[20].annotations.priority" == 0.0 +jsonpath "$.result.resources[21].uri" == "{{base}}/self/v1/schemas/mcp/notifications/initialized" +jsonpath "$.result.resources[21].name" == "Sourcemeta One MCP Initialized Notification" +jsonpath "$.result.resources[21].description" == "Client signal that the handshake is complete and normal operation may begin" +jsonpath "$.result.resources[21].mimeType" == "application/schema+json" +jsonpath "$.result.resources[21].size" == 740 +jsonpath "$.result.resources[21].annotations.priority" == 0.0 +jsonpath "$.result.resources[22].uri" == "{{base}}/self/v1/schemas/mcp/ping/request" +jsonpath "$.result.resources[22].name" == "Sourcemeta One MCP Ping Request" +jsonpath "$.result.resources[22].description" == "Liveness check from a client" +jsonpath "$.result.resources[22].mimeType" == "application/schema+json" +jsonpath "$.result.resources[22].size" == 695 +jsonpath "$.result.resources[22].annotations.priority" == 0.0 +jsonpath "$.result.resources[23].uri" == "{{base}}/self/v1/schemas/mcp/ping/response" +jsonpath "$.result.resources[23].name" == "Sourcemeta One MCP Ping Response" +jsonpath "$.result.resources[23].description" == "Sourcemeta One's response to a liveness check" +jsonpath "$.result.resources[23].mimeType" == "application/schema+json" +jsonpath "$.result.resources[23].size" == 598 +jsonpath "$.result.resources[23].annotations.priority" == 0.0 +jsonpath "$.result.resources[24].uri" == "{{base}}/self/v1/schemas/mcp/request" +jsonpath "$.result.resources[24].name" == "Sourcemeta One MCP Request" +jsonpath "$.result.resources[24].description" == "Any incoming MCP request the server accepts. The body may be a single JSON-RPC envelope or a JSON-RPC 2.0 batch (an array of envelopes) on protocol version `2025-03-26`" +jsonpath "$.result.resources[24].mimeType" == "application/schema+json" +jsonpath "$.result.resources[24].size" == 2520 +jsonpath "$.result.resources[24].annotations.priority" == 0.0 +jsonpath "$.result.resources[25].uri" == "{{base}}/self/v1/schemas/mcp/resources/list/request" +jsonpath "$.result.resources[25].name" == "Sourcemeta One MCP Resources List Request" +jsonpath "$.result.resources[25].description" == "Request from a client to list MCP resources" +jsonpath "$.result.resources[25].mimeType" == "application/schema+json" +jsonpath "$.result.resources[25].size" == 1071 +jsonpath "$.result.resources[25].annotations.priority" == 0.0 +jsonpath "$.result.resources[26].uri" == "{{base}}/self/v1/schemas/mcp/resources/list/response" +jsonpath "$.result.resources[26].name" == "Sourcemeta One MCP Resources List Response" +jsonpath "$.result.resources[26].description" == "Sourcemeta One's list of MCP resources" +jsonpath "$.result.resources[26].mimeType" == "application/schema+json" +jsonpath "$.result.resources[26].size" == 3062 +jsonpath "$.result.resources[26].annotations.priority" == 0.0 +jsonpath "$.result.resources[27].uri" == "{{base}}/self/v1/schemas/mcp/resources/read/request" +jsonpath "$.result.resources[27].name" == "Sourcemeta One MCP Resources Read Request" +jsonpath "$.result.resources[27].description" == "Request from a client to read an MCP resource" +jsonpath "$.result.resources[27].mimeType" == "application/schema+json" +jsonpath "$.result.resources[27].size" == 1293 +jsonpath "$.result.resources[27].annotations.priority" == 0.0 +jsonpath "$.result.resources[28].uri" == "{{base}}/self/v1/schemas/mcp/resources/read/response" +jsonpath "$.result.resources[28].name" == "Sourcemeta One MCP Resources Read Response" +jsonpath "$.result.resources[28].description" == "Sourcemeta One's response containing an MCP resource" +jsonpath "$.result.resources[28].mimeType" == "application/schema+json" +jsonpath "$.result.resources[28].size" == 1754 +jsonpath "$.result.resources[28].annotations.priority" == 0.0 +jsonpath "$.result.resources[29].uri" == "{{base}}/self/v1/schemas/mcp/resources/templates/list/request" +jsonpath "$.result.resources[29].name" == "Sourcemeta One MCP Resources Templates List Request" +jsonpath "$.result.resources[29].description" == "Request from a client to list MCP resource templates" +jsonpath "$.result.resources[29].mimeType" == "application/schema+json" +jsonpath "$.result.resources[29].size" == 922 +jsonpath "$.result.resources[29].annotations.priority" == 0.0 +jsonpath "$.result.resources[30].uri" == "{{base}}/self/v1/schemas/mcp/resources/templates/list/response" +jsonpath "$.result.resources[30].name" == "Sourcemeta One MCP Resources Templates List Response" +jsonpath "$.result.resources[30].description" == "Sourcemeta One's list of MCP resource templates" +jsonpath "$.result.resources[30].mimeType" == "application/schema+json" +jsonpath "$.result.resources[30].size" == 2927 +jsonpath "$.result.resources[30].annotations.priority" == 0.0 +jsonpath "$.result.resources[31].uri" == "{{base}}/self/v1/schemas/mcp/response" +jsonpath "$.result.resources[31].name" == "Sourcemeta One MCP Response" +jsonpath "$.result.resources[31].description" == "Any outgoing MCP response the server returns" +jsonpath "$.result.resources[31].mimeType" == "application/schema+json" +jsonpath "$.result.resources[31].size" == 4799 +jsonpath "$.result.resources[31].annotations.priority" == 0.0 +jsonpath "$.result.resources[32].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/evaluate-schema/request" +jsonpath "$.result.resources[32].name" == "Sourcemeta One Schema Evaluate RPC Input" +jsonpath "$.result.resources[32].description" == "Evaluate a JSON instance against a schema in the catalog and return whether it is valid plus any errors" +jsonpath "$.result.resources[32].mimeType" == "application/schema+json" +jsonpath "$.result.resources[32].size" == 1566 +jsonpath "$.result.resources[32].annotations.priority" == 0.0 +jsonpath "$.result.resources[33].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/evaluate-schema/response" +jsonpath "$.result.resources[33].name" == "Sourcemeta One Schema Evaluate RPC Output" +jsonpath "$.result.resources[33].description" == "Evaluate a JSON instance against a schema in the catalog and return whether it is valid plus any errors" +jsonpath "$.result.resources[33].mimeType" == "application/schema+json" +jsonpath "$.result.resources[33].size" == 441 +jsonpath "$.result.resources[33].annotations.priority" == 0.0 +jsonpath "$.result.resources[34].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-dependencies/request" +jsonpath "$.result.resources[34].name" == "Sourcemeta One Schema Dependencies RPC Input" +jsonpath "$.result.resources[34].description" == "Get all direct and indirect dependencies of a schema in the catalog" +jsonpath "$.result.resources[34].mimeType" == "application/schema+json" +jsonpath "$.result.resources[34].size" == 687 +jsonpath "$.result.resources[34].annotations.priority" == 0.0 +jsonpath "$.result.resources[35].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-dependencies/response" +jsonpath "$.result.resources[35].name" == "Sourcemeta One Schema Dependencies RPC Output" +jsonpath "$.result.resources[35].description" == "Get all direct and indirect dependencies of a schema in the catalog" +jsonpath "$.result.resources[35].mimeType" == "application/schema+json" +jsonpath "$.result.resources[35].size" == 741 +jsonpath "$.result.resources[35].annotations.priority" == 0.0 +jsonpath "$.result.resources[36].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-dependents/request" +jsonpath "$.result.resources[36].name" == "Sourcemeta One Schema Dependents RPC Input" +jsonpath "$.result.resources[36].description" == "Get all direct and transitive dependents of a schema in the catalog" +jsonpath "$.result.resources[36].mimeType" == "application/schema+json" +jsonpath "$.result.resources[36].size" == 683 +jsonpath "$.result.resources[36].annotations.priority" == 0.0 +jsonpath "$.result.resources[37].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-dependents/response" +jsonpath "$.result.resources[37].name" == "Sourcemeta One Schema Dependents RPC Output" +jsonpath "$.result.resources[37].description" == "Get all direct and transitive dependents of a schema in the catalog" +jsonpath "$.result.resources[37].mimeType" == "application/schema+json" +jsonpath "$.result.resources[37].size" == 735 +jsonpath "$.result.resources[37].annotations.priority" == 0.0 +jsonpath "$.result.resources[38].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-health/request" +jsonpath "$.result.resources[38].name" == "Sourcemeta One Schema Health RPC Input" +jsonpath "$.result.resources[38].description" == "Get the health analysis and score of a schema in the catalog" +jsonpath "$.result.resources[38].mimeType" == "application/schema+json" +jsonpath "$.result.resources[38].size" == 668 +jsonpath "$.result.resources[38].annotations.priority" == 0.0 +jsonpath "$.result.resources[39].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-health/response" +jsonpath "$.result.resources[39].name" == "Sourcemeta One Schema Health RPC Output" +jsonpath "$.result.resources[39].description" == "Get the health analysis and score of a schema in the catalog" +jsonpath "$.result.resources[39].mimeType" == "application/schema+json" +jsonpath "$.result.resources[39].size" == 415 +jsonpath "$.result.resources[39].annotations.priority" == 0.0 +jsonpath "$.result.resources[40].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-locations/request" +jsonpath "$.result.resources[40].name" == "Sourcemeta One Schema Locations RPC Input" +jsonpath "$.result.resources[40].description" == "Get metadata about every URI associated with a schema, including schema resources, subschemas, and anchors" +jsonpath "$.result.resources[40].mimeType" == "application/schema+json" +jsonpath "$.result.resources[40].size" == 720 +jsonpath "$.result.resources[40].annotations.priority" == 0.0 +jsonpath "$.result.resources[41].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-locations/response" +jsonpath "$.result.resources[41].name" == "Sourcemeta One Schema Locations RPC Output" +jsonpath "$.result.resources[41].description" == "Get metadata about every URI associated with a schema, including schema resources, subschemas, and anchors" +jsonpath "$.result.resources[41].mimeType" == "application/schema+json" +jsonpath "$.result.resources[41].size" == 471 +jsonpath "$.result.resources[41].annotations.priority" == 0.0 +jsonpath "$.result.resources[42].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-metadata/request" +jsonpath "$.result.resources[42].name" == "Sourcemeta One Schema Metadata RPC Input" +jsonpath "$.result.resources[42].description" == "Get metadata information about a schema in the catalog" +jsonpath "$.result.resources[42].mimeType" == "application/schema+json" +jsonpath "$.result.resources[42].size" == 666 +jsonpath "$.result.resources[42].annotations.priority" == 0.0 +jsonpath "$.result.resources[43].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-metadata/response" +jsonpath "$.result.resources[43].name" == "Sourcemeta One Schema Metadata RPC Output" +jsonpath "$.result.resources[43].description" == "Get metadata information about a schema in the catalog" +jsonpath "$.result.resources[43].mimeType" == "application/schema+json" +jsonpath "$.result.resources[43].size" == 819 +jsonpath "$.result.resources[43].annotations.priority" == 0.0 +jsonpath "$.result.resources[44].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-positions/request" +jsonpath "$.result.resources[44].name" == "Sourcemeta One Schema Positions RPC Input" +jsonpath "$.result.resources[44].description" == "Get line and column position information for every token in a schema" +jsonpath "$.result.resources[44].mimeType" == "application/schema+json" +jsonpath "$.result.resources[44].size" == 682 +jsonpath "$.result.resources[44].annotations.priority" == 0.0 +jsonpath "$.result.resources[45].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-positions/response" +jsonpath "$.result.resources[45].name" == "Sourcemeta One Schema Positions RPC Output" +jsonpath "$.result.resources[45].description" == "Get line and column position information for every token in a schema" +jsonpath "$.result.resources[45].mimeType" == "application/schema+json" +jsonpath "$.result.resources[45].size" == 435 +jsonpath "$.result.resources[45].annotations.priority" == 0.0 +jsonpath "$.result.resources[46].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-stats/request" +jsonpath "$.result.resources[46].name" == "Sourcemeta One Schema Statistics RPC Input" +jsonpath "$.result.resources[46].description" == "Get keyword statistics by vocabulary about every URI associated with a schema in the catalog" +jsonpath "$.result.resources[46].mimeType" == "application/schema+json" +jsonpath "$.result.resources[46].size" == 703 +jsonpath "$.result.resources[46].annotations.priority" == 0.0 +jsonpath "$.result.resources[47].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-stats/response" +jsonpath "$.result.resources[47].name" == "Sourcemeta One Schema Statistics RPC Output" +jsonpath "$.result.resources[47].description" == "Get keyword statistics by vocabulary about every URI associated with a schema in the catalog" +jsonpath "$.result.resources[47].mimeType" == "application/schema+json" +jsonpath "$.result.resources[47].size" == 709 +jsonpath "$.result.resources[47].annotations.priority" == 0.0 +jsonpath "$.result.resources[48].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/list-directory/request" +jsonpath "$.result.resources[48].name" == "Sourcemeta One Directory Listing RPC Input" +jsonpath "$.result.resources[48].description" == "List the contents of a directory in the catalog" +jsonpath "$.result.resources[48].mimeType" == "application/schema+json" +jsonpath "$.result.resources[48].size" == 549 +jsonpath "$.result.resources[48].annotations.priority" == 0.0 +jsonpath "$.result.resources[49].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/list-directory/response" +jsonpath "$.result.resources[49].name" == "Sourcemeta One Directory Listing RPC Output" +jsonpath "$.result.resources[49].description" == "List the contents of a directory in the catalog" +jsonpath "$.result.resources[49].mimeType" == "application/schema+json" +jsonpath "$.result.resources[49].size" == 585 +jsonpath "$.result.resources[49].annotations.priority" == 0.0 + +POST {{base}}/self/v1/api/schemas/evaluate{{anonymous_list_schema}} +``` +{{anonymous_list}} +``` +HTTP 200 +[Asserts] +jsonpath "$.valid" == true + +# The anonymous second page, still only public schemas. +POST {{base}}/self/v1/mcp +Accept: application/json, text/event-stream +MCP-Protocol-Version: 2025-11-25 +Content-Type: application/json +``` +{ + "jsonrpc": "2.0", + "id": 2, + "method": "resources/list", + "params": { "cursor": "50" } +} +``` +HTTP 200 +Content-Type: application/json +[Asserts] +jsonpath "$.jsonrpc" == "2.0" +jsonpath "$.id" == 2 +jsonpath "$.result.resources" count == 8 +jsonpath "$.result.nextCursor" not exists +jsonpath "$.result.resources[0].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/request" +jsonpath "$.result.resources[0].name" == "Sourcemeta One MCP Tools Call Request" +jsonpath "$.result.resources[0].description" == "Request from a client to invoke an MCP tool by name" +jsonpath "$.result.resources[0].mimeType" == "application/schema+json" +jsonpath "$.result.resources[0].size" == 1161 +jsonpath "$.result.resources[0].annotations.priority" == 0.0 +jsonpath "$.result.resources[1].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/response" +jsonpath "$.result.resources[1].name" == "Sourcemeta One MCP Tools Call Response" +jsonpath "$.result.resources[1].description" == "Sourcemeta One's response to a tool invocation" +jsonpath "$.result.resources[1].mimeType" == "application/schema+json" +jsonpath "$.result.resources[1].size" == 4668 +jsonpath "$.result.resources[1].annotations.priority" == 0.0 +jsonpath "$.result.resources[2].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/search-schemas/request" +jsonpath "$.result.resources[2].name" == "Sourcemeta One Schema Search RPC Input" +jsonpath "$.result.resources[2].description" == "Search for schemas in the catalog by query term" +jsonpath "$.result.resources[2].mimeType" == "application/schema+json" +jsonpath "$.result.resources[2].size" == 2155 +jsonpath "$.result.resources[2].annotations.priority" == 0.0 +jsonpath "$.result.resources[3].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/search-schemas/response" +jsonpath "$.result.resources[3].name" == "Sourcemeta One Schema Search RPC Output" +jsonpath "$.result.resources[3].description" == "Search for schemas in the catalog by query term" +jsonpath "$.result.resources[3].mimeType" == "application/schema+json" +jsonpath "$.result.resources[3].size" == 777 +jsonpath "$.result.resources[3].annotations.priority" == 0.0 +jsonpath "$.result.resources[4].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/trace-schema-evaluation/request" +jsonpath "$.result.resources[4].name" == "Sourcemeta One Schema Trace RPC Input" +jsonpath "$.result.resources[4].description" == "Trace step-by-step evaluation of a JSON instance against a schema in the catalog, exposing each step, rule application, and decision point" +jsonpath "$.result.resources[4].mimeType" == "application/schema+json" +jsonpath "$.result.resources[4].size" == 1735 +jsonpath "$.result.resources[4].annotations.priority" == 0.0 +jsonpath "$.result.resources[5].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/trace-schema-evaluation/response" +jsonpath "$.result.resources[5].name" == "Sourcemeta One Schema Trace RPC Output" +jsonpath "$.result.resources[5].description" == "Trace step-by-step evaluation of a JSON instance against a schema in the catalog, exposing each step, rule application, and decision point" +jsonpath "$.result.resources[5].mimeType" == "application/schema+json" +jsonpath "$.result.resources[5].size" == 497 +jsonpath "$.result.resources[5].annotations.priority" == 0.0 +jsonpath "$.result.resources[6].uri" == "{{base}}/self/v1/schemas/mcp/tools/list/request" +jsonpath "$.result.resources[6].name" == "Sourcemeta One MCP Tools List Request" +jsonpath "$.result.resources[6].description" == "Request from a client to list MCP tools" +jsonpath "$.result.resources[6].mimeType" == "application/schema+json" +jsonpath "$.result.resources[6].size" == 853 +jsonpath "$.result.resources[6].annotations.priority" == 0.0 +jsonpath "$.result.resources[7].uri" == "{{base}}/self/v1/schemas/mcp/tools/list/response" +jsonpath "$.result.resources[7].name" == "Sourcemeta One MCP Tools List Response" +jsonpath "$.result.resources[7].description" == "Sourcemeta One's list of MCP tools" +jsonpath "$.result.resources[7].mimeType" == "application/schema+json" +jsonpath "$.result.resources[7].size" == 4495 +jsonpath "$.result.resources[7].annotations.priority" == 0.0 + +# The primary key adds the `/private` and `/reports` schemas, which sort +# ahead of the public ones, on top of everything the anonymous caller sees. +POST {{base}}/self/v1/mcp +Accept: application/json, text/event-stream +MCP-Protocol-Version: 2025-11-25 +Content-Type: application/json +Authorization: Bearer primary-secret-key +``` +{ + "jsonrpc": "2.0", + "id": 3, + "method": "resources/list" +} +``` +HTTP 200 +Content-Type: application/json +[Asserts] +jsonpath "$.jsonrpc" == "2.0" +jsonpath "$.id" == 3 +jsonpath "$.result.resources" count == 50 +jsonpath "$.result.nextCursor" == "50" +jsonpath "$.result.resources[0].uri" == "{{base}}/private/secret" +jsonpath "$.result.resources[0].name" == "/private/secret" +jsonpath "$.result.resources[0].mimeType" == "application/schema+json" +jsonpath "$.result.resources[0].size" == 259 +jsonpath "$.result.resources[0].annotations.priority" == 0.5 +jsonpath "$.result.resources[1].uri" == "{{base}}/reports/quarterly" +jsonpath "$.result.resources[1].name" == "/reports/quarterly" +jsonpath "$.result.resources[1].mimeType" == "application/schema+json" +jsonpath "$.result.resources[1].size" == 173 +jsonpath "$.result.resources[1].annotations.priority" == 0.5 +jsonpath "$.result.resources[2].uri" == "{{base}}/private/open/shared" +jsonpath "$.result.resources[2].name" == "/private/open/shared" +jsonpath "$.result.resources[2].mimeType" == "application/schema+json" +jsonpath "$.result.resources[2].size" == 138 +jsonpath "$.result.resources[2].annotations.priority" == 0.5 +jsonpath "$.result.resources[3].uri" == "{{base}}/public/string" +jsonpath "$.result.resources[3].name" == "/public/string" +jsonpath "$.result.resources[3].mimeType" == "application/schema+json" +jsonpath "$.result.resources[3].size" == 131 +jsonpath "$.result.resources[3].annotations.priority" == 0.5 +jsonpath "$.result.resources[4].uri" == "{{base}}/self/v1/schemas/api/error" +jsonpath "$.result.resources[4].name" == "Sourcemeta One API Error" +jsonpath "$.result.resources[4].description" == "The error response format returned by the Sourcemeta One API endpoints" +jsonpath "$.result.resources[4].mimeType" == "application/schema+json" +jsonpath "$.result.resources[4].size" == 5693 +jsonpath "$.result.resources[4].annotations.priority" == 0.0 +jsonpath "$.result.resources[5].uri" == "{{base}}/self/v1/schemas/api/list/response" +jsonpath "$.result.resources[5].name" == "Sourcemeta One List API Response" +jsonpath "$.result.resources[5].description" == "The response format for the directory listing API endpoint" +jsonpath "$.result.resources[5].mimeType" == "application/schema+json" +jsonpath "$.result.resources[5].size" == 3581 +jsonpath "$.result.resources[5].annotations.priority" == 0.0 +jsonpath "$.result.resources[6].uri" == "{{base}}/self/v1/schemas/api/schemas/dependencies/response" +jsonpath "$.result.resources[6].name" == "Sourcemeta One Schema Dependencies API Response" +jsonpath "$.result.resources[6].description" == "The response format for the schema dependencies API endpoint" +jsonpath "$.result.resources[6].mimeType" == "application/schema+json" +jsonpath "$.result.resources[6].size" == 992 +jsonpath "$.result.resources[6].annotations.priority" == 0.0 +jsonpath "$.result.resources[7].uri" == "{{base}}/self/v1/schemas/api/schemas/dependents/response" +jsonpath "$.result.resources[7].name" == "Sourcemeta One Schema Dependents API Response" +jsonpath "$.result.resources[7].description" == "The response format for the schema dependents API endpoint" +jsonpath "$.result.resources[7].mimeType" == "application/schema+json" +jsonpath "$.result.resources[7].size" == 986 +jsonpath "$.result.resources[7].annotations.priority" == 0.0 +jsonpath "$.result.resources[8].uri" == "{{base}}/self/v1/schemas/api/schemas/evaluate/request" +jsonpath "$.result.resources[8].name" == "Sourcemeta One Schema Evaluate API Request" +jsonpath "$.result.resources[8].description" == "The JSON instance to validate against a schema in the catalog" +jsonpath "$.result.resources[8].mimeType" == "application/schema+json" +jsonpath "$.result.resources[8].size" == 417 +jsonpath "$.result.resources[8].annotations.priority" == 0.0 +jsonpath "$.result.resources[9].uri" == "{{base}}/self/v1/schemas/api/schemas/evaluate/response" +jsonpath "$.result.resources[9].name" == "Sourcemeta One Schema Evaluate API Response" +jsonpath "$.result.resources[9].description" == "The response format for the schema evaluation API endpoint" +jsonpath "$.result.resources[9].mimeType" == "application/schema+json" +jsonpath "$.result.resources[9].size" == 3049 +jsonpath "$.result.resources[9].annotations.priority" == 0.0 +jsonpath "$.result.resources[10].uri" == "{{base}}/self/v1/schemas/api/schemas/health/response" +jsonpath "$.result.resources[10].name" == "Sourcemeta One Schema Health API Response" +jsonpath "$.result.resources[10].description" == "The response format for the schema health API endpoint" +jsonpath "$.result.resources[10].mimeType" == "application/schema+json" +jsonpath "$.result.resources[10].size" == 1584 +jsonpath "$.result.resources[10].annotations.priority" == 0.0 +jsonpath "$.result.resources[11].uri" == "{{base}}/self/v1/schemas/api/schemas/locations/response" +jsonpath "$.result.resources[11].name" == "Sourcemeta One Schema Locations API Response" +jsonpath "$.result.resources[11].description" == "The response format for the schema frame locations API endpoint" +jsonpath "$.result.resources[11].mimeType" == "application/schema+json" +jsonpath "$.result.resources[11].size" == 2402 +jsonpath "$.result.resources[11].annotations.priority" == 0.0 +jsonpath "$.result.resources[12].uri" == "{{base}}/self/v1/schemas/api/schemas/metadata/response" +jsonpath "$.result.resources[12].name" == "Sourcemeta One Schema Metadata API Response" +jsonpath "$.result.resources[12].description" == "The response format for the schema metadata API endpoint" +jsonpath "$.result.resources[12].mimeType" == "application/schema+json" +jsonpath "$.result.resources[12].size" == 2840 +jsonpath "$.result.resources[12].annotations.priority" == 0.0 +jsonpath "$.result.resources[13].uri" == "{{base}}/self/v1/schemas/api/schemas/position" +jsonpath "$.result.resources[13].name" == "Sourcemeta One Schema Position" +jsonpath "$.result.resources[13].description" == "Represents a position in a JSON document as line start, column start, line end, and column end" +jsonpath "$.result.resources[13].mimeType" == "application/schema+json" +jsonpath "$.result.resources[13].size" == 446 +jsonpath "$.result.resources[13].annotations.priority" == 0.0 +jsonpath "$.result.resources[14].uri" == "{{base}}/self/v1/schemas/api/schemas/positions/response" +jsonpath "$.result.resources[14].name" == "Sourcemeta One Schema Positions API Response" +jsonpath "$.result.resources[14].description" == "The response format for the schema positions API endpoint" +jsonpath "$.result.resources[14].mimeType" == "application/schema+json" +jsonpath "$.result.resources[14].size" == 435 +jsonpath "$.result.resources[14].annotations.priority" == 0.0 +jsonpath "$.result.resources[15].uri" == "{{base}}/self/v1/schemas/api/schemas/search/response" +jsonpath "$.result.resources[15].name" == "Sourcemeta One Schema Search API Response" +jsonpath "$.result.resources[15].description" == "The response format for the schema search API endpoint" +jsonpath "$.result.resources[15].mimeType" == "application/schema+json" +jsonpath "$.result.resources[15].size" == 1341 +jsonpath "$.result.resources[15].annotations.priority" == 0.0 +jsonpath "$.result.resources[16].uri" == "{{base}}/self/v1/schemas/api/schemas/stats/response" +jsonpath "$.result.resources[16].name" == "Sourcemeta One Schema Stats API Response" +jsonpath "$.result.resources[16].description" == "The response format for the schema statistics API endpoint" +jsonpath "$.result.resources[16].mimeType" == "application/schema+json" +jsonpath "$.result.resources[16].size" == 2345 +jsonpath "$.result.resources[16].annotations.priority" == 0.0 +jsonpath "$.result.resources[17].uri" == "{{base}}/self/v1/schemas/api/schemas/trace/request" +jsonpath "$.result.resources[17].name" == "Sourcemeta One Schema Trace API Request" +jsonpath "$.result.resources[17].description" == "The JSON instance to trace evaluation against a schema in the catalog" +jsonpath "$.result.resources[17].mimeType" == "application/schema+json" +jsonpath "$.result.resources[17].size" == 419 +jsonpath "$.result.resources[17].annotations.priority" == 0.0 +jsonpath "$.result.resources[18].uri" == "{{base}}/self/v1/schemas/api/schemas/trace/response" +jsonpath "$.result.resources[18].name" == "Sourcemeta One Schema Trace API Response" +jsonpath "$.result.resources[18].description" == "The response format for the schema trace API endpoint" +jsonpath "$.result.resources[18].mimeType" == "application/schema+json" +jsonpath "$.result.resources[18].size" == 2118 +jsonpath "$.result.resources[18].annotations.priority" == 0.0 +jsonpath "$.result.resources[19].uri" == "{{base}}/self/v1/schemas/mcp/error" +jsonpath "$.result.resources[19].name" == "Sourcemeta One MCP Error Response" +jsonpath "$.result.resources[19].description" == "The error response Sourcemeta One returns when an MCP request fails" +jsonpath "$.result.resources[19].mimeType" == "application/schema+json" +jsonpath "$.result.resources[19].size" == 5991 +jsonpath "$.result.resources[19].annotations.priority" == 0.0 +jsonpath "$.result.resources[20].uri" == "{{base}}/self/v1/schemas/mcp/initialize/request" +jsonpath "$.result.resources[20].name" == "Sourcemeta One MCP Initialize Request" +jsonpath "$.result.resources[20].description" == "Connection handshake from a client" +jsonpath "$.result.resources[20].mimeType" == "application/schema+json" +jsonpath "$.result.resources[20].size" == 4617 +jsonpath "$.result.resources[20].annotations.priority" == 0.0 +jsonpath "$.result.resources[21].uri" == "{{base}}/self/v1/schemas/mcp/initialize/response" +jsonpath "$.result.resources[21].name" == "Sourcemeta One MCP Initialize Response" +jsonpath "$.result.resources[21].description" == "Sourcemeta One's response to a client's initialization" +jsonpath "$.result.resources[21].mimeType" == "application/schema+json" +jsonpath "$.result.resources[21].size" == 2524 +jsonpath "$.result.resources[21].annotations.priority" == 0.0 +jsonpath "$.result.resources[22].uri" == "{{base}}/self/v1/schemas/mcp/notifications/cancelled" +jsonpath "$.result.resources[22].name" == "Sourcemeta One MCP Cancelled Notification" +jsonpath "$.result.resources[22].description" == "Cancellation hint from a client for an in-flight request. Sourcemeta One accepts and discards these" +jsonpath "$.result.resources[22].mimeType" == "application/schema+json" +jsonpath "$.result.resources[22].size" == 1163 +jsonpath "$.result.resources[22].annotations.priority" == 0.0 +jsonpath "$.result.resources[23].uri" == "{{base}}/self/v1/schemas/mcp/notifications/initialized" +jsonpath "$.result.resources[23].name" == "Sourcemeta One MCP Initialized Notification" +jsonpath "$.result.resources[23].description" == "Client signal that the handshake is complete and normal operation may begin" +jsonpath "$.result.resources[23].mimeType" == "application/schema+json" +jsonpath "$.result.resources[23].size" == 740 +jsonpath "$.result.resources[23].annotations.priority" == 0.0 +jsonpath "$.result.resources[24].uri" == "{{base}}/self/v1/schemas/mcp/ping/request" +jsonpath "$.result.resources[24].name" == "Sourcemeta One MCP Ping Request" +jsonpath "$.result.resources[24].description" == "Liveness check from a client" +jsonpath "$.result.resources[24].mimeType" == "application/schema+json" +jsonpath "$.result.resources[24].size" == 695 +jsonpath "$.result.resources[24].annotations.priority" == 0.0 +jsonpath "$.result.resources[25].uri" == "{{base}}/self/v1/schemas/mcp/ping/response" +jsonpath "$.result.resources[25].name" == "Sourcemeta One MCP Ping Response" +jsonpath "$.result.resources[25].description" == "Sourcemeta One's response to a liveness check" +jsonpath "$.result.resources[25].mimeType" == "application/schema+json" +jsonpath "$.result.resources[25].size" == 598 +jsonpath "$.result.resources[25].annotations.priority" == 0.0 +jsonpath "$.result.resources[26].uri" == "{{base}}/self/v1/schemas/mcp/request" +jsonpath "$.result.resources[26].name" == "Sourcemeta One MCP Request" +jsonpath "$.result.resources[26].description" == "Any incoming MCP request the server accepts. The body may be a single JSON-RPC envelope or a JSON-RPC 2.0 batch (an array of envelopes) on protocol version `2025-03-26`" +jsonpath "$.result.resources[26].mimeType" == "application/schema+json" +jsonpath "$.result.resources[26].size" == 2520 +jsonpath "$.result.resources[26].annotations.priority" == 0.0 +jsonpath "$.result.resources[27].uri" == "{{base}}/self/v1/schemas/mcp/resources/list/request" +jsonpath "$.result.resources[27].name" == "Sourcemeta One MCP Resources List Request" +jsonpath "$.result.resources[27].description" == "Request from a client to list MCP resources" +jsonpath "$.result.resources[27].mimeType" == "application/schema+json" +jsonpath "$.result.resources[27].size" == 1071 +jsonpath "$.result.resources[27].annotations.priority" == 0.0 +jsonpath "$.result.resources[28].uri" == "{{base}}/self/v1/schemas/mcp/resources/list/response" +jsonpath "$.result.resources[28].name" == "Sourcemeta One MCP Resources List Response" +jsonpath "$.result.resources[28].description" == "Sourcemeta One's list of MCP resources" +jsonpath "$.result.resources[28].mimeType" == "application/schema+json" +jsonpath "$.result.resources[28].size" == 3062 +jsonpath "$.result.resources[28].annotations.priority" == 0.0 +jsonpath "$.result.resources[29].uri" == "{{base}}/self/v1/schemas/mcp/resources/read/request" +jsonpath "$.result.resources[29].name" == "Sourcemeta One MCP Resources Read Request" +jsonpath "$.result.resources[29].description" == "Request from a client to read an MCP resource" +jsonpath "$.result.resources[29].mimeType" == "application/schema+json" +jsonpath "$.result.resources[29].size" == 1293 +jsonpath "$.result.resources[29].annotations.priority" == 0.0 +jsonpath "$.result.resources[30].uri" == "{{base}}/self/v1/schemas/mcp/resources/read/response" +jsonpath "$.result.resources[30].name" == "Sourcemeta One MCP Resources Read Response" +jsonpath "$.result.resources[30].description" == "Sourcemeta One's response containing an MCP resource" +jsonpath "$.result.resources[30].mimeType" == "application/schema+json" +jsonpath "$.result.resources[30].size" == 1754 +jsonpath "$.result.resources[30].annotations.priority" == 0.0 +jsonpath "$.result.resources[31].uri" == "{{base}}/self/v1/schemas/mcp/resources/templates/list/request" +jsonpath "$.result.resources[31].name" == "Sourcemeta One MCP Resources Templates List Request" +jsonpath "$.result.resources[31].description" == "Request from a client to list MCP resource templates" +jsonpath "$.result.resources[31].mimeType" == "application/schema+json" +jsonpath "$.result.resources[31].size" == 922 +jsonpath "$.result.resources[31].annotations.priority" == 0.0 +jsonpath "$.result.resources[32].uri" == "{{base}}/self/v1/schemas/mcp/resources/templates/list/response" +jsonpath "$.result.resources[32].name" == "Sourcemeta One MCP Resources Templates List Response" +jsonpath "$.result.resources[32].description" == "Sourcemeta One's list of MCP resource templates" +jsonpath "$.result.resources[32].mimeType" == "application/schema+json" +jsonpath "$.result.resources[32].size" == 2927 +jsonpath "$.result.resources[32].annotations.priority" == 0.0 +jsonpath "$.result.resources[33].uri" == "{{base}}/self/v1/schemas/mcp/response" +jsonpath "$.result.resources[33].name" == "Sourcemeta One MCP Response" +jsonpath "$.result.resources[33].description" == "Any outgoing MCP response the server returns" +jsonpath "$.result.resources[33].mimeType" == "application/schema+json" +jsonpath "$.result.resources[33].size" == 4799 +jsonpath "$.result.resources[33].annotations.priority" == 0.0 +jsonpath "$.result.resources[34].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/evaluate-schema/request" +jsonpath "$.result.resources[34].name" == "Sourcemeta One Schema Evaluate RPC Input" +jsonpath "$.result.resources[34].description" == "Evaluate a JSON instance against a schema in the catalog and return whether it is valid plus any errors" +jsonpath "$.result.resources[34].mimeType" == "application/schema+json" +jsonpath "$.result.resources[34].size" == 1566 +jsonpath "$.result.resources[34].annotations.priority" == 0.0 +jsonpath "$.result.resources[35].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/evaluate-schema/response" +jsonpath "$.result.resources[35].name" == "Sourcemeta One Schema Evaluate RPC Output" +jsonpath "$.result.resources[35].description" == "Evaluate a JSON instance against a schema in the catalog and return whether it is valid plus any errors" +jsonpath "$.result.resources[35].mimeType" == "application/schema+json" +jsonpath "$.result.resources[35].size" == 441 +jsonpath "$.result.resources[35].annotations.priority" == 0.0 +jsonpath "$.result.resources[36].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-dependencies/request" +jsonpath "$.result.resources[36].name" == "Sourcemeta One Schema Dependencies RPC Input" +jsonpath "$.result.resources[36].description" == "Get all direct and indirect dependencies of a schema in the catalog" +jsonpath "$.result.resources[36].mimeType" == "application/schema+json" +jsonpath "$.result.resources[36].size" == 687 +jsonpath "$.result.resources[36].annotations.priority" == 0.0 +jsonpath "$.result.resources[37].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-dependencies/response" +jsonpath "$.result.resources[37].name" == "Sourcemeta One Schema Dependencies RPC Output" +jsonpath "$.result.resources[37].description" == "Get all direct and indirect dependencies of a schema in the catalog" +jsonpath "$.result.resources[37].mimeType" == "application/schema+json" +jsonpath "$.result.resources[37].size" == 741 +jsonpath "$.result.resources[37].annotations.priority" == 0.0 +jsonpath "$.result.resources[38].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-dependents/request" +jsonpath "$.result.resources[38].name" == "Sourcemeta One Schema Dependents RPC Input" +jsonpath "$.result.resources[38].description" == "Get all direct and transitive dependents of a schema in the catalog" +jsonpath "$.result.resources[38].mimeType" == "application/schema+json" +jsonpath "$.result.resources[38].size" == 683 +jsonpath "$.result.resources[38].annotations.priority" == 0.0 +jsonpath "$.result.resources[39].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-dependents/response" +jsonpath "$.result.resources[39].name" == "Sourcemeta One Schema Dependents RPC Output" +jsonpath "$.result.resources[39].description" == "Get all direct and transitive dependents of a schema in the catalog" +jsonpath "$.result.resources[39].mimeType" == "application/schema+json" +jsonpath "$.result.resources[39].size" == 735 +jsonpath "$.result.resources[39].annotations.priority" == 0.0 +jsonpath "$.result.resources[40].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-health/request" +jsonpath "$.result.resources[40].name" == "Sourcemeta One Schema Health RPC Input" +jsonpath "$.result.resources[40].description" == "Get the health analysis and score of a schema in the catalog" +jsonpath "$.result.resources[40].mimeType" == "application/schema+json" +jsonpath "$.result.resources[40].size" == 668 +jsonpath "$.result.resources[40].annotations.priority" == 0.0 +jsonpath "$.result.resources[41].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-health/response" +jsonpath "$.result.resources[41].name" == "Sourcemeta One Schema Health RPC Output" +jsonpath "$.result.resources[41].description" == "Get the health analysis and score of a schema in the catalog" +jsonpath "$.result.resources[41].mimeType" == "application/schema+json" +jsonpath "$.result.resources[41].size" == 415 +jsonpath "$.result.resources[41].annotations.priority" == 0.0 +jsonpath "$.result.resources[42].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-locations/request" +jsonpath "$.result.resources[42].name" == "Sourcemeta One Schema Locations RPC Input" +jsonpath "$.result.resources[42].description" == "Get metadata about every URI associated with a schema, including schema resources, subschemas, and anchors" +jsonpath "$.result.resources[42].mimeType" == "application/schema+json" +jsonpath "$.result.resources[42].size" == 720 +jsonpath "$.result.resources[42].annotations.priority" == 0.0 +jsonpath "$.result.resources[43].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-locations/response" +jsonpath "$.result.resources[43].name" == "Sourcemeta One Schema Locations RPC Output" +jsonpath "$.result.resources[43].description" == "Get metadata about every URI associated with a schema, including schema resources, subschemas, and anchors" +jsonpath "$.result.resources[43].mimeType" == "application/schema+json" +jsonpath "$.result.resources[43].size" == 471 +jsonpath "$.result.resources[43].annotations.priority" == 0.0 +jsonpath "$.result.resources[44].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-metadata/request" +jsonpath "$.result.resources[44].name" == "Sourcemeta One Schema Metadata RPC Input" +jsonpath "$.result.resources[44].description" == "Get metadata information about a schema in the catalog" +jsonpath "$.result.resources[44].mimeType" == "application/schema+json" +jsonpath "$.result.resources[44].size" == 666 +jsonpath "$.result.resources[44].annotations.priority" == 0.0 +jsonpath "$.result.resources[45].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-metadata/response" +jsonpath "$.result.resources[45].name" == "Sourcemeta One Schema Metadata RPC Output" +jsonpath "$.result.resources[45].description" == "Get metadata information about a schema in the catalog" +jsonpath "$.result.resources[45].mimeType" == "application/schema+json" +jsonpath "$.result.resources[45].size" == 819 +jsonpath "$.result.resources[45].annotations.priority" == 0.0 +jsonpath "$.result.resources[46].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-positions/request" +jsonpath "$.result.resources[46].name" == "Sourcemeta One Schema Positions RPC Input" +jsonpath "$.result.resources[46].description" == "Get line and column position information for every token in a schema" +jsonpath "$.result.resources[46].mimeType" == "application/schema+json" +jsonpath "$.result.resources[46].size" == 682 +jsonpath "$.result.resources[46].annotations.priority" == 0.0 +jsonpath "$.result.resources[47].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-positions/response" +jsonpath "$.result.resources[47].name" == "Sourcemeta One Schema Positions RPC Output" +jsonpath "$.result.resources[47].description" == "Get line and column position information for every token in a schema" +jsonpath "$.result.resources[47].mimeType" == "application/schema+json" +jsonpath "$.result.resources[47].size" == 435 +jsonpath "$.result.resources[47].annotations.priority" == 0.0 +jsonpath "$.result.resources[48].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-stats/request" +jsonpath "$.result.resources[48].name" == "Sourcemeta One Schema Statistics RPC Input" +jsonpath "$.result.resources[48].description" == "Get keyword statistics by vocabulary about every URI associated with a schema in the catalog" +jsonpath "$.result.resources[48].mimeType" == "application/schema+json" +jsonpath "$.result.resources[48].size" == 703 +jsonpath "$.result.resources[48].annotations.priority" == 0.0 +jsonpath "$.result.resources[49].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-stats/response" +jsonpath "$.result.resources[49].name" == "Sourcemeta One Schema Statistics RPC Output" +jsonpath "$.result.resources[49].description" == "Get keyword statistics by vocabulary about every URI associated with a schema in the catalog" +jsonpath "$.result.resources[49].mimeType" == "application/schema+json" +jsonpath "$.result.resources[49].size" == 709 +jsonpath "$.result.resources[49].annotations.priority" == 0.0 + +# The primary key's second page. +POST {{base}}/self/v1/mcp +Accept: application/json, text/event-stream +MCP-Protocol-Version: 2025-11-25 +Content-Type: application/json +Authorization: Bearer primary-secret-key +``` +{ + "jsonrpc": "2.0", + "id": 4, + "method": "resources/list", + "params": { "cursor": "50" } +} +``` +HTTP 200 +Content-Type: application/json +[Asserts] +jsonpath "$.jsonrpc" == "2.0" +jsonpath "$.id" == 4 +jsonpath "$.result.resources" count == 10 +jsonpath "$.result.nextCursor" not exists +jsonpath "$.result.resources[0].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/list-directory/request" +jsonpath "$.result.resources[0].name" == "Sourcemeta One Directory Listing RPC Input" +jsonpath "$.result.resources[0].description" == "List the contents of a directory in the catalog" +jsonpath "$.result.resources[0].mimeType" == "application/schema+json" +jsonpath "$.result.resources[0].size" == 549 +jsonpath "$.result.resources[0].annotations.priority" == 0.0 +jsonpath "$.result.resources[1].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/list-directory/response" +jsonpath "$.result.resources[1].name" == "Sourcemeta One Directory Listing RPC Output" +jsonpath "$.result.resources[1].description" == "List the contents of a directory in the catalog" +jsonpath "$.result.resources[1].mimeType" == "application/schema+json" +jsonpath "$.result.resources[1].size" == 585 +jsonpath "$.result.resources[1].annotations.priority" == 0.0 +jsonpath "$.result.resources[2].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/request" +jsonpath "$.result.resources[2].name" == "Sourcemeta One MCP Tools Call Request" +jsonpath "$.result.resources[2].description" == "Request from a client to invoke an MCP tool by name" +jsonpath "$.result.resources[2].mimeType" == "application/schema+json" +jsonpath "$.result.resources[2].size" == 1161 +jsonpath "$.result.resources[2].annotations.priority" == 0.0 +jsonpath "$.result.resources[3].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/response" +jsonpath "$.result.resources[3].name" == "Sourcemeta One MCP Tools Call Response" +jsonpath "$.result.resources[3].description" == "Sourcemeta One's response to a tool invocation" +jsonpath "$.result.resources[3].mimeType" == "application/schema+json" +jsonpath "$.result.resources[3].size" == 4668 +jsonpath "$.result.resources[3].annotations.priority" == 0.0 +jsonpath "$.result.resources[4].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/search-schemas/request" +jsonpath "$.result.resources[4].name" == "Sourcemeta One Schema Search RPC Input" +jsonpath "$.result.resources[4].description" == "Search for schemas in the catalog by query term" +jsonpath "$.result.resources[4].mimeType" == "application/schema+json" +jsonpath "$.result.resources[4].size" == 2155 +jsonpath "$.result.resources[4].annotations.priority" == 0.0 +jsonpath "$.result.resources[5].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/search-schemas/response" +jsonpath "$.result.resources[5].name" == "Sourcemeta One Schema Search RPC Output" +jsonpath "$.result.resources[5].description" == "Search for schemas in the catalog by query term" +jsonpath "$.result.resources[5].mimeType" == "application/schema+json" +jsonpath "$.result.resources[5].size" == 777 +jsonpath "$.result.resources[5].annotations.priority" == 0.0 +jsonpath "$.result.resources[6].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/trace-schema-evaluation/request" +jsonpath "$.result.resources[6].name" == "Sourcemeta One Schema Trace RPC Input" +jsonpath "$.result.resources[6].description" == "Trace step-by-step evaluation of a JSON instance against a schema in the catalog, exposing each step, rule application, and decision point" +jsonpath "$.result.resources[6].mimeType" == "application/schema+json" +jsonpath "$.result.resources[6].size" == 1735 +jsonpath "$.result.resources[6].annotations.priority" == 0.0 +jsonpath "$.result.resources[7].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/trace-schema-evaluation/response" +jsonpath "$.result.resources[7].name" == "Sourcemeta One Schema Trace RPC Output" +jsonpath "$.result.resources[7].description" == "Trace step-by-step evaluation of a JSON instance against a schema in the catalog, exposing each step, rule application, and decision point" +jsonpath "$.result.resources[7].mimeType" == "application/schema+json" +jsonpath "$.result.resources[7].size" == 497 +jsonpath "$.result.resources[7].annotations.priority" == 0.0 +jsonpath "$.result.resources[8].uri" == "{{base}}/self/v1/schemas/mcp/tools/list/request" +jsonpath "$.result.resources[8].name" == "Sourcemeta One MCP Tools List Request" +jsonpath "$.result.resources[8].description" == "Request from a client to list MCP tools" +jsonpath "$.result.resources[8].mimeType" == "application/schema+json" +jsonpath "$.result.resources[8].size" == 853 +jsonpath "$.result.resources[8].annotations.priority" == 0.0 +jsonpath "$.result.resources[9].uri" == "{{base}}/self/v1/schemas/mcp/tools/list/response" +jsonpath "$.result.resources[9].name" == "Sourcemeta One MCP Tools List Response" +jsonpath "$.result.resources[9].description" == "Sourcemeta One's list of MCP tools" +jsonpath "$.result.resources[9].mimeType" == "application/schema+json" +jsonpath "$.result.resources[9].size" == 4495 +jsonpath "$.result.resources[9].annotations.priority" == 0.0 + +# The internal key adds only the `/internal` schema; the `/private` and +# `/reports` schemas stay hidden. +POST {{base}}/self/v1/mcp +Accept: application/json, text/event-stream +MCP-Protocol-Version: 2025-11-25 +Content-Type: application/json +Authorization: Bearer internal-secret-key +``` +{ + "jsonrpc": "2.0", + "id": 5, + "method": "resources/list" +} +``` +HTTP 200 +Content-Type: application/json +[Asserts] +jsonpath "$.jsonrpc" == "2.0" +jsonpath "$.id" == 5 +jsonpath "$.result.resources" count == 50 +jsonpath "$.result.nextCursor" == "50" +jsonpath "$.result.resources[0].uri" == "{{base}}/internal/config" +jsonpath "$.result.resources[0].name" == "/internal/config" +jsonpath "$.result.resources[0].mimeType" == "application/schema+json" +jsonpath "$.result.resources[0].size" == 166 +jsonpath "$.result.resources[0].annotations.priority" == 0.5 +jsonpath "$.result.resources[1].uri" == "{{base}}/private/open/shared" +jsonpath "$.result.resources[1].name" == "/private/open/shared" +jsonpath "$.result.resources[1].mimeType" == "application/schema+json" +jsonpath "$.result.resources[1].size" == 138 +jsonpath "$.result.resources[1].annotations.priority" == 0.5 +jsonpath "$.result.resources[2].uri" == "{{base}}/public/string" +jsonpath "$.result.resources[2].name" == "/public/string" +jsonpath "$.result.resources[2].mimeType" == "application/schema+json" +jsonpath "$.result.resources[2].size" == 131 +jsonpath "$.result.resources[2].annotations.priority" == 0.5 +jsonpath "$.result.resources[3].uri" == "{{base}}/self/v1/schemas/api/error" +jsonpath "$.result.resources[3].name" == "Sourcemeta One API Error" +jsonpath "$.result.resources[3].description" == "The error response format returned by the Sourcemeta One API endpoints" +jsonpath "$.result.resources[3].mimeType" == "application/schema+json" +jsonpath "$.result.resources[3].size" == 5693 +jsonpath "$.result.resources[3].annotations.priority" == 0.0 +jsonpath "$.result.resources[4].uri" == "{{base}}/self/v1/schemas/api/list/response" +jsonpath "$.result.resources[4].name" == "Sourcemeta One List API Response" +jsonpath "$.result.resources[4].description" == "The response format for the directory listing API endpoint" +jsonpath "$.result.resources[4].mimeType" == "application/schema+json" +jsonpath "$.result.resources[4].size" == 3581 +jsonpath "$.result.resources[4].annotations.priority" == 0.0 +jsonpath "$.result.resources[5].uri" == "{{base}}/self/v1/schemas/api/schemas/dependencies/response" +jsonpath "$.result.resources[5].name" == "Sourcemeta One Schema Dependencies API Response" +jsonpath "$.result.resources[5].description" == "The response format for the schema dependencies API endpoint" +jsonpath "$.result.resources[5].mimeType" == "application/schema+json" +jsonpath "$.result.resources[5].size" == 992 +jsonpath "$.result.resources[5].annotations.priority" == 0.0 +jsonpath "$.result.resources[6].uri" == "{{base}}/self/v1/schemas/api/schemas/dependents/response" +jsonpath "$.result.resources[6].name" == "Sourcemeta One Schema Dependents API Response" +jsonpath "$.result.resources[6].description" == "The response format for the schema dependents API endpoint" +jsonpath "$.result.resources[6].mimeType" == "application/schema+json" +jsonpath "$.result.resources[6].size" == 986 +jsonpath "$.result.resources[6].annotations.priority" == 0.0 +jsonpath "$.result.resources[7].uri" == "{{base}}/self/v1/schemas/api/schemas/evaluate/request" +jsonpath "$.result.resources[7].name" == "Sourcemeta One Schema Evaluate API Request" +jsonpath "$.result.resources[7].description" == "The JSON instance to validate against a schema in the catalog" +jsonpath "$.result.resources[7].mimeType" == "application/schema+json" +jsonpath "$.result.resources[7].size" == 417 +jsonpath "$.result.resources[7].annotations.priority" == 0.0 +jsonpath "$.result.resources[8].uri" == "{{base}}/self/v1/schemas/api/schemas/evaluate/response" +jsonpath "$.result.resources[8].name" == "Sourcemeta One Schema Evaluate API Response" +jsonpath "$.result.resources[8].description" == "The response format for the schema evaluation API endpoint" +jsonpath "$.result.resources[8].mimeType" == "application/schema+json" +jsonpath "$.result.resources[8].size" == 3049 +jsonpath "$.result.resources[8].annotations.priority" == 0.0 +jsonpath "$.result.resources[9].uri" == "{{base}}/self/v1/schemas/api/schemas/health/response" +jsonpath "$.result.resources[9].name" == "Sourcemeta One Schema Health API Response" +jsonpath "$.result.resources[9].description" == "The response format for the schema health API endpoint" +jsonpath "$.result.resources[9].mimeType" == "application/schema+json" +jsonpath "$.result.resources[9].size" == 1584 +jsonpath "$.result.resources[9].annotations.priority" == 0.0 +jsonpath "$.result.resources[10].uri" == "{{base}}/self/v1/schemas/api/schemas/locations/response" +jsonpath "$.result.resources[10].name" == "Sourcemeta One Schema Locations API Response" +jsonpath "$.result.resources[10].description" == "The response format for the schema frame locations API endpoint" +jsonpath "$.result.resources[10].mimeType" == "application/schema+json" +jsonpath "$.result.resources[10].size" == 2402 +jsonpath "$.result.resources[10].annotations.priority" == 0.0 +jsonpath "$.result.resources[11].uri" == "{{base}}/self/v1/schemas/api/schemas/metadata/response" +jsonpath "$.result.resources[11].name" == "Sourcemeta One Schema Metadata API Response" +jsonpath "$.result.resources[11].description" == "The response format for the schema metadata API endpoint" +jsonpath "$.result.resources[11].mimeType" == "application/schema+json" +jsonpath "$.result.resources[11].size" == 2840 +jsonpath "$.result.resources[11].annotations.priority" == 0.0 +jsonpath "$.result.resources[12].uri" == "{{base}}/self/v1/schemas/api/schemas/position" +jsonpath "$.result.resources[12].name" == "Sourcemeta One Schema Position" +jsonpath "$.result.resources[12].description" == "Represents a position in a JSON document as line start, column start, line end, and column end" +jsonpath "$.result.resources[12].mimeType" == "application/schema+json" +jsonpath "$.result.resources[12].size" == 446 +jsonpath "$.result.resources[12].annotations.priority" == 0.0 +jsonpath "$.result.resources[13].uri" == "{{base}}/self/v1/schemas/api/schemas/positions/response" +jsonpath "$.result.resources[13].name" == "Sourcemeta One Schema Positions API Response" +jsonpath "$.result.resources[13].description" == "The response format for the schema positions API endpoint" +jsonpath "$.result.resources[13].mimeType" == "application/schema+json" +jsonpath "$.result.resources[13].size" == 435 +jsonpath "$.result.resources[13].annotations.priority" == 0.0 +jsonpath "$.result.resources[14].uri" == "{{base}}/self/v1/schemas/api/schemas/search/response" +jsonpath "$.result.resources[14].name" == "Sourcemeta One Schema Search API Response" +jsonpath "$.result.resources[14].description" == "The response format for the schema search API endpoint" +jsonpath "$.result.resources[14].mimeType" == "application/schema+json" +jsonpath "$.result.resources[14].size" == 1341 +jsonpath "$.result.resources[14].annotations.priority" == 0.0 +jsonpath "$.result.resources[15].uri" == "{{base}}/self/v1/schemas/api/schemas/stats/response" +jsonpath "$.result.resources[15].name" == "Sourcemeta One Schema Stats API Response" +jsonpath "$.result.resources[15].description" == "The response format for the schema statistics API endpoint" +jsonpath "$.result.resources[15].mimeType" == "application/schema+json" +jsonpath "$.result.resources[15].size" == 2345 +jsonpath "$.result.resources[15].annotations.priority" == 0.0 +jsonpath "$.result.resources[16].uri" == "{{base}}/self/v1/schemas/api/schemas/trace/request" +jsonpath "$.result.resources[16].name" == "Sourcemeta One Schema Trace API Request" +jsonpath "$.result.resources[16].description" == "The JSON instance to trace evaluation against a schema in the catalog" +jsonpath "$.result.resources[16].mimeType" == "application/schema+json" +jsonpath "$.result.resources[16].size" == 419 +jsonpath "$.result.resources[16].annotations.priority" == 0.0 +jsonpath "$.result.resources[17].uri" == "{{base}}/self/v1/schemas/api/schemas/trace/response" +jsonpath "$.result.resources[17].name" == "Sourcemeta One Schema Trace API Response" +jsonpath "$.result.resources[17].description" == "The response format for the schema trace API endpoint" +jsonpath "$.result.resources[17].mimeType" == "application/schema+json" +jsonpath "$.result.resources[17].size" == 2118 +jsonpath "$.result.resources[17].annotations.priority" == 0.0 +jsonpath "$.result.resources[18].uri" == "{{base}}/self/v1/schemas/mcp/error" +jsonpath "$.result.resources[18].name" == "Sourcemeta One MCP Error Response" +jsonpath "$.result.resources[18].description" == "The error response Sourcemeta One returns when an MCP request fails" +jsonpath "$.result.resources[18].mimeType" == "application/schema+json" +jsonpath "$.result.resources[18].size" == 5991 +jsonpath "$.result.resources[18].annotations.priority" == 0.0 +jsonpath "$.result.resources[19].uri" == "{{base}}/self/v1/schemas/mcp/initialize/request" +jsonpath "$.result.resources[19].name" == "Sourcemeta One MCP Initialize Request" +jsonpath "$.result.resources[19].description" == "Connection handshake from a client" +jsonpath "$.result.resources[19].mimeType" == "application/schema+json" +jsonpath "$.result.resources[19].size" == 4617 +jsonpath "$.result.resources[19].annotations.priority" == 0.0 +jsonpath "$.result.resources[20].uri" == "{{base}}/self/v1/schemas/mcp/initialize/response" +jsonpath "$.result.resources[20].name" == "Sourcemeta One MCP Initialize Response" +jsonpath "$.result.resources[20].description" == "Sourcemeta One's response to a client's initialization" +jsonpath "$.result.resources[20].mimeType" == "application/schema+json" +jsonpath "$.result.resources[20].size" == 2524 +jsonpath "$.result.resources[20].annotations.priority" == 0.0 +jsonpath "$.result.resources[21].uri" == "{{base}}/self/v1/schemas/mcp/notifications/cancelled" +jsonpath "$.result.resources[21].name" == "Sourcemeta One MCP Cancelled Notification" +jsonpath "$.result.resources[21].description" == "Cancellation hint from a client for an in-flight request. Sourcemeta One accepts and discards these" +jsonpath "$.result.resources[21].mimeType" == "application/schema+json" +jsonpath "$.result.resources[21].size" == 1163 +jsonpath "$.result.resources[21].annotations.priority" == 0.0 +jsonpath "$.result.resources[22].uri" == "{{base}}/self/v1/schemas/mcp/notifications/initialized" +jsonpath "$.result.resources[22].name" == "Sourcemeta One MCP Initialized Notification" +jsonpath "$.result.resources[22].description" == "Client signal that the handshake is complete and normal operation may begin" +jsonpath "$.result.resources[22].mimeType" == "application/schema+json" +jsonpath "$.result.resources[22].size" == 740 +jsonpath "$.result.resources[22].annotations.priority" == 0.0 +jsonpath "$.result.resources[23].uri" == "{{base}}/self/v1/schemas/mcp/ping/request" +jsonpath "$.result.resources[23].name" == "Sourcemeta One MCP Ping Request" +jsonpath "$.result.resources[23].description" == "Liveness check from a client" +jsonpath "$.result.resources[23].mimeType" == "application/schema+json" +jsonpath "$.result.resources[23].size" == 695 +jsonpath "$.result.resources[23].annotations.priority" == 0.0 +jsonpath "$.result.resources[24].uri" == "{{base}}/self/v1/schemas/mcp/ping/response" +jsonpath "$.result.resources[24].name" == "Sourcemeta One MCP Ping Response" +jsonpath "$.result.resources[24].description" == "Sourcemeta One's response to a liveness check" +jsonpath "$.result.resources[24].mimeType" == "application/schema+json" +jsonpath "$.result.resources[24].size" == 598 +jsonpath "$.result.resources[24].annotations.priority" == 0.0 +jsonpath "$.result.resources[25].uri" == "{{base}}/self/v1/schemas/mcp/request" +jsonpath "$.result.resources[25].name" == "Sourcemeta One MCP Request" +jsonpath "$.result.resources[25].description" == "Any incoming MCP request the server accepts. The body may be a single JSON-RPC envelope or a JSON-RPC 2.0 batch (an array of envelopes) on protocol version `2025-03-26`" +jsonpath "$.result.resources[25].mimeType" == "application/schema+json" +jsonpath "$.result.resources[25].size" == 2520 +jsonpath "$.result.resources[25].annotations.priority" == 0.0 +jsonpath "$.result.resources[26].uri" == "{{base}}/self/v1/schemas/mcp/resources/list/request" +jsonpath "$.result.resources[26].name" == "Sourcemeta One MCP Resources List Request" +jsonpath "$.result.resources[26].description" == "Request from a client to list MCP resources" +jsonpath "$.result.resources[26].mimeType" == "application/schema+json" +jsonpath "$.result.resources[26].size" == 1071 +jsonpath "$.result.resources[26].annotations.priority" == 0.0 +jsonpath "$.result.resources[27].uri" == "{{base}}/self/v1/schemas/mcp/resources/list/response" +jsonpath "$.result.resources[27].name" == "Sourcemeta One MCP Resources List Response" +jsonpath "$.result.resources[27].description" == "Sourcemeta One's list of MCP resources" +jsonpath "$.result.resources[27].mimeType" == "application/schema+json" +jsonpath "$.result.resources[27].size" == 3062 +jsonpath "$.result.resources[27].annotations.priority" == 0.0 +jsonpath "$.result.resources[28].uri" == "{{base}}/self/v1/schemas/mcp/resources/read/request" +jsonpath "$.result.resources[28].name" == "Sourcemeta One MCP Resources Read Request" +jsonpath "$.result.resources[28].description" == "Request from a client to read an MCP resource" +jsonpath "$.result.resources[28].mimeType" == "application/schema+json" +jsonpath "$.result.resources[28].size" == 1293 +jsonpath "$.result.resources[28].annotations.priority" == 0.0 +jsonpath "$.result.resources[29].uri" == "{{base}}/self/v1/schemas/mcp/resources/read/response" +jsonpath "$.result.resources[29].name" == "Sourcemeta One MCP Resources Read Response" +jsonpath "$.result.resources[29].description" == "Sourcemeta One's response containing an MCP resource" +jsonpath "$.result.resources[29].mimeType" == "application/schema+json" +jsonpath "$.result.resources[29].size" == 1754 +jsonpath "$.result.resources[29].annotations.priority" == 0.0 +jsonpath "$.result.resources[30].uri" == "{{base}}/self/v1/schemas/mcp/resources/templates/list/request" +jsonpath "$.result.resources[30].name" == "Sourcemeta One MCP Resources Templates List Request" +jsonpath "$.result.resources[30].description" == "Request from a client to list MCP resource templates" +jsonpath "$.result.resources[30].mimeType" == "application/schema+json" +jsonpath "$.result.resources[30].size" == 922 +jsonpath "$.result.resources[30].annotations.priority" == 0.0 +jsonpath "$.result.resources[31].uri" == "{{base}}/self/v1/schemas/mcp/resources/templates/list/response" +jsonpath "$.result.resources[31].name" == "Sourcemeta One MCP Resources Templates List Response" +jsonpath "$.result.resources[31].description" == "Sourcemeta One's list of MCP resource templates" +jsonpath "$.result.resources[31].mimeType" == "application/schema+json" +jsonpath "$.result.resources[31].size" == 2927 +jsonpath "$.result.resources[31].annotations.priority" == 0.0 +jsonpath "$.result.resources[32].uri" == "{{base}}/self/v1/schemas/mcp/response" +jsonpath "$.result.resources[32].name" == "Sourcemeta One MCP Response" +jsonpath "$.result.resources[32].description" == "Any outgoing MCP response the server returns" +jsonpath "$.result.resources[32].mimeType" == "application/schema+json" +jsonpath "$.result.resources[32].size" == 4799 +jsonpath "$.result.resources[32].annotations.priority" == 0.0 +jsonpath "$.result.resources[33].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/evaluate-schema/request" +jsonpath "$.result.resources[33].name" == "Sourcemeta One Schema Evaluate RPC Input" +jsonpath "$.result.resources[33].description" == "Evaluate a JSON instance against a schema in the catalog and return whether it is valid plus any errors" +jsonpath "$.result.resources[33].mimeType" == "application/schema+json" +jsonpath "$.result.resources[33].size" == 1566 +jsonpath "$.result.resources[33].annotations.priority" == 0.0 +jsonpath "$.result.resources[34].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/evaluate-schema/response" +jsonpath "$.result.resources[34].name" == "Sourcemeta One Schema Evaluate RPC Output" +jsonpath "$.result.resources[34].description" == "Evaluate a JSON instance against a schema in the catalog and return whether it is valid plus any errors" +jsonpath "$.result.resources[34].mimeType" == "application/schema+json" +jsonpath "$.result.resources[34].size" == 441 +jsonpath "$.result.resources[34].annotations.priority" == 0.0 +jsonpath "$.result.resources[35].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-dependencies/request" +jsonpath "$.result.resources[35].name" == "Sourcemeta One Schema Dependencies RPC Input" +jsonpath "$.result.resources[35].description" == "Get all direct and indirect dependencies of a schema in the catalog" +jsonpath "$.result.resources[35].mimeType" == "application/schema+json" +jsonpath "$.result.resources[35].size" == 687 +jsonpath "$.result.resources[35].annotations.priority" == 0.0 +jsonpath "$.result.resources[36].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-dependencies/response" +jsonpath "$.result.resources[36].name" == "Sourcemeta One Schema Dependencies RPC Output" +jsonpath "$.result.resources[36].description" == "Get all direct and indirect dependencies of a schema in the catalog" +jsonpath "$.result.resources[36].mimeType" == "application/schema+json" +jsonpath "$.result.resources[36].size" == 741 +jsonpath "$.result.resources[36].annotations.priority" == 0.0 +jsonpath "$.result.resources[37].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-dependents/request" +jsonpath "$.result.resources[37].name" == "Sourcemeta One Schema Dependents RPC Input" +jsonpath "$.result.resources[37].description" == "Get all direct and transitive dependents of a schema in the catalog" +jsonpath "$.result.resources[37].mimeType" == "application/schema+json" +jsonpath "$.result.resources[37].size" == 683 +jsonpath "$.result.resources[37].annotations.priority" == 0.0 +jsonpath "$.result.resources[38].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-dependents/response" +jsonpath "$.result.resources[38].name" == "Sourcemeta One Schema Dependents RPC Output" +jsonpath "$.result.resources[38].description" == "Get all direct and transitive dependents of a schema in the catalog" +jsonpath "$.result.resources[38].mimeType" == "application/schema+json" +jsonpath "$.result.resources[38].size" == 735 +jsonpath "$.result.resources[38].annotations.priority" == 0.0 +jsonpath "$.result.resources[39].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-health/request" +jsonpath "$.result.resources[39].name" == "Sourcemeta One Schema Health RPC Input" +jsonpath "$.result.resources[39].description" == "Get the health analysis and score of a schema in the catalog" +jsonpath "$.result.resources[39].mimeType" == "application/schema+json" +jsonpath "$.result.resources[39].size" == 668 +jsonpath "$.result.resources[39].annotations.priority" == 0.0 +jsonpath "$.result.resources[40].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-health/response" +jsonpath "$.result.resources[40].name" == "Sourcemeta One Schema Health RPC Output" +jsonpath "$.result.resources[40].description" == "Get the health analysis and score of a schema in the catalog" +jsonpath "$.result.resources[40].mimeType" == "application/schema+json" +jsonpath "$.result.resources[40].size" == 415 +jsonpath "$.result.resources[40].annotations.priority" == 0.0 +jsonpath "$.result.resources[41].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-locations/request" +jsonpath "$.result.resources[41].name" == "Sourcemeta One Schema Locations RPC Input" +jsonpath "$.result.resources[41].description" == "Get metadata about every URI associated with a schema, including schema resources, subschemas, and anchors" +jsonpath "$.result.resources[41].mimeType" == "application/schema+json" +jsonpath "$.result.resources[41].size" == 720 +jsonpath "$.result.resources[41].annotations.priority" == 0.0 +jsonpath "$.result.resources[42].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-locations/response" +jsonpath "$.result.resources[42].name" == "Sourcemeta One Schema Locations RPC Output" +jsonpath "$.result.resources[42].description" == "Get metadata about every URI associated with a schema, including schema resources, subschemas, and anchors" +jsonpath "$.result.resources[42].mimeType" == "application/schema+json" +jsonpath "$.result.resources[42].size" == 471 +jsonpath "$.result.resources[42].annotations.priority" == 0.0 +jsonpath "$.result.resources[43].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-metadata/request" +jsonpath "$.result.resources[43].name" == "Sourcemeta One Schema Metadata RPC Input" +jsonpath "$.result.resources[43].description" == "Get metadata information about a schema in the catalog" +jsonpath "$.result.resources[43].mimeType" == "application/schema+json" +jsonpath "$.result.resources[43].size" == 666 +jsonpath "$.result.resources[43].annotations.priority" == 0.0 +jsonpath "$.result.resources[44].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-metadata/response" +jsonpath "$.result.resources[44].name" == "Sourcemeta One Schema Metadata RPC Output" +jsonpath "$.result.resources[44].description" == "Get metadata information about a schema in the catalog" +jsonpath "$.result.resources[44].mimeType" == "application/schema+json" +jsonpath "$.result.resources[44].size" == 819 +jsonpath "$.result.resources[44].annotations.priority" == 0.0 +jsonpath "$.result.resources[45].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-positions/request" +jsonpath "$.result.resources[45].name" == "Sourcemeta One Schema Positions RPC Input" +jsonpath "$.result.resources[45].description" == "Get line and column position information for every token in a schema" +jsonpath "$.result.resources[45].mimeType" == "application/schema+json" +jsonpath "$.result.resources[45].size" == 682 +jsonpath "$.result.resources[45].annotations.priority" == 0.0 +jsonpath "$.result.resources[46].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-positions/response" +jsonpath "$.result.resources[46].name" == "Sourcemeta One Schema Positions RPC Output" +jsonpath "$.result.resources[46].description" == "Get line and column position information for every token in a schema" +jsonpath "$.result.resources[46].mimeType" == "application/schema+json" +jsonpath "$.result.resources[46].size" == 435 +jsonpath "$.result.resources[46].annotations.priority" == 0.0 +jsonpath "$.result.resources[47].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-stats/request" +jsonpath "$.result.resources[47].name" == "Sourcemeta One Schema Statistics RPC Input" +jsonpath "$.result.resources[47].description" == "Get keyword statistics by vocabulary about every URI associated with a schema in the catalog" +jsonpath "$.result.resources[47].mimeType" == "application/schema+json" +jsonpath "$.result.resources[47].size" == 703 +jsonpath "$.result.resources[47].annotations.priority" == 0.0 +jsonpath "$.result.resources[48].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/get-schema-stats/response" +jsonpath "$.result.resources[48].name" == "Sourcemeta One Schema Statistics RPC Output" +jsonpath "$.result.resources[48].description" == "Get keyword statistics by vocabulary about every URI associated with a schema in the catalog" +jsonpath "$.result.resources[48].mimeType" == "application/schema+json" +jsonpath "$.result.resources[48].size" == 709 +jsonpath "$.result.resources[48].annotations.priority" == 0.0 +jsonpath "$.result.resources[49].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/list-directory/request" +jsonpath "$.result.resources[49].name" == "Sourcemeta One Directory Listing RPC Input" +jsonpath "$.result.resources[49].description" == "List the contents of a directory in the catalog" +jsonpath "$.result.resources[49].mimeType" == "application/schema+json" +jsonpath "$.result.resources[49].size" == 549 +jsonpath "$.result.resources[49].annotations.priority" == 0.0 + +# The internal key's second page. +POST {{base}}/self/v1/mcp +Accept: application/json, text/event-stream +MCP-Protocol-Version: 2025-11-25 +Content-Type: application/json +Authorization: Bearer internal-secret-key +``` +{ + "jsonrpc": "2.0", + "id": 6, + "method": "resources/list", + "params": { "cursor": "50" } +} +``` +HTTP 200 +Content-Type: application/json +[Asserts] +jsonpath "$.jsonrpc" == "2.0" +jsonpath "$.id" == 6 +jsonpath "$.result.resources" count == 9 +jsonpath "$.result.nextCursor" not exists +jsonpath "$.result.resources[0].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/list-directory/response" +jsonpath "$.result.resources[0].name" == "Sourcemeta One Directory Listing RPC Output" +jsonpath "$.result.resources[0].description" == "List the contents of a directory in the catalog" +jsonpath "$.result.resources[0].mimeType" == "application/schema+json" +jsonpath "$.result.resources[0].size" == 585 +jsonpath "$.result.resources[0].annotations.priority" == 0.0 +jsonpath "$.result.resources[1].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/request" +jsonpath "$.result.resources[1].name" == "Sourcemeta One MCP Tools Call Request" +jsonpath "$.result.resources[1].description" == "Request from a client to invoke an MCP tool by name" +jsonpath "$.result.resources[1].mimeType" == "application/schema+json" +jsonpath "$.result.resources[1].size" == 1161 +jsonpath "$.result.resources[1].annotations.priority" == 0.0 +jsonpath "$.result.resources[2].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/response" +jsonpath "$.result.resources[2].name" == "Sourcemeta One MCP Tools Call Response" +jsonpath "$.result.resources[2].description" == "Sourcemeta One's response to a tool invocation" +jsonpath "$.result.resources[2].mimeType" == "application/schema+json" +jsonpath "$.result.resources[2].size" == 4668 +jsonpath "$.result.resources[2].annotations.priority" == 0.0 +jsonpath "$.result.resources[3].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/search-schemas/request" +jsonpath "$.result.resources[3].name" == "Sourcemeta One Schema Search RPC Input" +jsonpath "$.result.resources[3].description" == "Search for schemas in the catalog by query term" +jsonpath "$.result.resources[3].mimeType" == "application/schema+json" +jsonpath "$.result.resources[3].size" == 2155 +jsonpath "$.result.resources[3].annotations.priority" == 0.0 +jsonpath "$.result.resources[4].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/search-schemas/response" +jsonpath "$.result.resources[4].name" == "Sourcemeta One Schema Search RPC Output" +jsonpath "$.result.resources[4].description" == "Search for schemas in the catalog by query term" +jsonpath "$.result.resources[4].mimeType" == "application/schema+json" +jsonpath "$.result.resources[4].size" == 777 +jsonpath "$.result.resources[4].annotations.priority" == 0.0 +jsonpath "$.result.resources[5].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/trace-schema-evaluation/request" +jsonpath "$.result.resources[5].name" == "Sourcemeta One Schema Trace RPC Input" +jsonpath "$.result.resources[5].description" == "Trace step-by-step evaluation of a JSON instance against a schema in the catalog, exposing each step, rule application, and decision point" +jsonpath "$.result.resources[5].mimeType" == "application/schema+json" +jsonpath "$.result.resources[5].size" == 1735 +jsonpath "$.result.resources[5].annotations.priority" == 0.0 +jsonpath "$.result.resources[6].uri" == "{{base}}/self/v1/schemas/mcp/tools/call/trace-schema-evaluation/response" +jsonpath "$.result.resources[6].name" == "Sourcemeta One Schema Trace RPC Output" +jsonpath "$.result.resources[6].description" == "Trace step-by-step evaluation of a JSON instance against a schema in the catalog, exposing each step, rule application, and decision point" +jsonpath "$.result.resources[6].mimeType" == "application/schema+json" +jsonpath "$.result.resources[6].size" == 497 +jsonpath "$.result.resources[6].annotations.priority" == 0.0 +jsonpath "$.result.resources[7].uri" == "{{base}}/self/v1/schemas/mcp/tools/list/request" +jsonpath "$.result.resources[7].name" == "Sourcemeta One MCP Tools List Request" +jsonpath "$.result.resources[7].description" == "Request from a client to list MCP tools" +jsonpath "$.result.resources[7].mimeType" == "application/schema+json" +jsonpath "$.result.resources[7].size" == 853 +jsonpath "$.result.resources[7].annotations.priority" == 0.0 +jsonpath "$.result.resources[8].uri" == "{{base}}/self/v1/schemas/mcp/tools/list/response" +jsonpath "$.result.resources[8].name" == "Sourcemeta One MCP Tools List Response" +jsonpath "$.result.resources[8].description" == "Sourcemeta One's list of MCP tools" +jsonpath "$.result.resources[8].mimeType" == "application/schema+json" +jsonpath "$.result.resources[8].size" == 4495 +jsonpath "$.result.resources[8].annotations.priority" == 0.0 + +# A cursor that is not aligned to a page boundary is rejected before the catalog +# is scanned, so a malformed cursor cannot force a full scan. +POST {{base}}/self/v1/mcp +Accept: application/json, text/event-stream +MCP-Protocol-Version: 2025-11-25 +Content-Type: application/json +``` +{ + "jsonrpc": "2.0", + "id": 7, + "method": "resources/list", + "params": { "cursor": "7" } +} +``` +HTTP 200 +Content-Type: application/json +[Asserts] +jsonpath "$.jsonrpc" == "2.0" +jsonpath "$.id" == 7 +jsonpath "$.error.code" == -32602 +jsonpath "$.error.message" == "Invalid resource list cursor" +jsonpath "$.error.data" == "Use the `nextCursor` returned by a prior resources/list response, or omit it to start from the beginning" +jsonpath "$.result" not exists + +# A page-aligned cursor past the end of the filtered catalog is out of range. +POST {{base}}/self/v1/mcp +Accept: application/json, text/event-stream +MCP-Protocol-Version: 2025-11-25 +Content-Type: application/json +``` +{ + "jsonrpc": "2.0", + "id": 8, + "method": "resources/list", + "params": { "cursor": "5000" } +} +``` +HTTP 200 +Content-Type: application/json +[Asserts] +jsonpath "$.jsonrpc" == "2.0" +jsonpath "$.id" == 8 +jsonpath "$.error.code" == -32602 +jsonpath "$.result" not exists + +# A non-numeric cursor is rejected outright. +POST {{base}}/self/v1/mcp +Accept: application/json, text/event-stream +MCP-Protocol-Version: 2025-11-25 +Content-Type: application/json +``` +{ + "jsonrpc": "2.0", + "id": 9, + "method": "resources/list", + "params": { "cursor": "abc" } +} +``` +HTTP 200 +Content-Type: application/json +[Asserts] +jsonpath "$.jsonrpc" == "2.0" +jsonpath "$.id" == 9 +jsonpath "$.error.code" == -32602 +jsonpath "$.result" not exists diff --git a/enterprise/index/enterprise_index.cc b/enterprise/index/enterprise_index.cc index 673fb7daa..1da387670 100644 --- a/enterprise/index/enterprise_index.cc +++ b/enterprise/index/enterprise_index.cc @@ -11,7 +11,6 @@ #include #include -#include #include // assert #include // std::size_t @@ -60,43 +59,6 @@ auto load_custom_lint_rules( } } -auto generate_mcp_resources(const std::filesystem::path &search_metapack_path, - const sourcemeta::one::Configuration &configuration, - const std::size_t page_size, - sourcemeta::core::JSON &resources) -> void { - sourcemeta::one::SearchView search_view{search_metapack_path}; - const auto total{search_view.count()}; - const auto page_count{total == 0 ? std::size_t{1} - : (total + page_size - 1) / page_size}; - - for (std::size_t page_index{0}; page_index < page_count; ++page_index) { - const auto offset{page_index * page_size}; - auto page{sourcemeta::core::JSON::make_object()}; - auto entries{sourcemeta::core::JSON::make_array()}; - - search_view.for_each( - offset, page_size, - [&entries, &configuration]( - const sourcemeta::one::SearchListEntry &entry) -> void { - std::string uri{configuration.origin}; - uri.append(entry.path); - - entries.push_back(sourcemeta::core::mcp_make_resource( - uri, entry.title.empty() ? entry.path : entry.title, - "application/schema+json", entry.description, - static_cast(entry.bytes_raw), - static_cast(entry.priority) / 100.0)); - }); - - page.assign("resources", std::move(entries)); - if (page_index + 1 < page_count) { - page.assign("nextCursor", - sourcemeta::core::JSON{std::to_string(offset + page_size)}); - } - resources.assign(std::to_string(offset), std::move(page)); - } -} - auto generate_mcp_tools(const sourcemeta::core::URITemplateRouterView &router, sourcemeta::core::JSON &tools, sourcemeta::core::JSON &tool_routes) -> void { diff --git a/enterprise/index/include/sourcemeta/one/enterprise_index.h b/enterprise/index/include/sourcemeta/one/enterprise_index.h index 30560797a..8cb82037b 100644 --- a/enterprise/index/include/sourcemeta/one/enterprise_index.h +++ b/enterprise/index/include/sourcemeta/one/enterprise_index.h @@ -11,8 +11,6 @@ #include #include -#include // std::size_t -#include // std::filesystem::path #include // std::string_view #include // std::unordered_set @@ -25,11 +23,6 @@ auto load_custom_lint_rules( const sourcemeta::one::Resolver &resolver, const sourcemeta::one::BuildDynamicCallback &callback) -> void; -auto generate_mcp_resources(const std::filesystem::path &search_metapack_path, - const sourcemeta::one::Configuration &configuration, - const std::size_t page_size, - sourcemeta::core::JSON &resources) -> void; - auto generate_mcp_tools(const sourcemeta::core::URITemplateRouterView &router, sourcemeta::core::JSON &tools, sourcemeta::core::JSON &tool_routes) -> void; diff --git a/enterprise/server/action_mcp_v1.cc b/enterprise/server/action_mcp_v1.cc index 892c571c2..0814d367d 100644 --- a/enterprise/server/action_mcp_v1.cc +++ b/enterprise/server/action_mcp_v1.cc @@ -10,9 +10,11 @@ #include #include +#include #include // assert #include // std::size_t, std::ptrdiff_t +#include // std::uint64_t #include // std::exception #include // std::filesystem #include // std::ranges::distance @@ -25,34 +27,74 @@ namespace { constexpr std::string_view MCP_TEMPLATE_MIME_TYPE{"application/schema+json"}; +constexpr std::size_t MCP_RESOURCES_PAGE_SIZE{50}; + +const auto MCP_HASH_RESOURCES{ + sourcemeta::core::JSON::Object::hash("resources")}; +const auto MCP_HASH_NEXT_CURSOR{ + sourcemeta::core::JSON::Object::hash("nextCursor")}; } // namespace namespace sourcemeta::one::enterprise { -auto ActionMCP_v1::on_resources_list(const sourcemeta::core::JSON &request_json) - const -> sourcemeta::core::JSON { +auto ActionMCP_v1::on_resources_list(const sourcemeta::core::JSON &request_json, + const std::string_view credential) + -> sourcemeta::core::JSON { const auto &id{request_json.at("id")}; - std::string cursor_key{"0"}; + std::uint64_t offset{0}; const auto *params{sourcemeta::core::jsonrpc_params(request_json)}; if (params != nullptr && params->defines("cursor")) { const auto cursor_input{params->at("cursor").to_string()}; if (!cursor_input.empty()) { const auto parsed{sourcemeta::core::to_uint64_t(cursor_input)}; - if (!parsed.has_value()) { + // A cursor must parse and align to a page boundary. Reject before the + // catalog scan so a malformed cursor cannot force the O(N) walk + if (!parsed.has_value() || + parsed.value() % MCP_RESOURCES_PAGE_SIZE != 0) { return sourcemeta::core::jsonrpc_make_error( &id, -32602, "Invalid resource list cursor", sourcemeta::core::JSON{ "Use the `nextCursor` returned by a prior resources/list " "response, or omit it to start from the beginning"}); } - cursor_key = std::to_string(parsed.value()); + offset = parsed.value(); } } - const auto &resources{this->mcp_metadata_.at("resources")}; - if (!resources.defines(cursor_key)) { + // The pages are not pre-baked: a caller only sees the schemas it is admitted + // to, so the list is filtered against its credential at request time, exactly + // as the search surface does + const auto &authentication{this->dispatcher().authentication()}; + auto resources{sourcemeta::core::JSON::make_array()}; + std::uint64_t admitted{0}; + this->search_view_.for_each( + 0, this->search_view_.count(), + [this, credential, &authentication, &resources, &admitted, + offset](const sourcemeta::one::SearchListEntry &entry) -> void { + if (!authentication.admits(entry.path, credential).allowed) { + return; + } + + const auto position{admitted++}; + if (position < offset || position >= offset + MCP_RESOURCES_PAGE_SIZE) { + return; + } + + std::string uri{this->allowed_origin_}; + uri.append(entry.path); + resources.push_back(sourcemeta::core::mcp_make_resource( + uri, entry.title.empty() ? entry.path : entry.title, + MCP_TEMPLATE_MIME_TYPE, entry.description, + static_cast(entry.bytes_raw), + static_cast(entry.priority) / 100.0)); + }); + + // The alignment of a non-zero cursor is already validated above. A cursor + // past the end of the filtered catalog is out of range, though zero is always + // valid even when the catalog is empty + if (offset != 0 && offset >= admitted) { return sourcemeta::core::jsonrpc_make_error( &id, -32602, "Invalid resource list cursor", sourcemeta::core::JSON{ @@ -60,7 +102,16 @@ auto ActionMCP_v1::on_resources_list(const sourcemeta::core::JSON &request_json) "response, or omit it to start from the beginning"}); } - return sourcemeta::core::jsonrpc_make_success(id, resources.at(cursor_key)); + auto page{sourcemeta::core::JSON::make_object()}; + page.assign_assume_new("resources", std::move(resources), MCP_HASH_RESOURCES); + if (offset + MCP_RESOURCES_PAGE_SIZE < admitted) { + page.assign_assume_new("nextCursor", + sourcemeta::core::JSON{std::to_string( + offset + MCP_RESOURCES_PAGE_SIZE)}, + MCP_HASH_NEXT_CURSOR); + } + + return sourcemeta::core::jsonrpc_make_success(id, std::move(page)); } auto ActionMCP_v1::on_initialize(const sourcemeta::core::JSON &request_json) @@ -260,7 +311,7 @@ auto ActionMCP_v1::process_one( return this->on_tools_list(version, request_json); } if (method == sourcemeta::core::MCP_METHOD_RESOURCES_LIST) { - return this->on_resources_list(request_json); + return this->on_resources_list(request_json, credential); } if (method == sourcemeta::core::MCP_METHOD_RESOURCES_READ) { return this->on_resources_read(request_json, credential); diff --git a/enterprise/server/include/sourcemeta/one/enterprise_server_actions.h b/enterprise/server/include/sourcemeta/one/enterprise_server_actions.h index 15c66ca2f..7b7cdd68a 100644 --- a/enterprise/server/include/sourcemeta/one/enterprise_server_actions.h +++ b/enterprise/server/include/sourcemeta/one/enterprise_server_actions.h @@ -10,6 +10,7 @@ #include #include #include +#include #include // assert #include // std::exception, std::exception_ptr, std::rethrow_exception @@ -37,7 +38,8 @@ class ActionMCP_v1 : public sourcemeta::one::RouterAction { const sourcemeta::core::URITemplateRouter::Identifier identifier, sourcemeta::one::Router &dispatcher) : sourcemeta::one::RouterAction{base, router.base_path(), - router.base_url(), dispatcher} { + router.base_url(), dispatcher}, + search_view_{base / "explorer" / "%" / "search.metapack"} { router.arguments(identifier, [this](const auto &key, const auto &value) { if (key == "responseSchema") { this->response_schema_ = std::get(value); @@ -287,8 +289,8 @@ class ActionMCP_v1 : public sourcemeta::one::RouterAction { sourcemeta::one::Encoding::Identity); } - auto on_resources_list(const sourcemeta::core::JSON &request_json) const - -> sourcemeta::core::JSON; + auto on_resources_list(const sourcemeta::core::JSON &request_json, + std::string_view credential) -> sourcemeta::core::JSON; auto on_initialize(const sourcemeta::core::JSON &request_json) const -> sourcemeta::core::JSON; @@ -319,6 +321,7 @@ class ActionMCP_v1 : public sourcemeta::one::RouterAction { std::string_view response_schema_; std::string_view request_schema_; sourcemeta::core::JSON mcp_metadata_{nullptr}; + sourcemeta::one::SearchView search_view_; }; } // namespace sourcemeta::one::enterprise diff --git a/src/index/explorer.h b/src/index/explorer.h index a0e74a7a4..c0777209d 100644 --- a/src/index/explorer.h +++ b/src/index/explorer.h @@ -643,13 +643,10 @@ struct GENERATE_MCP { "schemas rather than guessing paths", "application/schema+json")); - auto resources{sourcemeta::core::JSON::make_object()}; auto tools{sourcemeta::core::JSON::make_array()}; auto tool_routes{sourcemeta::core::JSON::make_object()}; #if defined(SOURCEMETA_ONE_ENTERPRISE) - sourcemeta::one::generate_mcp_resources( - action.dependencies.front(), configuration, MCP_PAGE_SIZE, resources); { const sourcemeta::core::URITemplateRouterView router_view{ action.dependencies.back()}; @@ -688,7 +685,6 @@ struct GENERATE_MCP { document.assign( std::string{sourcemeta::core::MCP_METHOD_RESOURCES_TEMPLATES_LIST}, std::move(resource_templates_response)); - document.assign("resources", std::move(resources)); document.assign(std::string{sourcemeta::core::MCP_METHOD_TOOLS_LIST}, std::move(tools)); document.assign("toolRoutes", std::move(tool_routes)); @@ -700,9 +696,6 @@ struct GENERATE_MCP { std::chrono::duration_cast(timestamp_end - timestamp_start)); } - -private: - static constexpr std::size_t MCP_PAGE_SIZE{50}; }; // The mutable build state is only safe to read while holding its lock, as