@modelcontextprotocol/server-everything 2025.3.19 → 2025.4.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/dist/everything.js +114 -17
- package/package.json +2 -2
package/README.md
CHANGED
@@ -63,6 +63,15 @@ This MCP server attempts to exercise all the features of the MCP protocol. It is
|
|
63
63
|
}
|
64
64
|
```
|
65
65
|
|
66
|
+
8. `getResourceReference`
|
67
|
+
- Returns a resource reference that can be used by MCP clients
|
68
|
+
- Inputs:
|
69
|
+
- `resourceId` (number, 1-100): ID of the resource to reference
|
70
|
+
- Returns: A resource reference with:
|
71
|
+
- Text introduction
|
72
|
+
- Embedded resource with `type: "resource"`
|
73
|
+
- Text instruction for using the resource URI
|
74
|
+
|
66
75
|
### Resources
|
67
76
|
|
68
77
|
The server provides 100 test resources in two formats:
|
@@ -96,6 +105,13 @@ Resource features:
|
|
96
105
|
- `style` (string): Output style preference
|
97
106
|
- Returns: Multi-turn conversation with images
|
98
107
|
|
108
|
+
3. `resource_prompt`
|
109
|
+
- Demonstrates embedding resource references in prompts
|
110
|
+
- Required arguments:
|
111
|
+
- `resourceId` (number): ID of the resource to embed (1-100)
|
112
|
+
- Returns: Multi-turn conversation with an embedded resource reference
|
113
|
+
- Shows how to include resources directly in prompt messages
|
114
|
+
|
99
115
|
### Logging
|
100
116
|
|
101
117
|
The server sends random-leveled log messages every 15 seconds, e.g.:
|
@@ -127,3 +143,32 @@ Add to your `claude_desktop_config.json`:
|
|
127
143
|
}
|
128
144
|
}
|
129
145
|
```
|
146
|
+
|
147
|
+
## Usage with VS Code
|
148
|
+
|
149
|
+
For quick installation, use of of the one-click install buttons below...
|
150
|
+
|
151
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=everything&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-everything%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=everything&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-everything%22%5D%7D&quality=insiders)
|
152
|
+
|
153
|
+
[](https://insiders.vscode.dev/redirect/mcp/install?name=everything&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22mcp%2Feverything%22%5D%7D) [](https://insiders.vscode.dev/redirect/mcp/install?name=everything&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22mcp%2Feverything%22%5D%7D&quality=insiders)
|
154
|
+
|
155
|
+
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing `Ctrl + Shift + P` and typing `Preferences: Open User Settings (JSON)`.
|
156
|
+
|
157
|
+
Optionally, you can add it to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others.
|
158
|
+
|
159
|
+
> Note that the `mcp` key is not needed in the `.vscode/mcp.json` file.
|
160
|
+
|
161
|
+
#### NPX
|
162
|
+
|
163
|
+
```json
|
164
|
+
{
|
165
|
+
"mcp": {
|
166
|
+
"servers": {
|
167
|
+
"everything": {
|
168
|
+
"command": "npx",
|
169
|
+
"args": ["-y", "@modelcontextprotocol/server-everything"]
|
170
|
+
}
|
171
|
+
}
|
172
|
+
}
|
173
|
+
}
|
174
|
+
```
|
package/dist/everything.js
CHANGED
@@ -34,10 +34,20 @@ const EXAMPLE_COMPLETIONS = {
|
|
34
34
|
};
|
35
35
|
const GetTinyImageSchema = z.object({});
|
36
36
|
const AnnotatedMessageSchema = z.object({
|
37
|
-
messageType: z
|
37
|
+
messageType: z
|
38
|
+
.enum(["error", "success", "debug"])
|
38
39
|
.describe("Type of message to demonstrate different annotation patterns"),
|
39
|
-
includeImage: z
|
40
|
-
.
|
40
|
+
includeImage: z
|
41
|
+
.boolean()
|
42
|
+
.default(false)
|
43
|
+
.describe("Whether to include an example image"),
|
44
|
+
});
|
45
|
+
const GetResourceReferenceSchema = z.object({
|
46
|
+
resourceId: z
|
47
|
+
.number()
|
48
|
+
.min(1)
|
49
|
+
.max(100)
|
50
|
+
.describe("ID of the resource to reference (1-100)"),
|
41
51
|
});
|
42
52
|
var ToolName;
|
43
53
|
(function (ToolName) {
|
@@ -48,11 +58,13 @@ var ToolName;
|
|
48
58
|
ToolName["SAMPLE_LLM"] = "sampleLLM";
|
49
59
|
ToolName["GET_TINY_IMAGE"] = "getTinyImage";
|
50
60
|
ToolName["ANNOTATED_MESSAGE"] = "annotatedMessage";
|
61
|
+
ToolName["GET_RESOURCE_REFERENCE"] = "getResourceReference";
|
51
62
|
})(ToolName || (ToolName = {}));
|
52
63
|
var PromptName;
|
53
64
|
(function (PromptName) {
|
54
65
|
PromptName["SIMPLE"] = "simple_prompt";
|
55
66
|
PromptName["COMPLEX"] = "complex_prompt";
|
67
|
+
PromptName["RESOURCE"] = "resource_prompt";
|
56
68
|
})(PromptName || (PromptName = {}));
|
57
69
|
export const createServer = () => {
|
58
70
|
const server = new Server({
|
@@ -64,10 +76,12 @@ export const createServer = () => {
|
|
64
76
|
resources: { subscribe: true },
|
65
77
|
tools: {},
|
66
78
|
logging: {},
|
79
|
+
completions: {},
|
67
80
|
},
|
68
81
|
});
|
69
82
|
let subscriptions = new Set();
|
70
83
|
let subsUpdateInterval;
|
84
|
+
let stdErrUpdateInterval;
|
71
85
|
// Set up update interval for subscribed resources
|
72
86
|
subsUpdateInterval = setInterval(() => {
|
73
87
|
for (const uri of subscriptions) {
|
@@ -76,7 +90,7 @@ export const createServer = () => {
|
|
76
90
|
params: { uri },
|
77
91
|
});
|
78
92
|
}
|
79
|
-
},
|
93
|
+
}, 10000);
|
80
94
|
let logLevel = "debug";
|
81
95
|
let logsUpdateInterval;
|
82
96
|
const messages = [
|
@@ -87,7 +101,7 @@ export const createServer = () => {
|
|
87
101
|
{ level: "error", data: "Error-level message" },
|
88
102
|
{ level: "critical", data: "Critical-level message" },
|
89
103
|
{ level: "alert", data: "Alert level-message" },
|
90
|
-
{ level: "emergency", data: "Emergency-level message" }
|
104
|
+
{ level: "emergency", data: "Emergency-level message" },
|
91
105
|
];
|
92
106
|
const isMessageIgnored = (level) => {
|
93
107
|
const currentLevel = messages.findIndex((msg) => logLevel === msg.level);
|
@@ -102,7 +116,19 @@ export const createServer = () => {
|
|
102
116
|
};
|
103
117
|
if (!isMessageIgnored(message.params.level))
|
104
118
|
server.notification(message);
|
105
|
-
},
|
119
|
+
}, 20000);
|
120
|
+
// Set up update interval for stderr messages
|
121
|
+
stdErrUpdateInterval = setInterval(() => {
|
122
|
+
const shortTimestamp = new Date().toLocaleTimeString([], {
|
123
|
+
hour: '2-digit',
|
124
|
+
minute: '2-digit',
|
125
|
+
second: '2-digit'
|
126
|
+
});
|
127
|
+
server.notification({
|
128
|
+
method: "notifications/stderr",
|
129
|
+
params: { content: `${shortTimestamp}: A stderr message` },
|
130
|
+
});
|
131
|
+
}, 30000);
|
106
132
|
// Helper method to request sampling from client
|
107
133
|
const requestSampling = async (context, uri, maxTokens = 100) => {
|
108
134
|
const request = {
|
@@ -224,6 +250,17 @@ export const createServer = () => {
|
|
224
250
|
},
|
225
251
|
],
|
226
252
|
},
|
253
|
+
{
|
254
|
+
name: PromptName.RESOURCE,
|
255
|
+
description: "A prompt that includes an embedded resource reference",
|
256
|
+
arguments: [
|
257
|
+
{
|
258
|
+
name: "resourceId",
|
259
|
+
description: "Resource ID to include (1-100)",
|
260
|
+
required: true,
|
261
|
+
},
|
262
|
+
],
|
263
|
+
},
|
227
264
|
],
|
228
265
|
};
|
229
266
|
});
|
@@ -270,6 +307,32 @@ export const createServer = () => {
|
|
270
307
|
],
|
271
308
|
};
|
272
309
|
}
|
310
|
+
if (name === PromptName.RESOURCE) {
|
311
|
+
const resourceId = parseInt(args?.resourceId, 10);
|
312
|
+
if (isNaN(resourceId) || resourceId < 1 || resourceId > 100) {
|
313
|
+
throw new Error(`Invalid resourceId: ${args?.resourceId}. Must be a number between 1 and 100.`);
|
314
|
+
}
|
315
|
+
const resourceIndex = resourceId - 1;
|
316
|
+
const resource = ALL_RESOURCES[resourceIndex];
|
317
|
+
return {
|
318
|
+
messages: [
|
319
|
+
{
|
320
|
+
role: "user",
|
321
|
+
content: {
|
322
|
+
type: "text",
|
323
|
+
text: `This prompt includes Resource ${resourceId}. Please analyze the following resource:`,
|
324
|
+
},
|
325
|
+
},
|
326
|
+
{
|
327
|
+
role: "user",
|
328
|
+
content: {
|
329
|
+
type: "resource",
|
330
|
+
resource: resource,
|
331
|
+
},
|
332
|
+
},
|
333
|
+
],
|
334
|
+
};
|
335
|
+
}
|
273
336
|
throw new Error(`Unknown prompt: ${name}`);
|
274
337
|
});
|
275
338
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
@@ -309,6 +372,11 @@ export const createServer = () => {
|
|
309
372
|
description: "Demonstrates how annotations can be used to provide metadata about content",
|
310
373
|
inputSchema: zodToJsonSchema(AnnotatedMessageSchema),
|
311
374
|
},
|
375
|
+
{
|
376
|
+
name: ToolName.GET_RESOURCE_REFERENCE,
|
377
|
+
description: "Returns a resource reference that can be used by MCP clients",
|
378
|
+
inputSchema: zodToJsonSchema(GetResourceReferenceSchema),
|
379
|
+
},
|
312
380
|
];
|
313
381
|
return { tools };
|
314
382
|
});
|
@@ -374,7 +442,9 @@ export const createServer = () => {
|
|
374
442
|
const { prompt, maxTokens } = validatedArgs;
|
375
443
|
const result = await requestSampling(prompt, ToolName.SAMPLE_LLM, maxTokens);
|
376
444
|
return {
|
377
|
-
content: [
|
445
|
+
content: [
|
446
|
+
{ type: "text", text: `LLM sampling result: ${result.content.text}` },
|
447
|
+
],
|
378
448
|
};
|
379
449
|
}
|
380
450
|
if (name === ToolName.GET_TINY_IMAGE) {
|
@@ -397,6 +467,31 @@ export const createServer = () => {
|
|
397
467
|
],
|
398
468
|
};
|
399
469
|
}
|
470
|
+
if (name === ToolName.GET_RESOURCE_REFERENCE) {
|
471
|
+
const validatedArgs = GetResourceReferenceSchema.parse(args);
|
472
|
+
const resourceId = validatedArgs.resourceId;
|
473
|
+
const resourceIndex = resourceId - 1;
|
474
|
+
if (resourceIndex < 0 || resourceIndex >= ALL_RESOURCES.length) {
|
475
|
+
throw new Error(`Resource with ID ${resourceId} does not exist`);
|
476
|
+
}
|
477
|
+
const resource = ALL_RESOURCES[resourceIndex];
|
478
|
+
return {
|
479
|
+
content: [
|
480
|
+
{
|
481
|
+
type: "text",
|
482
|
+
text: `Returning resource reference for Resource ${resourceId}:`,
|
483
|
+
},
|
484
|
+
{
|
485
|
+
type: "resource",
|
486
|
+
resource: resource,
|
487
|
+
},
|
488
|
+
{
|
489
|
+
type: "text",
|
490
|
+
text: `You can access this resource using the URI: ${resource.uri}`,
|
491
|
+
},
|
492
|
+
],
|
493
|
+
};
|
494
|
+
}
|
400
495
|
if (name === ToolName.ANNOTATED_MESSAGE) {
|
401
496
|
const { messageType, includeImage } = AnnotatedMessageSchema.parse(args);
|
402
497
|
const content = [];
|
@@ -407,8 +502,8 @@ export const createServer = () => {
|
|
407
502
|
text: "Error: Operation failed",
|
408
503
|
annotations: {
|
409
504
|
priority: 1.0, // Errors are highest priority
|
410
|
-
audience: ["user", "assistant"] // Both need to know about errors
|
411
|
-
}
|
505
|
+
audience: ["user", "assistant"], // Both need to know about errors
|
506
|
+
},
|
412
507
|
});
|
413
508
|
}
|
414
509
|
else if (messageType === "success") {
|
@@ -417,8 +512,8 @@ export const createServer = () => {
|
|
417
512
|
text: "Operation completed successfully",
|
418
513
|
annotations: {
|
419
514
|
priority: 0.7, // Success messages are important but not critical
|
420
|
-
audience: ["user"] // Success mainly for user consumption
|
421
|
-
}
|
515
|
+
audience: ["user"], // Success mainly for user consumption
|
516
|
+
},
|
422
517
|
});
|
423
518
|
}
|
424
519
|
else if (messageType === "debug") {
|
@@ -427,8 +522,8 @@ export const createServer = () => {
|
|
427
522
|
text: "Debug: Cache hit ratio 0.95, latency 150ms",
|
428
523
|
annotations: {
|
429
524
|
priority: 0.3, // Debug info is low priority
|
430
|
-
audience: ["assistant"] // Technical details for assistant
|
431
|
-
}
|
525
|
+
audience: ["assistant"], // Technical details for assistant
|
526
|
+
},
|
432
527
|
});
|
433
528
|
}
|
434
529
|
// Optional image with its own annotations
|
@@ -439,8 +534,8 @@ export const createServer = () => {
|
|
439
534
|
mimeType: "image/png",
|
440
535
|
annotations: {
|
441
536
|
priority: 0.5,
|
442
|
-
audience: ["user"] // Images primarily for user visualization
|
443
|
-
}
|
537
|
+
audience: ["user"], // Images primarily for user visualization
|
538
|
+
},
|
444
539
|
});
|
445
540
|
}
|
446
541
|
return { content };
|
@@ -454,7 +549,7 @@ export const createServer = () => {
|
|
454
549
|
if (!resourceId)
|
455
550
|
return { completion: { values: [] } };
|
456
551
|
// Filter resource IDs that start with the input value
|
457
|
-
const values = EXAMPLE_COMPLETIONS.resourceId.filter(id => id.startsWith(argument.value));
|
552
|
+
const values = EXAMPLE_COMPLETIONS.resourceId.filter((id) => id.startsWith(argument.value));
|
458
553
|
return { completion: { values, hasMore: false, total: values.length } };
|
459
554
|
}
|
460
555
|
if (ref.type === "ref/prompt") {
|
@@ -462,7 +557,7 @@ export const createServer = () => {
|
|
462
557
|
const completions = EXAMPLE_COMPLETIONS[argument.name];
|
463
558
|
if (!completions)
|
464
559
|
return { completion: { values: [] } };
|
465
|
-
const values = completions.filter(value => value.startsWith(argument.value));
|
560
|
+
const values = completions.filter((value) => value.startsWith(argument.value));
|
466
561
|
return { completion: { values, hasMore: false, total: values.length } };
|
467
562
|
}
|
468
563
|
throw new Error(`Unknown reference type`);
|
@@ -486,6 +581,8 @@ export const createServer = () => {
|
|
486
581
|
clearInterval(subsUpdateInterval);
|
487
582
|
if (logsUpdateInterval)
|
488
583
|
clearInterval(logsUpdateInterval);
|
584
|
+
if (stdErrUpdateInterval)
|
585
|
+
clearInterval(stdErrUpdateInterval);
|
489
586
|
};
|
490
587
|
return { server, cleanup };
|
491
588
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@modelcontextprotocol/server-everything",
|
3
|
-
"version": "2025.
|
3
|
+
"version": "2025.4.25",
|
4
4
|
"description": "MCP server that exercises all the features of the MCP protocol",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Anthropic, PBC (https://anthropic.com)",
|
@@ -21,7 +21,7 @@
|
|
21
21
|
"start:sse": "node dist/sse.js"
|
22
22
|
},
|
23
23
|
"dependencies": {
|
24
|
-
"@modelcontextprotocol/sdk": "1.0
|
24
|
+
"@modelcontextprotocol/sdk": "^1.9.0",
|
25
25
|
"express": "^4.21.1",
|
26
26
|
"zod": "^3.23.8",
|
27
27
|
"zod-to-json-schema": "^3.23.5"
|