mcp-use 1.3.3-canary.2 → 1.3.3-canary.3
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.
|
@@ -1583,6 +1583,25 @@ if (container && Component) {
|
|
|
1583
1583
|
);
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
|
+
/**
|
|
1587
|
+
* Helper to wait for transport.handleRequest to complete and response to be written
|
|
1588
|
+
*
|
|
1589
|
+
* Wraps the transport.handleRequest call in a Promise that only resolves when
|
|
1590
|
+
* expressRes.end() is called, ensuring all async operations complete before
|
|
1591
|
+
* we attempt to read the response.
|
|
1592
|
+
*
|
|
1593
|
+
* @private
|
|
1594
|
+
*/
|
|
1595
|
+
waitForRequestComplete(transport, expressReq, expressRes, body) {
|
|
1596
|
+
return new Promise((resolve) => {
|
|
1597
|
+
const originalEnd = expressRes.end;
|
|
1598
|
+
expressRes.end = (...args) => {
|
|
1599
|
+
originalEnd.apply(expressRes, args);
|
|
1600
|
+
resolve();
|
|
1601
|
+
};
|
|
1602
|
+
transport.handleRequest(expressReq, expressRes, body);
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1586
1605
|
/**
|
|
1587
1606
|
* Mount MCP server endpoints at /mcp
|
|
1588
1607
|
*
|
|
@@ -1731,14 +1750,12 @@ if (container && Component) {
|
|
|
1731
1750
|
});
|
|
1732
1751
|
}
|
|
1733
1752
|
await this.server.connect(transport);
|
|
1734
|
-
await
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
transport.handleRequest(expressReq, expressRes, expressReq.body);
|
|
1741
|
-
});
|
|
1753
|
+
await this.waitForRequestComplete(
|
|
1754
|
+
transport,
|
|
1755
|
+
expressReq,
|
|
1756
|
+
expressRes,
|
|
1757
|
+
expressReq.body
|
|
1758
|
+
);
|
|
1742
1759
|
const response = getResponse();
|
|
1743
1760
|
if (response) {
|
|
1744
1761
|
return response;
|
|
@@ -1755,7 +1772,7 @@ if (container && Component) {
|
|
|
1755
1772
|
transport.close();
|
|
1756
1773
|
});
|
|
1757
1774
|
await this.server.connect(transport);
|
|
1758
|
-
await
|
|
1775
|
+
await this.waitForRequestComplete(transport, expressReq, expressRes);
|
|
1759
1776
|
const response = getResponse();
|
|
1760
1777
|
if (response) {
|
|
1761
1778
|
return response;
|
|
@@ -1772,7 +1789,7 @@ if (container && Component) {
|
|
|
1772
1789
|
transport.close();
|
|
1773
1790
|
});
|
|
1774
1791
|
await this.server.connect(transport);
|
|
1775
|
-
await
|
|
1792
|
+
await this.waitForRequestComplete(transport, expressReq, expressRes);
|
|
1776
1793
|
const response = getResponse();
|
|
1777
1794
|
if (response) {
|
|
1778
1795
|
return response;
|
package/dist/src/server/index.js
CHANGED
|
@@ -1545,6 +1545,25 @@ if (container && Component) {
|
|
|
1545
1545
|
);
|
|
1546
1546
|
}
|
|
1547
1547
|
}
|
|
1548
|
+
/**
|
|
1549
|
+
* Helper to wait for transport.handleRequest to complete and response to be written
|
|
1550
|
+
*
|
|
1551
|
+
* Wraps the transport.handleRequest call in a Promise that only resolves when
|
|
1552
|
+
* expressRes.end() is called, ensuring all async operations complete before
|
|
1553
|
+
* we attempt to read the response.
|
|
1554
|
+
*
|
|
1555
|
+
* @private
|
|
1556
|
+
*/
|
|
1557
|
+
waitForRequestComplete(transport, expressReq, expressRes, body) {
|
|
1558
|
+
return new Promise((resolve) => {
|
|
1559
|
+
const originalEnd = expressRes.end;
|
|
1560
|
+
expressRes.end = (...args) => {
|
|
1561
|
+
originalEnd.apply(expressRes, args);
|
|
1562
|
+
resolve();
|
|
1563
|
+
};
|
|
1564
|
+
transport.handleRequest(expressReq, expressRes, body);
|
|
1565
|
+
});
|
|
1566
|
+
}
|
|
1548
1567
|
/**
|
|
1549
1568
|
* Mount MCP server endpoints at /mcp
|
|
1550
1569
|
*
|
|
@@ -1693,14 +1712,12 @@ if (container && Component) {
|
|
|
1693
1712
|
});
|
|
1694
1713
|
}
|
|
1695
1714
|
await this.server.connect(transport);
|
|
1696
|
-
await
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
transport.handleRequest(expressReq, expressRes, expressReq.body);
|
|
1703
|
-
});
|
|
1715
|
+
await this.waitForRequestComplete(
|
|
1716
|
+
transport,
|
|
1717
|
+
expressReq,
|
|
1718
|
+
expressRes,
|
|
1719
|
+
expressReq.body
|
|
1720
|
+
);
|
|
1704
1721
|
const response = getResponse();
|
|
1705
1722
|
if (response) {
|
|
1706
1723
|
return response;
|
|
@@ -1717,7 +1734,7 @@ if (container && Component) {
|
|
|
1717
1734
|
transport.close();
|
|
1718
1735
|
});
|
|
1719
1736
|
await this.server.connect(transport);
|
|
1720
|
-
await
|
|
1737
|
+
await this.waitForRequestComplete(transport, expressReq, expressRes);
|
|
1721
1738
|
const response = getResponse();
|
|
1722
1739
|
if (response) {
|
|
1723
1740
|
return response;
|
|
@@ -1734,7 +1751,7 @@ if (container && Component) {
|
|
|
1734
1751
|
transport.close();
|
|
1735
1752
|
});
|
|
1736
1753
|
await this.server.connect(transport);
|
|
1737
|
-
await
|
|
1754
|
+
await this.waitForRequestComplete(transport, expressReq, expressRes);
|
|
1738
1755
|
const response = getResponse();
|
|
1739
1756
|
if (response) {
|
|
1740
1757
|
return response;
|
|
@@ -347,6 +347,16 @@ export declare class McpServer {
|
|
|
347
347
|
* @returns Promise that resolves when all widgets are mounted
|
|
348
348
|
*/
|
|
349
349
|
private mountWidgetsProduction;
|
|
350
|
+
/**
|
|
351
|
+
* Helper to wait for transport.handleRequest to complete and response to be written
|
|
352
|
+
*
|
|
353
|
+
* Wraps the transport.handleRequest call in a Promise that only resolves when
|
|
354
|
+
* expressRes.end() is called, ensuring all async operations complete before
|
|
355
|
+
* we attempt to read the response.
|
|
356
|
+
*
|
|
357
|
+
* @private
|
|
358
|
+
*/
|
|
359
|
+
private waitForRequestComplete;
|
|
350
360
|
/**
|
|
351
361
|
* Mount MCP server endpoints at /mcp
|
|
352
362
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../../src/server/mcp-server.ts"],"names":[],"mappings":"AAKA,OAAO,EAAsB,KAAK,IAAI,IAAI,QAAQ,EAAa,MAAM,MAAM,CAAC;AAY5E,OAAO,KAAK,EAEV,gBAAgB,EAChB,kBAAkB,EAClB,0BAA0B,EAC1B,YAAY,EACZ,cAAc,EAEd,oBAAoB,EAErB,MAAM,kBAAkB,CAAC;AA4G1B,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,GAAG,CAAW;IACtB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,UAAU,CAAC,CAAS;IAC5B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,eAAe,CAAgB;IACvC,OAAO,CAAC,iBAAiB,CAAgB;IACzC,OAAO,CAAC,mBAAmB,CAAgB;IAE3C;;;;;;;;;OASG;gBACS,MAAM,EAAE,YAAY;IAsGhC;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAcxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,IAAI;IAoBtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,gBAAgB,CACd,0BAA0B,EAAE,0BAA0B,GACrD,IAAI;IAkDP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,IAAI,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI;IAoB1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,MAAM,CAAC,gBAAgB,EAAE,g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KAAK,OAAO,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;CACpD,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,GACjC,iBAAiB,CASnB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-use",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.3-canary.
|
|
4
|
+
"version": "1.3.3-canary.3",
|
|
5
5
|
"description": "Opinionated MCP Framework for TypeScript (@modelcontextprotocol/sdk compatible) - Build MCP Agents and Clients + MCP Servers with support for MCP-UI.",
|
|
6
6
|
"author": "mcp-use, Inc.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -107,8 +107,8 @@
|
|
|
107
107
|
"ws": "^8.18.2",
|
|
108
108
|
"zod": "^3.25.48",
|
|
109
109
|
"zod-to-json-schema": "^3.24.6",
|
|
110
|
-
"@mcp-use/cli": "2.2.3-canary.
|
|
111
|
-
"@mcp-use/inspector": "0.5.3-canary.
|
|
110
|
+
"@mcp-use/cli": "2.2.3-canary.3",
|
|
111
|
+
"@mcp-use/inspector": "0.5.3-canary.3"
|
|
112
112
|
},
|
|
113
113
|
"optionalDependencies": {
|
|
114
114
|
"@tailwindcss/vite": "^4.1.15",
|