diff --git a/src/everything/everything.ts b/src/everything/everything.ts index 50fa5160..2abce9a0 100644 --- a/src/everything/everything.ts +++ b/src/everything/everything.ts @@ -20,6 +20,13 @@ import { } from "@modelcontextprotocol/sdk/types.js"; import { z } from "zod"; import { zodToJsonSchema } from "zod-to-json-schema"; +import { readFileSync } from "fs"; +import { fileURLToPath } from "url"; +import { dirname, join } from "path"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const instructions = readFileSync(join(__dirname, "instructions.md"), "utf-8"); const ToolInputSchema = ToolSchema.shape.inputSchema; type ToolInput = z.infer; @@ -110,6 +117,7 @@ export const createServer = () => { logging: {}, completions: {}, }, + instructions } ); @@ -160,9 +168,9 @@ export const createServer = () => { // Set up update interval for stderr messages stdErrUpdateInterval = setInterval(() => { const shortTimestamp = new Date().toLocaleTimeString([], { - hour: '2-digit', - minute: '2-digit', - second: '2-digit' + hour: "2-digit", + minute: "2-digit", + second: "2-digit" }); server.notification({ method: "notifications/stderr", diff --git a/src/everything/instructions.md b/src/everything/instructions.md new file mode 100644 index 00000000..ad61db43 --- /dev/null +++ b/src/everything/instructions.md @@ -0,0 +1,39 @@ +# Everything Server + +This is a comprehensive MCP server that demonstrates all major MCP features and capabilities. + +## Available Tools + +- **echo**: Echo back any message +- **add**: Add two numbers together +- **longRunningOperation**: Demonstrate progress notifications with configurable duration and steps +- **printEnv**: Display all environment variables for debugging server configuration +- **sampleLLM**: Request LLM sampling from the client with a custom prompt +- **getTinyImage**: Return a small example image in PNG format +- **annotatedMessage**: Show how content annotations work for different message types +- **getResourceReference**: Return an embedded resource reference by ID (1-100) + +## Available Resources + +- Static resources numbered 1-100 accessible via `test://static/resource/{id}` +- Even-numbered resources contain plain text, odd-numbered contain binary data +- Resources support subscription for real-time updates every 10 seconds +- Resource templates allow dynamic URI construction + +## Available Prompts + +- **simple_prompt**: Basic prompt without arguments +- **complex_prompt**: Advanced prompt with temperature and style arguments, includes image content +- **resource_prompt**: Prompt that embeds a specific resource by ID + +## Features + +- Pagination support for large resource lists +- Argument completion for prompt parameters and resource IDs +- Progress notifications for long-running operations +- Configurable logging levels with automatic log message generation +- Resource subscription system with periodic update notifications +- LLM sampling integration for server-initiated model requests +- Content annotations for priority and audience targeting + +Use this server to test MCP client implementations and explore all protocol features. diff --git a/src/everything/package.json b/src/everything/package.json index 553db407..a9e9d9eb 100644 --- a/src/everything/package.json +++ b/src/everything/package.json @@ -14,7 +14,7 @@ "dist" ], "scripts": { - "build": "tsc && shx chmod +x dist/*.js", + "build": "tsc && shx cp instructions.md dist/ && shx chmod +x dist/*.js", "prepare": "npm run build", "watch": "tsc --watch", "start": "node dist/index.js",