Skip to content

Commit 6bb034a

Browse files
committed
fix: add mcp path to resource string
1 parent 869e3a6 commit 6bb034a

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/mcp/HttpHandler.mo

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ module {
188188
// OIDC is configured, so we can proceed.
189189

190190
// 1. Generate the content.
191-
let bodyBlob = Utils.getResourceMetadataBlob(ctx.self, oidcState, req);
191+
let mcpPath = Option.get(ctx.mcp_path, "/mcp");
192+
let bodyBlob = Utils.getResourceMetadataBlob(ctx.self, mcpPath, oidcState, req);
192193

193194
// 2. Put it in the cache. The library handles hashing and set_certified_data().
194195
cache.put(req.url, bodyBlob, null);

src/mcp/Utils.mo

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ module {
110110
// Get json body for resource metadata.
111111
public func getResourceMetadataBlob(
112112
self : Principal,
113+
mcpPath : Text,
113114
oidcState : AuthTypes.OidcState,
114115
req : HttpTypes.Request,
115116
) : Blob {
@@ -119,7 +120,7 @@ module {
119120
// Auth is enabled, so serve the metadata document.
120121
let bodyJson = Json.obj([
121122
("authorization_servers", Json.arr([Json.str(oidcState.issuerUrl)])),
122-
("resource", Json.str(getThisUrl(self, req, null))),
123+
("resource", Json.str(getThisUrl(self, req, ?mcpPath))),
123124
("scopes_supported", jsonScopes),
124125
]);
125126

0 commit comments

Comments
 (0)