[WIP] Refactor everything server to be more modular and use recommended APIs.

Adding the annotated message tool

* Updated architecture.md

* In annotated-message.ts
  - prettier
This commit is contained in:
cliffhall 2025-12-09 16:56:00 -05:00
commit 328a990163
2 changed files with 7 additions and 7 deletions

View file

@ -131,7 +131,7 @@ At `src/everything`:
- Registers two dynamic, template‑driven resources using `ResourceTemplate`: - Registers two dynamic, template‑driven resources using `ResourceTemplate`:
- Text: `demo://resource/dynamic/text/{index}` (MIME: `text/plain`) - Text: `demo://resource/dynamic/text/{index}` (MIME: `text/plain`)
- Blob: `demo://resource/dynamic/blob/{index}` (MIME: `application/octet-stream`, Base64 payload) - Blob: `demo://resource/dynamic/blob/{index}` (MIME: `application/octet-stream`, Base64 payload)
- The `{index}` path variable must be a finite integer. Content is generated on demand with a timestamp. - The `{index}` path variable must be a finite positive integer. Content is generated on demand with a timestamp.
- Exposes helpers `textResource(uri, index)`, `textResourceUri(index)`, `blobResource(uri, index)`, and `blobResourceUri(index)` so other modules can construct and embed dynamic resources directly (e.g., from prompts). - Exposes helpers `textResource(uri, index)`, `textResourceUri(index)`, `blobResource(uri, index)`, and `blobResourceUri(index)` so other modules can construct and embed dynamic resources directly (e.g., from prompts).
- files.ts - files.ts
- Registers static file-based resources for each file in the `docs/` folder. - Registers static file-based resources for each file in the `docs/` folder.

View file

@ -1,7 +1,7 @@
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
import { z } from "zod"; import { z } from "zod";
import {MCP_TINY_IMAGE} from "./get-tiny-image.js"; import { MCP_TINY_IMAGE } from "./get-tiny-image.js";
// Tool input schema // Tool input schema
const AnnotatedMessageSchema = z.object({ const AnnotatedMessageSchema = z.object({
@ -18,11 +18,11 @@ const AnnotatedMessageSchema = z.object({
const name = "annotated-message"; const name = "annotated-message";
const config = { const config = {
title: "Annotated Message Tool", title: "Annotated Message Tool",
description: "Demonstrates how annotations can be used to provide metadata about content.", description:
"Demonstrates how annotations can be used to provide metadata about content.",
inputSchema: AnnotatedMessageSchema, inputSchema: AnnotatedMessageSchema,
}; };
/** /**
* Registers the 'annotated-message' tool with the provided McpServer instance. * Registers the 'annotated-message' tool with the provided McpServer instance.
* *