@modelcontextprotocol/server-everything 2025.8.4 → 2025.9.12
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 +31 -10
- package/dist/everything.js +157 -57
- package/dist/sse.js +3 -1
- package/dist/stdio.js +2 -1
- package/dist/streamableHttp.js +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
@@ -89,6 +89,13 @@ This MCP server attempts to exercise all the features of the MCP protocol. It is
|
|
89
89
|
- `structuredContent` field conformant to the output schema
|
90
90
|
- A backward compatible Text Content field, a SHOULD advisory in the specification
|
91
91
|
|
92
|
+
11. `listRoots`
|
93
|
+
- Lists the current MCP roots provided by the client
|
94
|
+
- Demonstrates the roots protocol capability even though this server doesn't access files
|
95
|
+
- No inputs required
|
96
|
+
- Returns: List of current roots with their URIs and names, or a message if no roots are set
|
97
|
+
- Shows how servers can interact with the MCP roots protocol
|
98
|
+
|
92
99
|
### Resources
|
93
100
|
|
94
101
|
The server provides 100 test resources in two formats:
|
@@ -117,7 +124,7 @@ Resource features:
|
|
117
124
|
2. `complex_prompt`
|
118
125
|
- Advanced prompt demonstrating argument handling
|
119
126
|
- Required arguments:
|
120
|
-
- `temperature` (
|
127
|
+
- `temperature` (string): Temperature setting
|
121
128
|
- Optional arguments:
|
122
129
|
- `style` (string): Output style preference
|
123
130
|
- Returns: Multi-turn conversation with images
|
@@ -129,6 +136,18 @@ Resource features:
|
|
129
136
|
- Returns: Multi-turn conversation with an embedded resource reference
|
130
137
|
- Shows how to include resources directly in prompt messages
|
131
138
|
|
139
|
+
### Roots
|
140
|
+
|
141
|
+
The server demonstrates the MCP roots protocol capability:
|
142
|
+
|
143
|
+
- Declares `roots: { listChanged: true }` capability to indicate support for roots
|
144
|
+
- Handles `roots/list_changed` notifications from clients
|
145
|
+
- Requests initial roots during server initialization
|
146
|
+
- Provides a `listRoots` tool to display current roots
|
147
|
+
- Logs roots-related events for demonstration purposes
|
148
|
+
|
149
|
+
Note: This server doesn't actually access files, but demonstrates how servers can interact with the roots protocol for clients that need to understand which directories are available for file operations.
|
150
|
+
|
132
151
|
### Logging
|
133
152
|
|
134
153
|
The server sends random-leveled log messages every 15 seconds, e.g.:
|
@@ -169,22 +188,24 @@ For quick installation, use of of the one-click install buttons below...
|
|
169
188
|
|
170
189
|
[](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)
|
171
190
|
|
172
|
-
For manual installation,
|
191
|
+
For manual installation, you can configure the MCP server using one of these methods:
|
192
|
+
|
193
|
+
**Method 1: User Configuration (Recommended)**
|
194
|
+
Add the configuration to your user-level MCP configuration file. Open the Command Palette (`Ctrl + Shift + P`) and run `MCP: Open User Configuration`. This will open your user `mcp.json` file where you can add the server configuration.
|
173
195
|
|
174
|
-
|
196
|
+
**Method 2: Workspace Configuration**
|
197
|
+
Alternatively, you can add the configuration to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others.
|
175
198
|
|
176
|
-
>
|
199
|
+
> For more details about MCP configuration in VS Code, see the [official VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/mcp).
|
177
200
|
|
178
201
|
#### NPX
|
179
202
|
|
180
203
|
```json
|
181
204
|
{
|
182
|
-
"
|
183
|
-
"
|
184
|
-
"
|
185
|
-
|
186
|
-
"args": ["-y", "@modelcontextprotocol/server-everything"]
|
187
|
-
}
|
205
|
+
"servers": {
|
206
|
+
"everything": {
|
207
|
+
"command": "npx",
|
208
|
+
"args": ["-y", "@modelcontextprotocol/server-everything"]
|
188
209
|
}
|
189
210
|
}
|
190
211
|
}
|
package/dist/everything.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
2
|
-
import { CallToolRequestSchema, CompleteRequestSchema, CreateMessageResultSchema, GetPromptRequestSchema, ListPromptsRequestSchema, ListResourcesRequestSchema, ListResourceTemplatesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema,
|
2
|
+
import { CallToolRequestSchema, CompleteRequestSchema, CreateMessageResultSchema, GetPromptRequestSchema, ListPromptsRequestSchema, ListResourcesRequestSchema, ListResourceTemplatesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, RootsListChangedNotificationSchema, SubscribeRequestSchema, ToolSchema, UnsubscribeRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
3
3
|
import { z } from "zod";
|
4
4
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
5
5
|
import { readFileSync } from "fs";
|
@@ -62,6 +62,7 @@ const GetResourceLinksSchema = z.object({
|
|
62
62
|
.default(3)
|
63
63
|
.describe("Number of resource links to return (1-10)"),
|
64
64
|
});
|
65
|
+
const ListRootsSchema = z.object({});
|
65
66
|
const StructuredContentSchema = {
|
66
67
|
input: z.object({
|
67
68
|
location: z
|
@@ -95,6 +96,7 @@ var ToolName;
|
|
95
96
|
ToolName["ELICITATION"] = "startElicitation";
|
96
97
|
ToolName["GET_RESOURCE_LINKS"] = "getResourceLinks";
|
97
98
|
ToolName["STRUCTURED_CONTENT"] = "structuredContent";
|
99
|
+
ToolName["LIST_ROOTS"] = "listRoots";
|
98
100
|
})(ToolName || (ToolName = {}));
|
99
101
|
var PromptName;
|
100
102
|
(function (PromptName) {
|
@@ -119,49 +121,51 @@ export const createServer = () => {
|
|
119
121
|
resources: { subscribe: true },
|
120
122
|
tools: {},
|
121
123
|
logging: {},
|
122
|
-
completions: {}
|
123
|
-
elicitation: {},
|
124
|
+
completions: {}
|
124
125
|
},
|
125
126
|
instructions
|
126
127
|
});
|
127
128
|
let subscriptions = new Set();
|
128
129
|
let subsUpdateInterval;
|
129
130
|
let stdErrUpdateInterval;
|
130
|
-
// Set up update interval for subscribed resources
|
131
|
-
subsUpdateInterval = setInterval(() => {
|
132
|
-
for (const uri of subscriptions) {
|
133
|
-
server.notification({
|
134
|
-
method: "notifications/resources/updated",
|
135
|
-
params: { uri },
|
136
|
-
});
|
137
|
-
}
|
138
|
-
}, 10000);
|
139
|
-
let logLevel = "debug";
|
140
131
|
let logsUpdateInterval;
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
132
|
+
// Store client capabilities
|
133
|
+
let clientCapabilities;
|
134
|
+
// Roots state management
|
135
|
+
let currentRoots = [];
|
136
|
+
let clientSupportsRoots = false;
|
137
|
+
let sessionId;
|
138
|
+
// Function to start notification intervals when a client connects
|
139
|
+
const startNotificationIntervals = (sid) => {
|
140
|
+
sessionId = sid;
|
141
|
+
if (!subsUpdateInterval) {
|
142
|
+
subsUpdateInterval = setInterval(() => {
|
143
|
+
for (const uri of subscriptions) {
|
144
|
+
server.notification({
|
145
|
+
method: "notifications/resources/updated",
|
146
|
+
params: { uri },
|
147
|
+
});
|
148
|
+
}
|
149
|
+
}, 10000);
|
150
|
+
}
|
151
|
+
const maybeAppendSessionId = sessionId ? ` - SessionId ${sessionId}` : "";
|
152
|
+
const messages = [
|
153
|
+
{ level: "debug", data: `Debug-level message${maybeAppendSessionId}` },
|
154
|
+
{ level: "info", data: `Info-level message${maybeAppendSessionId}` },
|
155
|
+
{ level: "notice", data: `Notice-level message${maybeAppendSessionId}` },
|
156
|
+
{ level: "warning", data: `Warning-level message${maybeAppendSessionId}` },
|
157
|
+
{ level: "error", data: `Error-level message${maybeAppendSessionId}` },
|
158
|
+
{ level: "critical", data: `Critical-level message${maybeAppendSessionId}` },
|
159
|
+
{ level: "alert", data: `Alert level-message${maybeAppendSessionId}` },
|
160
|
+
{ level: "emergency", data: `Emergency-level message${maybeAppendSessionId}` },
|
161
|
+
];
|
162
|
+
if (!logsUpdateInterval) {
|
163
|
+
console.error("Starting logs update interval");
|
164
|
+
logsUpdateInterval = setInterval(async () => {
|
165
|
+
await server.sendLoggingMessage(messages[Math.floor(Math.random() * messages.length)], sessionId);
|
166
|
+
}, 15000);
|
167
|
+
}
|
155
168
|
};
|
156
|
-
// Set up update interval for random log messages
|
157
|
-
logsUpdateInterval = setInterval(() => {
|
158
|
-
let message = {
|
159
|
-
method: "notifications/message",
|
160
|
-
params: messages[Math.floor(Math.random() * messages.length)],
|
161
|
-
};
|
162
|
-
if (!isMessageIgnored(message.params.level))
|
163
|
-
server.notification(message);
|
164
|
-
}, 20000);
|
165
169
|
// Helper method to request sampling from client
|
166
170
|
const requestSampling = async (context, uri, maxTokens = 100) => {
|
167
171
|
const request = {
|
@@ -420,11 +424,6 @@ export const createServer = () => {
|
|
420
424
|
description: "Returns a resource reference that can be used by MCP clients",
|
421
425
|
inputSchema: zodToJsonSchema(GetResourceReferenceSchema),
|
422
426
|
},
|
423
|
-
{
|
424
|
-
name: ToolName.ELICITATION,
|
425
|
-
description: "Demonstrates the Elicitation feature by asking the user to provide information about their favorite color, number, and pets.",
|
426
|
-
inputSchema: zodToJsonSchema(ElicitationSchema),
|
427
|
-
},
|
428
427
|
{
|
429
428
|
name: ToolName.GET_RESOURCE_LINKS,
|
430
429
|
description: "Returns multiple resource links that reference different types of resources",
|
@@ -437,9 +436,21 @@ export const createServer = () => {
|
|
437
436
|
outputSchema: zodToJsonSchema(StructuredContentSchema.output),
|
438
437
|
},
|
439
438
|
];
|
439
|
+
if (clientCapabilities.roots)
|
440
|
+
tools.push({
|
441
|
+
name: ToolName.LIST_ROOTS,
|
442
|
+
description: "Lists the current MCP roots provided by the client. Demonstrates the roots protocol capability even though this server doesn't access files.",
|
443
|
+
inputSchema: zodToJsonSchema(ListRootsSchema),
|
444
|
+
});
|
445
|
+
if (clientCapabilities.elicitation)
|
446
|
+
tools.push({
|
447
|
+
name: ToolName.ELICITATION,
|
448
|
+
description: "Demonstrates the Elicitation feature by asking the user to provide information about their favorite color, number, and pets.",
|
449
|
+
inputSchema: zodToJsonSchema(ElicitationSchema),
|
450
|
+
});
|
440
451
|
return { tools };
|
441
452
|
});
|
442
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
453
|
+
server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
443
454
|
const { name, arguments: args } = request.params;
|
444
455
|
if (name === ToolName.ECHO) {
|
445
456
|
const validatedArgs = EchoSchema.parse(args);
|
@@ -474,7 +485,7 @@ export const createServer = () => {
|
|
474
485
|
total: steps,
|
475
486
|
progressToken,
|
476
487
|
},
|
477
|
-
});
|
488
|
+
}, { relatedRequestId: extra.requestId });
|
478
489
|
}
|
479
490
|
}
|
480
491
|
return {
|
@@ -687,6 +698,47 @@ export const createServer = () => {
|
|
687
698
|
structuredContent: weather
|
688
699
|
};
|
689
700
|
}
|
701
|
+
if (name === ToolName.LIST_ROOTS) {
|
702
|
+
ListRootsSchema.parse(args);
|
703
|
+
if (!clientSupportsRoots) {
|
704
|
+
return {
|
705
|
+
content: [
|
706
|
+
{
|
707
|
+
type: "text",
|
708
|
+
text: "The MCP client does not support the roots protocol.\n\n" +
|
709
|
+
"This means the server cannot access information about the client's workspace directories or file system roots."
|
710
|
+
}
|
711
|
+
]
|
712
|
+
};
|
713
|
+
}
|
714
|
+
if (currentRoots.length === 0) {
|
715
|
+
return {
|
716
|
+
content: [
|
717
|
+
{
|
718
|
+
type: "text",
|
719
|
+
text: "The client supports roots but no roots are currently configured.\n\n" +
|
720
|
+
"This could mean:\n" +
|
721
|
+
"1. The client hasn't provided any roots yet\n" +
|
722
|
+
"2. The client provided an empty roots list\n" +
|
723
|
+
"3. The roots configuration is still being loaded"
|
724
|
+
}
|
725
|
+
]
|
726
|
+
};
|
727
|
+
}
|
728
|
+
const rootsList = currentRoots.map((root, index) => {
|
729
|
+
return `${index + 1}. ${root.name || 'Unnamed Root'}\n URI: ${root.uri}`;
|
730
|
+
}).join('\n\n');
|
731
|
+
return {
|
732
|
+
content: [
|
733
|
+
{
|
734
|
+
type: "text",
|
735
|
+
text: `Current MCP Roots (${currentRoots.length} total):\n\n${rootsList}\n\n` +
|
736
|
+
"Note: This server demonstrates the roots protocol capability but doesn't actually access files. " +
|
737
|
+
"The roots are provided by the MCP client and can be used by servers that need file system access."
|
738
|
+
}
|
739
|
+
]
|
740
|
+
};
|
741
|
+
}
|
690
742
|
throw new Error(`Unknown tool: ${name}`);
|
691
743
|
});
|
692
744
|
server.setRequestHandler(CompleteRequestSchema, async (request) => {
|
@@ -709,20 +761,68 @@ export const createServer = () => {
|
|
709
761
|
}
|
710
762
|
throw new Error(`Unknown reference type`);
|
711
763
|
});
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
764
|
+
// Roots protocol handlers
|
765
|
+
server.setNotificationHandler(RootsListChangedNotificationSchema, async () => {
|
766
|
+
try {
|
767
|
+
// Request the updated roots list from the client
|
768
|
+
const response = await server.listRoots();
|
769
|
+
if (response && 'roots' in response) {
|
770
|
+
currentRoots = response.roots;
|
771
|
+
// Log the roots update for demonstration
|
772
|
+
await server.sendLoggingMessage({
|
773
|
+
level: "info",
|
774
|
+
logger: "everything-server",
|
775
|
+
data: `Roots updated: ${currentRoots.length} root(s) received from client`,
|
776
|
+
}, sessionId);
|
777
|
+
}
|
778
|
+
}
|
779
|
+
catch (error) {
|
780
|
+
await server.sendLoggingMessage({
|
781
|
+
level: "error",
|
782
|
+
logger: "everything-server",
|
783
|
+
data: `Failed to request roots from client: ${error instanceof Error ? error.message : String(error)}`,
|
784
|
+
}, sessionId);
|
785
|
+
}
|
725
786
|
});
|
787
|
+
// Handle post-initialization setup for roots
|
788
|
+
server.oninitialized = async () => {
|
789
|
+
clientCapabilities = server.getClientCapabilities();
|
790
|
+
if (clientCapabilities?.roots) {
|
791
|
+
clientSupportsRoots = true;
|
792
|
+
try {
|
793
|
+
const response = await server.listRoots();
|
794
|
+
if (response && 'roots' in response) {
|
795
|
+
currentRoots = response.roots;
|
796
|
+
await server.sendLoggingMessage({
|
797
|
+
level: "info",
|
798
|
+
logger: "everything-server",
|
799
|
+
data: `Initial roots received: ${currentRoots.length} root(s) from client`,
|
800
|
+
}, sessionId);
|
801
|
+
}
|
802
|
+
else {
|
803
|
+
await server.sendLoggingMessage({
|
804
|
+
level: "warning",
|
805
|
+
logger: "everything-server",
|
806
|
+
data: "Client returned no roots set",
|
807
|
+
}, sessionId);
|
808
|
+
}
|
809
|
+
}
|
810
|
+
catch (error) {
|
811
|
+
await server.sendLoggingMessage({
|
812
|
+
level: "error",
|
813
|
+
logger: "everything-server",
|
814
|
+
data: `Failed to request initial roots from client: ${error instanceof Error ? error.message : String(error)}`,
|
815
|
+
}, sessionId);
|
816
|
+
}
|
817
|
+
}
|
818
|
+
else {
|
819
|
+
await server.sendLoggingMessage({
|
820
|
+
level: "info",
|
821
|
+
logger: "everything-server",
|
822
|
+
data: "Client does not support MCP roots protocol",
|
823
|
+
}, sessionId);
|
824
|
+
}
|
825
|
+
};
|
726
826
|
const cleanup = async () => {
|
727
827
|
if (subsUpdateInterval)
|
728
828
|
clearInterval(subsUpdateInterval);
|
@@ -731,6 +831,6 @@ export const createServer = () => {
|
|
731
831
|
if (stdErrUpdateInterval)
|
732
832
|
clearInterval(stdErrUpdateInterval);
|
733
833
|
};
|
734
|
-
return { server, cleanup };
|
834
|
+
return { server, cleanup, startNotificationIntervals };
|
735
835
|
};
|
736
836
|
const MCP_TINY_IMAGE = "iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAKsGlDQ1BJQ0MgUHJvZmlsZQAASImVlwdUU+kSgOfe9JDQEiIgJfQmSCeAlBBaAAXpYCMkAUKJMRBU7MriClZURLCs6KqIgo0idizYFsWC3QVZBNR1s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Vbml0PgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KReh49gAAAjRJREFUOBGFlD2vMUEUx2clvoNCcW8hCqFAo1dKhEQpvsF9KrWEBh/ALbQ0KkInBI3SWyGPCCJEQliXgsTLefaca/bBWjvJzs6cOf/fnDkzOQJIjWm06/XKBEGgD8c6nU5VIWgBtQDPZPWtJE8O63a7LBgMMo/Hw0ql0jPjcY4RvmqXy4XMjUYDUwLtdhtmsxnYbDbI5/O0djqdFFKmsEiGZ9jP9gem0yn0ej2Yz+fg9XpfycimAD7DttstQTDKfr8Po9GIIg6Hw1Cr1RTgB+A72GAwgMPhQLBMJgNSXsFqtUI2myUo18pA6QJogefsPrLBX4QdCVatViklw+EQRFGEj88P2O12pEUGATmsXq+TaLPZ0AXgMRF2vMEqlQoJTSYTpNNpApvNZliv1/+BHDaZTAi2Wq1A3Ig0xmMej7+RcZjdbodUKkWAaDQK+GHjHPnImB88JrZIJAKFQgH2+z2BOczhcMiwRCIBgUAA+NN5BP6mj2DYff35gk6nA61WCzBn2JxO5wPM7/fLz4vD0E+OECfn8xl/0Gw2KbLxeAyLxQIsFgt8p75pDSO7h/HbpUWpewCike9WLpfB7XaDy+WCYrFI/slk8i0MnRRAUt46hPMI4vE4+Hw+ec7t9/44VgWigEeby+UgFArJWjUYOqhWG6x50rpcSfR6PVUfNOgEVRlTX0HhrZBKz4MZjUYWi8VoA+lc9H/VaRZYjBKrtXR8tlwumcFgeMWRbZpA9ORQWfVm8A/FsrLaxebd5wAAAABJRU5ErkJggg==";
|
package/dist/sse.js
CHANGED
@@ -6,7 +6,7 @@ const app = express();
|
|
6
6
|
const transports = new Map();
|
7
7
|
app.get("/sse", async (req, res) => {
|
8
8
|
let transport;
|
9
|
-
const { server, cleanup } = createServer();
|
9
|
+
const { server, cleanup, startNotificationIntervals } = createServer();
|
10
10
|
if (req?.query?.sessionId) {
|
11
11
|
const sessionId = req?.query?.sessionId;
|
12
12
|
transport = transports.get(sessionId);
|
@@ -19,6 +19,8 @@ app.get("/sse", async (req, res) => {
|
|
19
19
|
// Connect server to transport
|
20
20
|
await server.connect(transport);
|
21
21
|
console.error("Client Connected: ", transport.sessionId);
|
22
|
+
// Start notification intervals after client connects
|
23
|
+
startNotificationIntervals(transport.sessionId);
|
22
24
|
// Handle close of connection
|
23
25
|
server.onclose = async () => {
|
24
26
|
console.error("Client Disconnected: ", transport.sessionId);
|
package/dist/stdio.js
CHANGED
@@ -4,8 +4,9 @@ import { createServer } from "./everything.js";
|
|
4
4
|
console.error('Starting default (STDIO) server...');
|
5
5
|
async function main() {
|
6
6
|
const transport = new StdioServerTransport();
|
7
|
-
const { server, cleanup } = createServer();
|
7
|
+
const { server, cleanup, startNotificationIntervals } = createServer();
|
8
8
|
await server.connect(transport);
|
9
|
+
startNotificationIntervals();
|
9
10
|
// Cleanup on exit
|
10
11
|
process.on("SIGINT", async () => {
|
11
12
|
await cleanup();
|
package/dist/streamableHttp.js
CHANGED
@@ -17,7 +17,7 @@ app.post('/mcp', async (req, res) => {
|
|
17
17
|
transport = transports.get(sessionId);
|
18
18
|
}
|
19
19
|
else if (!sessionId) {
|
20
|
-
const { server, cleanup } = createServer();
|
20
|
+
const { server, cleanup, startNotificationIntervals } = createServer();
|
21
21
|
// New initialization request
|
22
22
|
const eventStore = new InMemoryEventStore();
|
23
23
|
transport = new StreamableHTTPServerTransport({
|
@@ -43,6 +43,8 @@ app.post('/mcp', async (req, res) => {
|
|
43
43
|
// so responses can flow back through the same transport
|
44
44
|
await server.connect(transport);
|
45
45
|
await transport.handleRequest(req, res);
|
46
|
+
// Wait until initialize is complete and transport will have a sessionId
|
47
|
+
startNotificationIntervals(transport.sessionId);
|
46
48
|
return; // Already handled
|
47
49
|
}
|
48
50
|
else {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@modelcontextprotocol/server-everything",
|
3
|
-
"version": "2025.
|
3
|
+
"version": "2025.9.12",
|
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)",
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"start:streamableHttp": "node dist/streamableHttp.js"
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
|
-
"@modelcontextprotocol/sdk": "^1.
|
25
|
+
"@modelcontextprotocol/sdk": "^1.18.0",
|
26
26
|
"express": "^4.21.1",
|
27
27
|
"zod": "^3.23.8",
|
28
28
|
"zod-to-json-schema": "^3.23.5"
|