@modelcontextprotocol/server-everything 2026.8.18 → 2026.8.31

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.
@@ -65,10 +65,9 @@ export const setSubscriptionHandlers = (server) => {
65
65
  /**
66
66
  * Sends simulated resource update notifications to the subscribed client.
67
67
  *
68
- * This function iterates through all resource URIs stored in the subscriptions
69
- * and checks if the specified session ID is subscribed to them. If so, it sends
70
- * a notification through the provided server. If the session ID is no longer valid
71
- * (disconnected), it removes the session ID from the list of subscribers.
68
+ * Iterates the URIs in `subscriptions` and emits a
69
+ * `notifications/resources/updated` notification for each URI the given
70
+ * sessionId is subscribed to.
72
71
  *
73
72
  * @param {McpServer} server - The server instance used to send notifications.
74
73
  * @param {string | undefined} sessionId - The session ID of the client to check for subscriptions.
@@ -85,9 +84,6 @@ const sendSimulatedResourceUpdates = async (server, sessionId) => {
85
84
  params: { uri },
86
85
  });
87
86
  }
88
- else {
89
- subscribers.delete(sessionId); // subscriber has disconnected
90
- }
91
87
  }
92
88
  };
93
89
  /**
@@ -101,31 +101,26 @@ export const textResourceUri = (resourceId) => new URL(`${textUriBase}/${resourc
101
101
  */
102
102
  export const blobResourceUri = (resourceId) => new URL(`${blobUriBase}/${resourceId}`);
103
103
  /**
104
- * Parses the resource identifier from the provided URI and validates it
105
- * against the given variables. Throws an error if the URI corresponds
106
- * to an unknown resource or if the resource identifier is invalid.
104
+ * Parses the resource identifier from the provided variables and validates
105
+ * that it is a positive integer.
107
106
  *
108
- * @param {URL} uri - The URI of the resource to be parsed.
109
- * @param {Record<string, unknown>} variables - A record containing context-specific variables that include the resourceId.
110
- * @returns {number} The parsed and validated resource identifier as an integer.
111
- * @throws {Error} Throws an error if the URI matches unsupported base URIs or if the resourceId is invalid.
107
+ * The SDK only routes URIs that match the registered template to the
108
+ * resource handler, so by the time we get here the URI prefix is already
109
+ * known to be one of `textUriBase` / `blobUriBase`. Only the resourceId
110
+ * variable still needs validating.
111
+ *
112
+ * @param {URL} uri - The URI of the resource (used in the error message).
113
+ * @param {Record<string, unknown>} variables - Context variables including resourceId.
114
+ * @returns {number} The parsed and validated resource identifier as a positive integer.
115
+ * @throws {Error} If the resourceId is not a finite positive integer.
112
116
  */
113
117
  const parseResourceId = (uri, variables) => {
114
- const uriError = `Unknown resource: ${uri.toString()}`;
115
- if (uri.toString().startsWith(textUriBase) &&
116
- uri.toString().startsWith(blobUriBase)) {
117
- throw new Error(uriError);
118
- }
119
- else {
120
- const idxStr = String(variables.resourceId ?? "");
121
- const idx = Number(idxStr);
122
- if (Number.isFinite(idx) && Number.isInteger(idx) && idx > 0) {
123
- return idx;
124
- }
125
- else {
126
- throw new Error(uriError);
127
- }
118
+ const idxStr = String(variables.resourceId ?? "");
119
+ const idx = Number(idxStr);
120
+ if (Number.isFinite(idx) && Number.isInteger(idx) && idx > 0) {
121
+ return idx;
128
122
  }
123
+ throw new Error(`Unknown resource: ${uri.toString()}`);
129
124
  };
130
125
  /**
131
126
  * Register resource templates with the MCP server.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modelcontextprotocol/server-everything",
3
- "version": "2026.8.18",
3
+ "version": "2026.8.31",
4
4
  "description": "MCP server that exercises all the features of the MCP protocol",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "mcpName": "io.github.modelcontextprotocol/server-everything",