New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@modelcontextprotocol/sdk

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@modelcontextprotocol/sdk - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

dist/server/sse.d.ts

@@ -32,3 +32,3 @@ import { IncomingMessage, ServerResponse } from "node:http";

*/
handlePostMessage(req: IncomingMessage, res: ServerResponse): Promise<void>;
handlePostMessage(req: IncomingMessage, res: ServerResponse, parsedBody?: unknown): Promise<void>;
/**

@@ -35,0 +35,0 @@ * Handle a client message, regardless of how it arrived. This can be used to inform the server of messages that arrive via a means different than HTTP POST.

@@ -48,3 +48,3 @@ import { randomUUID } from "node:crypto";

*/
async handlePostMessage(req, res) {
async handlePostMessage(req, res, parsedBody) {
var _a, _b, _c;

@@ -62,3 +62,3 @@ if (!this._sseResponse) {

}
body = await getRawBody(req, {
body = parsedBody !== null && parsedBody !== void 0 ? parsedBody : await getRawBody(req, {
limit: MAXIMUM_MESSAGE_SIZE,

@@ -74,3 +74,3 @@ encoding: (_b = ct.parameters.charset) !== null && _b !== void 0 ? _b : "utf-8",

try {
await this.handleMessage(JSON.parse(body));
await this.handleMessage(typeof body === 'string' ? JSON.parse(body) : body);
}

@@ -77,0 +77,0 @@ catch (_d) {

@@ -135,3 +135,3 @@ import { CancelledNotificationSchema, ErrorCode, McpError, PingRequestSchema, ProgressNotificationSchema, } from "../types.js";

_onprogress(notification) {
const { progress, total, progressToken } = notification.params;
const { progressToken, ...params } = notification.params;
const handler = this._progressHandlers.get(Number(progressToken));

@@ -142,3 +142,3 @@ if (handler === undefined) {

}
handler({ progress, total });
handler(params);
}

@@ -145,0 +145,0 @@ _onresponse(response) {

{
"name": "@modelcontextprotocol/sdk",
"version": "1.0.3",
"version": "1.0.4",
"description": "Model Context Protocol implementation for TypeScript",

@@ -5,0 +5,0 @@ "license": "MIT",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc