From 3d003abacbbede1456a7680403ea04d8d9d8ea24 Mon Sep 17 00:00:00 2001 From: cliffhall Date: Thu, 11 Dec 2025 17:04:50 -0500 Subject: [PATCH] [WIP] Refactor everything server to be more modular and use recommended APIs. [WIP] Adding Gzip File as Resource tool * Updated architecture.md * In resources/files.ts - remove 'Docs: ' from resource name * In resources/templates.ts - use blob instead of text in resource content --- src/everything/docs/architecture.md | 2 +- src/everything/resources/files.ts | 3 +-- src/everything/resources/templates.ts | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/everything/docs/architecture.md b/src/everything/docs/architecture.md index 60679fd6..eb815648 100644 --- a/src/everything/docs/architecture.md +++ b/src/everything/docs/architecture.md @@ -105,7 +105,7 @@ At `src/everything`: - get-resource-reference.ts - Registers a `get-resource-reference` tool that returns a reference for a selected dynamic resource. - get-sampling-request.ts - - Registers a `sampling-request` tool that sends a `sampling/createMessage` request to the client/LLM and returns the sampling result. + - Registers a `sampling-request` tool that sends a `sampling/createMessage` request to the client/LLM and returns the sampling result. - get-structured-content.ts - Registers a `get-structured-content` tool that demonstrates structuredContent block responses. - get-sum.ts diff --git a/src/everything/resources/files.ts b/src/everything/resources/files.ts index a5bf2166..e38cb596 100644 --- a/src/everything/resources/files.ts +++ b/src/everything/resources/files.ts @@ -40,12 +40,11 @@ export const registerFileResources = (server: McpServer) => { // Prepare file resource info const uri = `demo://resource/static/document/${encodeURIComponent(name)}`; const mimeType = getMimeType(name); - const displayName = `Docs: ${name}`; const description = `Static document file exposed from /docs: ${name}`; // Register file resource server.registerResource( - displayName, + name, uri, { mimeType, description }, async (uri) => { diff --git a/src/everything/resources/templates.ts b/src/everything/resources/templates.ts index db509706..6d4903f7 100644 --- a/src/everything/resources/templates.ts +++ b/src/everything/resources/templates.ts @@ -106,7 +106,7 @@ export const blobResource = (uri: URL, resourceId: number) => { return { uri: uri.toString(), mimeType: "text/plain", - text: resourceText, + blob: resourceText, }; };