Add instructions

This commit is contained in:
olaservo
2025-05-26 12:49:33 -07:00
parent cf64b23db2
commit 318c22b2ac
3 changed files with 51 additions and 4 deletions

View File

@@ -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<typeof ToolInputSchema>;
@@ -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",

View File

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

View File

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