mcp-use 1.3.3-canary.1 → 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,8 +1750,12 @@ if (container && Component) {
|
|
|
1731
1750
|
});
|
|
1732
1751
|
}
|
|
1733
1752
|
await this.server.connect(transport);
|
|
1734
|
-
await
|
|
1735
|
-
|
|
1753
|
+
await this.waitForRequestComplete(
|
|
1754
|
+
transport,
|
|
1755
|
+
expressReq,
|
|
1756
|
+
expressRes,
|
|
1757
|
+
expressReq.body
|
|
1758
|
+
);
|
|
1736
1759
|
const response = getResponse();
|
|
1737
1760
|
if (response) {
|
|
1738
1761
|
return response;
|
|
@@ -1749,8 +1772,7 @@ if (container && Component) {
|
|
|
1749
1772
|
transport.close();
|
|
1750
1773
|
});
|
|
1751
1774
|
await this.server.connect(transport);
|
|
1752
|
-
await
|
|
1753
|
-
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
1775
|
+
await this.waitForRequestComplete(transport, expressReq, expressRes);
|
|
1754
1776
|
const response = getResponse();
|
|
1755
1777
|
if (response) {
|
|
1756
1778
|
return response;
|
|
@@ -1767,8 +1789,7 @@ if (container && Component) {
|
|
|
1767
1789
|
transport.close();
|
|
1768
1790
|
});
|
|
1769
1791
|
await this.server.connect(transport);
|
|
1770
|
-
await
|
|
1771
|
-
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
1792
|
+
await this.waitForRequestComplete(transport, expressReq, expressRes);
|
|
1772
1793
|
const response = getResponse();
|
|
1773
1794
|
if (response) {
|
|
1774
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,8 +1712,12 @@ if (container && Component) {
|
|
|
1693
1712
|
});
|
|
1694
1713
|
}
|
|
1695
1714
|
await this.server.connect(transport);
|
|
1696
|
-
await
|
|
1697
|
-
|
|
1715
|
+
await this.waitForRequestComplete(
|
|
1716
|
+
transport,
|
|
1717
|
+
expressReq,
|
|
1718
|
+
expressRes,
|
|
1719
|
+
expressReq.body
|
|
1720
|
+
);
|
|
1698
1721
|
const response = getResponse();
|
|
1699
1722
|
if (response) {
|
|
1700
1723
|
return response;
|
|
@@ -1711,8 +1734,7 @@ if (container && Component) {
|
|
|
1711
1734
|
transport.close();
|
|
1712
1735
|
});
|
|
1713
1736
|
await this.server.connect(transport);
|
|
1714
|
-
await
|
|
1715
|
-
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
1737
|
+
await this.waitForRequestComplete(transport, expressReq, expressRes);
|
|
1716
1738
|
const response = getResponse();
|
|
1717
1739
|
if (response) {
|
|
1718
1740
|
return response;
|
|
@@ -1729,8 +1751,7 @@ if (container && Component) {
|
|
|
1729
1751
|
transport.close();
|
|
1730
1752
|
});
|
|
1731
1753
|
await this.server.connect(transport);
|
|
1732
|
-
await
|
|
1733
|
-
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
1754
|
+
await this.waitForRequestComplete(transport, expressReq, expressRes);
|
|
1734
1755
|
const response = getResponse();
|
|
1735
1756
|
if (response) {
|
|
1736
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
|
*
|
|
@@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AAC,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",
|