[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
This commit is contained in:
cliffhall
2025-12-11 17:04:50 -05:00
parent 48bf94a728
commit 3d003abacb
3 changed files with 3 additions and 4 deletions

View File

@@ -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

View File

@@ -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) => {

View File

@@ -106,7 +106,7 @@ export const blobResource = (uri: URL, resourceId: number) => {
return {
uri: uri.toString(),
mimeType: "text/plain",
text: resourceText,
blob: resourceText,
};
};