Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions enterprise/e2e/html/hurl/list.all.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ header "Last-Modified" exists
jsonpath "$.path" == "/"
jsonpath "$.url" == "{{base}}"
jsonpath "$.breadcrumb" count == 0
jsonpath "$.schemas" == 23
jsonpath "$.schemas" == 29
jsonpath "$.entries" count == 2
jsonpath "$.entries[0].name" == "self"
jsonpath "$.entries[0].title" == "Self"
jsonpath "$.entries[0].description" == "The schemas that define the current version of this instance"
jsonpath "$.entries[0].type" == "directory"
jsonpath "$.entries[0].health" == 100
jsonpath "$.entries[0].schemas" == 22
jsonpath "$.entries[0].schemas" == 28
jsonpath "$.entries[0].path" == "/self/"
jsonpath "$.entries[1].name" == "test"
jsonpath "$.entries[1].type" == "directory"
Expand Down
4 changes: 2 additions & 2 deletions enterprise/e2e/html/hurl/mcp-lifecycle.all.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ schema_path: header "Link" regex "<([^>]+)>"
jsonpath "$.jsonrpc" == "2.0"
jsonpath "$.id" == 1
jsonpath "$.result.protocolVersion" == "2025-11-25"
jsonpath "$.result.capabilities" isObject
jsonpath "$.result.capabilities" isEmpty
jsonpath "$.result.capabilities.resources" isObject
jsonpath "$.result.capabilities.resources" isEmpty
jsonpath "$.result.serverInfo.name" == "sourcemeta-one-enterprise"
jsonpath "$.result.serverInfo.title" == "Sourcemeta One Enterprise"
jsonpath "$.result.serverInfo.version" matches "^.+$"
Expand Down
4 changes: 2 additions & 2 deletions enterprise/e2e/path/hurl/mcp-lifecycle.all.hurl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ schema_path: header "Link" regex "</v1/catalog([^>]+)>"
jsonpath "$.jsonrpc" == "2.0"
jsonpath "$.id" == 1
jsonpath "$.result.protocolVersion" == "2025-11-25"
jsonpath "$.result.capabilities" isObject
jsonpath "$.result.capabilities" isEmpty
jsonpath "$.result.capabilities.resources" isObject
jsonpath "$.result.capabilities.resources" isEmpty
jsonpath "$.result.serverInfo.name" == "sourcemeta-one-enterprise"
jsonpath "$.result.serverInfo.title" == "Sourcemeta One Enterprise"
jsonpath "$.result.serverInfo.version" matches "^.+$"
Expand Down
4 changes: 3 additions & 1 deletion enterprise/server/action_mcp_v1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ auto handle_initialize(const sourcemeta::core::JSON &request_json)
auto result{sourcemeta::core::JSON::make_object()};
result.assign("protocolVersion",
sourcemeta::core::JSON{std::string{MCP_PROTOCOL_VERSION}});
result.assign("capabilities", sourcemeta::core::JSON::make_object());
auto capabilities{sourcemeta::core::JSON::make_object()};
capabilities.assign("resources", sourcemeta::core::JSON::make_object());
result.assign("capabilities", std::move(capabilities));
auto server_info{sourcemeta::core::JSON::make_object()};
server_info.assign("name",
sourcemeta::core::JSON{std::string{MCP_SERVER_NAME}});
Expand Down
25 changes: 25 additions & 0 deletions src/self/v1/schemas/mcp/error.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@
"code": 4,
"message": "Method not allowed"
}
},
{
"jsonrpc": "2.0",
"id": 20,
"error": {
"code": -32002,
"message": "Resource not found",
"data": "https://example.com/v1/foo/v1/example"
}
}
],
"type": "object",
Expand All @@ -64,6 +73,22 @@
{
"$ref": "#/$defs/reserved"
},
{
"type": "object",
"required": [ "code", "message", "data" ],
"properties": {
"code": {
"const": -32002
},
"message": {
"const": "Resource not found"
},
"data": {
"type": "string"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [ "code", "message", "data" ],
Expand Down
11 changes: 10 additions & 1 deletion src/self/v1/schemas/mcp/initialize/response.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"id": 1,
"result": {
"protocolVersion": "2025-11-25",
"capabilities": {},
"capabilities": {
"resources": {}
},
"serverInfo": {
"name": "sourcemeta-one-enterprise",
"title": "Sourcemeta One Enterprise",
Expand All @@ -35,6 +37,13 @@
},
"capabilities": {
"type": "object",
"required": [ "resources" ],
"properties": {
"resources": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
"serverInfo": {
Expand Down
27 changes: 27 additions & 0 deletions src/self/v1/schemas/mcp/request.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@
"jsonrpc": "2.0",
"id": 2,
"method": "ping"
},
{
"jsonrpc": "2.0",
"id": 10,
"method": "resources/list"
},
{
"jsonrpc": "2.0",
"id": 12,
"method": "resources/templates/list"
},
{
"jsonrpc": "2.0",
"id": 20,
"method": "resources/read",
"params": {
"uri": "https://example.com/v1/foo/v1/example"
}
}
],
"anyOf": [
Expand All @@ -38,6 +56,15 @@
},
{
"$ref": "./ping/request.json"
},
{
"$ref": "./resources/list/request.json"
},
{
"$ref": "./resources/templates/list/request.json"
},
{
"$ref": "./resources/read/request.json"
}
]
}
49 changes: 49 additions & 0 deletions src/self/v1/schemas/mcp/resources/list/request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Sourcemeta One MCP Resources List Request",
"description": "Request from a client to list MCP resources",
"examples": [
{
"jsonrpc": "2.0",
"id": 10,
"method": "resources/list"
},
{
"jsonrpc": "2.0",
"id": 11,
"method": "resources/list",
"params": {
"cursor": "page-2"
}
}
],
"type": "object",
"required": [ "jsonrpc", "id", "method" ],
"properties": {
"jsonrpc": {
"const": "2.0"
},
"id": {
"type": [ "string", "integer" ]
},
"method": {
"const": "resources/list"
},
"params": {
"type": "object",
"properties": {
"cursor": {
"type": "string"
},
"_meta": {
"type": "object",
"properties": {
"progressToken": {
"type": [ "string", "integer" ]
}
}
}
}
}
}
}
35 changes: 35 additions & 0 deletions src/self/v1/schemas/mcp/resources/list/response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Sourcemeta One MCP Resources List Response",
"description": "Sourcemeta One's list of MCP resources",
"examples": [
{
"jsonrpc": "2.0",
"id": 10,
"result": {
"resources": []
}
}
],
"type": "object",
"required": [ "jsonrpc", "id", "result" ],
"properties": {
"jsonrpc": {
"const": "2.0"
},
"id": {
"type": [ "string", "integer" ]
},
"result": {
"type": "object",
"required": [ "resources" ],
"properties": {
"resources": {
"const": []
Comment thread
jviotti marked this conversation as resolved.
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
55 changes: 55 additions & 0 deletions src/self/v1/schemas/mcp/resources/read/request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Sourcemeta One MCP Resources Read Request",
"description": "Request from a client to read an MCP resource",
"examples": [
{
"jsonrpc": "2.0",
"id": 20,
"method": "resources/read",
"params": {
"uri": "https://example.com/v1/foo/v1/example"
}
},
{
"jsonrpc": "2.0",
"id": 21,
"method": "resources/read",
"params": {
"uri": "https://example.com/v1/foo/v1/example?bundle=1"
}
}
],
"type": "object",
"required": [ "jsonrpc", "id", "method", "params" ],
"properties": {
"jsonrpc": {
"const": "2.0"
},
"id": {
"type": [ "string", "integer" ]
},
"method": {
"const": "resources/read"
},
"params": {
"type": "object",
"required": [ "uri" ],
"properties": {
"uri": {
"$comment": "TODO: Use Format Assertion when supported on Blaze",
"type": "string",
"format": "uri"
},
"_meta": {
"type": "object",
"properties": {
"progressToken": {
"type": [ "string", "integer" ]
}
}
}
}
}
}
}
63 changes: 63 additions & 0 deletions src/self/v1/schemas/mcp/resources/read/response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Sourcemeta One MCP Resources Read Response",
"description": "Sourcemeta One's response containing an MCP resource",
"examples": [
{
"jsonrpc": "2.0",
"id": 20,
"result": {
"contents": [
{
"uri": "https://example.com/v1/foo/v1/example",
"mimeType": "application/schema+json",
"text": "{\n \"$id\": \"https://example.com/v1/foo/v1/example\",\n \"type\": \"object\"\n}"
}
]
}
}
],
"type": "object",
"required": [ "jsonrpc", "id", "result" ],
"properties": {
"jsonrpc": {
"const": "2.0"
},
"id": {
"type": [ "string", "integer" ]
},
"result": {
"type": "object",
"required": [ "contents" ],
"properties": {
"contents": {
"type": "array",
"maxItems": 1,
"minItems": 1,
"items": {
"type": "object",
"required": [ "uri", "mimeType", "text" ],
"properties": {
"uri": {
"$comment": "TODO: Use Format Assertion when supported on Blaze",
"type": "string",
"format": "uri"
},
"mimeType": {
"const": "application/schema+json"
},
"text": {
"type": "string",
"contentEncoding": "identity",
"contentMediaType": "application/schema+json"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
},
"additionalProperties": false
}
38 changes: 38 additions & 0 deletions src/self/v1/schemas/mcp/resources/templates/list/request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Sourcemeta One MCP Resources Templates List Request",
"description": "Request from a client to list MCP resource templates",
"examples": [
{
"jsonrpc": "2.0",
"id": 12,
"method": "resources/templates/list"
}
],
"type": "object",
"required": [ "jsonrpc", "id", "method" ],
"properties": {
"jsonrpc": {
"const": "2.0"
},
"id": {
"type": [ "string", "integer" ]
},
"method": {
"const": "resources/templates/list"
},
"params": {
"type": "object",
"properties": {
"_meta": {
"type": "object",
"properties": {
"progressToken": {
"type": [ "string", "integer" ]
}
}
}
}
}
}
}
Loading
Loading