mcp-use 1.2.5-canary.7 → 1.2.5-canary.8
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/dist/.tsbuildinfo +1 -1
- package/dist/index.js +15 -15
- package/dist/src/browser.js +7 -7
- package/dist/src/server/index.cjs +29 -3
- package/dist/src/server/index.js +29 -3
- package/dist/src/server/mcp-server.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,6 +3,21 @@ import {
|
|
|
3
3
|
streamEventsToAISDK,
|
|
4
4
|
streamEventsToAISDKWithTools
|
|
5
5
|
} from "./chunk-EW4MJSHA.js";
|
|
6
|
+
import {
|
|
7
|
+
AcquireActiveMCPServerTool,
|
|
8
|
+
AddMCPServerFromConfigTool,
|
|
9
|
+
BaseAdapter,
|
|
10
|
+
ConnectMCPServerTool,
|
|
11
|
+
LangChainAdapter,
|
|
12
|
+
ListMCPServersTool,
|
|
13
|
+
MCPAgent,
|
|
14
|
+
ObservabilityManager,
|
|
15
|
+
ReleaseMCPServerConnectionTool,
|
|
16
|
+
RemoteAgent,
|
|
17
|
+
ServerManager,
|
|
18
|
+
Telemetry,
|
|
19
|
+
setTelemetrySource
|
|
20
|
+
} from "./chunk-73SH52J2.js";
|
|
6
21
|
import {
|
|
7
22
|
useMcp,
|
|
8
23
|
useWidget,
|
|
@@ -20,21 +35,6 @@ import {
|
|
|
20
35
|
WebSocketConnector,
|
|
21
36
|
onMcpAuthorization
|
|
22
37
|
} from "./chunk-37MPZ3D6.js";
|
|
23
|
-
import {
|
|
24
|
-
AcquireActiveMCPServerTool,
|
|
25
|
-
AddMCPServerFromConfigTool,
|
|
26
|
-
BaseAdapter,
|
|
27
|
-
ConnectMCPServerTool,
|
|
28
|
-
LangChainAdapter,
|
|
29
|
-
ListMCPServersTool,
|
|
30
|
-
MCPAgent,
|
|
31
|
-
ObservabilityManager,
|
|
32
|
-
ReleaseMCPServerConnectionTool,
|
|
33
|
-
RemoteAgent,
|
|
34
|
-
ServerManager,
|
|
35
|
-
Telemetry,
|
|
36
|
-
setTelemetrySource
|
|
37
|
-
} from "./chunk-73SH52J2.js";
|
|
38
38
|
import "./chunk-YURRUCIM.js";
|
|
39
39
|
import {
|
|
40
40
|
Logger,
|
package/dist/src/browser.js
CHANGED
|
@@ -3,6 +3,13 @@ import {
|
|
|
3
3
|
streamEventsToAISDK,
|
|
4
4
|
streamEventsToAISDKWithTools
|
|
5
5
|
} from "../chunk-EW4MJSHA.js";
|
|
6
|
+
import {
|
|
7
|
+
BaseAdapter,
|
|
8
|
+
LangChainAdapter,
|
|
9
|
+
MCPAgent,
|
|
10
|
+
ObservabilityManager,
|
|
11
|
+
RemoteAgent
|
|
12
|
+
} from "../chunk-73SH52J2.js";
|
|
6
13
|
import {
|
|
7
14
|
BaseConnector,
|
|
8
15
|
BrowserMCPClient,
|
|
@@ -12,13 +19,6 @@ import {
|
|
|
12
19
|
WebSocketConnector,
|
|
13
20
|
onMcpAuthorization
|
|
14
21
|
} from "../chunk-37MPZ3D6.js";
|
|
15
|
-
import {
|
|
16
|
-
BaseAdapter,
|
|
17
|
-
LangChainAdapter,
|
|
18
|
-
MCPAgent,
|
|
19
|
-
ObservabilityManager,
|
|
20
|
-
RemoteAgent
|
|
21
|
-
} from "../chunk-73SH52J2.js";
|
|
22
22
|
import "../chunk-YURRUCIM.js";
|
|
23
23
|
import {
|
|
24
24
|
Logger,
|
|
@@ -1783,13 +1783,35 @@ if (container && Component) {
|
|
|
1783
1783
|
"Access-Control-Allow-Origin": "*",
|
|
1784
1784
|
"Access-Control-Allow-Headers": "authorization, x-client-info, apikey, content-type"
|
|
1785
1785
|
};
|
|
1786
|
-
const handler = await this.getHandler({ provider: "supabase" });
|
|
1787
1786
|
globalThis.Deno.serve(
|
|
1787
|
+
{ port: this.serverPort, hostname: this.serverHost },
|
|
1788
1788
|
async (req) => {
|
|
1789
1789
|
if (req.method === "OPTIONS") {
|
|
1790
1790
|
return new Response("ok", { headers: corsHeaders });
|
|
1791
1791
|
}
|
|
1792
|
-
const
|
|
1792
|
+
const url = new URL(req.url);
|
|
1793
|
+
const pathname = url.pathname;
|
|
1794
|
+
let newPathname = pathname;
|
|
1795
|
+
const functionsMatch = pathname.match(/^\/functions\/v1\/[^/]+(\/.*)?$/);
|
|
1796
|
+
if (functionsMatch) {
|
|
1797
|
+
newPathname = functionsMatch[1] || "/";
|
|
1798
|
+
} else {
|
|
1799
|
+
const functionNameMatch = pathname.match(/^\/([^/]+)(\/.*)?$/);
|
|
1800
|
+
if (functionNameMatch && functionNameMatch[2]) {
|
|
1801
|
+
newPathname = functionNameMatch[2] || "/";
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
let finalReq = req;
|
|
1805
|
+
if (newPathname !== pathname) {
|
|
1806
|
+
const newUrl = new URL(newPathname + url.search, url.origin);
|
|
1807
|
+
finalReq = new Request(newUrl, {
|
|
1808
|
+
method: req.method,
|
|
1809
|
+
headers: req.headers,
|
|
1810
|
+
body: req.body,
|
|
1811
|
+
redirect: req.redirect
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
const response = await this.app.fetch(finalReq);
|
|
1793
1815
|
const newHeaders = new Headers(response.headers);
|
|
1794
1816
|
Object.entries(corsHeaders).forEach(([key, value]) => {
|
|
1795
1817
|
newHeaders.set(key, value);
|
|
@@ -1802,8 +1824,12 @@ if (container && Component) {
|
|
|
1802
1824
|
}
|
|
1803
1825
|
);
|
|
1804
1826
|
console.log(
|
|
1805
|
-
`[SERVER] Listening`
|
|
1827
|
+
`[SERVER] Listening on http://${this.serverHost}:${this.serverPort}`
|
|
1828
|
+
);
|
|
1829
|
+
console.log(
|
|
1830
|
+
`[MCP] Endpoints: http://${this.serverHost}:${this.serverPort}/mcp`
|
|
1806
1831
|
);
|
|
1832
|
+
} else {
|
|
1807
1833
|
const { serve } = await import("@hono/node-server");
|
|
1808
1834
|
serve(
|
|
1809
1835
|
{
|
package/dist/src/server/index.js
CHANGED
|
@@ -1745,13 +1745,35 @@ if (container && Component) {
|
|
|
1745
1745
|
"Access-Control-Allow-Origin": "*",
|
|
1746
1746
|
"Access-Control-Allow-Headers": "authorization, x-client-info, apikey, content-type"
|
|
1747
1747
|
};
|
|
1748
|
-
const handler = await this.getHandler({ provider: "supabase" });
|
|
1749
1748
|
globalThis.Deno.serve(
|
|
1749
|
+
{ port: this.serverPort, hostname: this.serverHost },
|
|
1750
1750
|
async (req) => {
|
|
1751
1751
|
if (req.method === "OPTIONS") {
|
|
1752
1752
|
return new Response("ok", { headers: corsHeaders });
|
|
1753
1753
|
}
|
|
1754
|
-
const
|
|
1754
|
+
const url = new URL(req.url);
|
|
1755
|
+
const pathname = url.pathname;
|
|
1756
|
+
let newPathname = pathname;
|
|
1757
|
+
const functionsMatch = pathname.match(/^\/functions\/v1\/[^/]+(\/.*)?$/);
|
|
1758
|
+
if (functionsMatch) {
|
|
1759
|
+
newPathname = functionsMatch[1] || "/";
|
|
1760
|
+
} else {
|
|
1761
|
+
const functionNameMatch = pathname.match(/^\/([^/]+)(\/.*)?$/);
|
|
1762
|
+
if (functionNameMatch && functionNameMatch[2]) {
|
|
1763
|
+
newPathname = functionNameMatch[2] || "/";
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
let finalReq = req;
|
|
1767
|
+
if (newPathname !== pathname) {
|
|
1768
|
+
const newUrl = new URL(newPathname + url.search, url.origin);
|
|
1769
|
+
finalReq = new Request(newUrl, {
|
|
1770
|
+
method: req.method,
|
|
1771
|
+
headers: req.headers,
|
|
1772
|
+
body: req.body,
|
|
1773
|
+
redirect: req.redirect
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
const response = await this.app.fetch(finalReq);
|
|
1755
1777
|
const newHeaders = new Headers(response.headers);
|
|
1756
1778
|
Object.entries(corsHeaders).forEach(([key, value]) => {
|
|
1757
1779
|
newHeaders.set(key, value);
|
|
@@ -1764,8 +1786,12 @@ if (container && Component) {
|
|
|
1764
1786
|
}
|
|
1765
1787
|
);
|
|
1766
1788
|
console.log(
|
|
1767
|
-
`[SERVER] Listening`
|
|
1789
|
+
`[SERVER] Listening on http://${this.serverHost}:${this.serverPort}`
|
|
1790
|
+
);
|
|
1791
|
+
console.log(
|
|
1792
|
+
`[MCP] Endpoints: http://${this.serverHost}:${this.serverPort}/mcp`
|
|
1768
1793
|
);
|
|
1794
|
+
} else {
|
|
1769
1795
|
const { serve } = await import("@hono/node-server");
|
|
1770
1796
|
serve(
|
|
1771
1797
|
{
|
|
@@ -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;IAE/B;;;;;;;;;OASG;gBACS,MAAM,EAAE,YAAY;IAsGhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,IAAI;IAmBtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,gBAAgB,CACd,0BAA0B,EAAE,0BAA0B,GACrD,IAAI;IAiDP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AK,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.2.5-canary.
|
|
4
|
+
"version": "1.2.5-canary.8",
|
|
5
5
|
"packageManager": "pnpm@10.6.1",
|
|
6
6
|
"description": "Opinionated MCP Framework for TypeScript (@modelcontextprotocol/sdk compatible) - Build MCP Agents and Clients + MCP Servers with support for MCP-UI.",
|
|
7
7
|
"author": "mcp-use, Inc.",
|