@agimon-ai/mcp-proxy 0.4.11 → 0.5.1
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/cli.cjs +146 -105
- package/dist/cli.mjs +146 -106
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +74 -60
- package/dist/index.d.mts +74 -60
- package/dist/index.mjs +1 -1
- package/dist/{src-DwErnAUn.cjs → src-B5N-kt9Y.cjs} +2965 -2802
- package/dist/{src-Cp1GdSlN.mjs → src-DQSfFKFP.mjs} +2968 -2804
- package/package.json +9 -6
package/dist/index.d.mts
CHANGED
|
@@ -261,6 +261,11 @@ interface PromptConfig {
|
|
|
261
261
|
*/
|
|
262
262
|
interface RemoteMcpConfiguration {
|
|
263
263
|
id?: string;
|
|
264
|
+
proxy?: {
|
|
265
|
+
type?: string;
|
|
266
|
+
port?: number;
|
|
267
|
+
host?: string;
|
|
268
|
+
};
|
|
264
269
|
mcpServers: Record<string, McpServerConfig>;
|
|
265
270
|
skills?: SkillsConfig;
|
|
266
271
|
}
|
|
@@ -516,6 +521,62 @@ declare class ConfigFetcherService {
|
|
|
516
521
|
isCacheValid(): boolean;
|
|
517
522
|
}
|
|
518
523
|
//#endregion
|
|
524
|
+
//#region src/services/McpClientManagerService.d.ts
|
|
525
|
+
/**
|
|
526
|
+
* Service for managing MCP client connections to remote servers
|
|
527
|
+
*/
|
|
528
|
+
declare class McpClientManagerService {
|
|
529
|
+
private clients;
|
|
530
|
+
private serverConfigs;
|
|
531
|
+
private connectionPromises;
|
|
532
|
+
private logger;
|
|
533
|
+
constructor(logger?: LoggerLike);
|
|
534
|
+
/**
|
|
535
|
+
* Kill all stdio MCP server child processes.
|
|
536
|
+
* Sends SIGTERM first, then SIGKILL after 1s if the process hasn't exited.
|
|
537
|
+
* Must be called by the owner (e.g. transport/command layer) during shutdown.
|
|
538
|
+
* Awaiting the returned promise ensures force-kill timers complete before process.exit().
|
|
539
|
+
*/
|
|
540
|
+
cleanupChildProcesses(): Promise<void>;
|
|
541
|
+
/**
|
|
542
|
+
* Connect to an MCP server based on its configuration with timeout
|
|
543
|
+
* Uses the timeout from server config, falling back to default (30s)
|
|
544
|
+
*/
|
|
545
|
+
connectToServer(serverName: string, config: McpServerConfig): Promise<void>;
|
|
546
|
+
registerServerConfigs(configs: Record<string, McpServerConfig>): void;
|
|
547
|
+
getKnownServerNames(): string[];
|
|
548
|
+
getServerRequestTimeout(serverName: string): number | undefined;
|
|
549
|
+
ensureConnected(serverName: string): Promise<McpClientConnection>;
|
|
550
|
+
private createConnection;
|
|
551
|
+
/**
|
|
552
|
+
* Perform the actual connection to MCP server
|
|
553
|
+
*/
|
|
554
|
+
private performConnection;
|
|
555
|
+
private connectStdioClient;
|
|
556
|
+
private connectHttpClient;
|
|
557
|
+
private connectSseClient;
|
|
558
|
+
/**
|
|
559
|
+
* Get a connected client by server name
|
|
560
|
+
*/
|
|
561
|
+
getClient(serverName: string): McpClientConnection | undefined;
|
|
562
|
+
/**
|
|
563
|
+
* Get all connected clients
|
|
564
|
+
*/
|
|
565
|
+
getAllClients(): McpClientConnection[];
|
|
566
|
+
/**
|
|
567
|
+
* Disconnect from a specific server
|
|
568
|
+
*/
|
|
569
|
+
disconnectServer(serverName: string): Promise<void>;
|
|
570
|
+
/**
|
|
571
|
+
* Disconnect from all servers
|
|
572
|
+
*/
|
|
573
|
+
disconnectAll(): Promise<void>;
|
|
574
|
+
/**
|
|
575
|
+
* Check if a server is connected
|
|
576
|
+
*/
|
|
577
|
+
isConnected(serverName: string): boolean;
|
|
578
|
+
}
|
|
579
|
+
//#endregion
|
|
519
580
|
//#region src/services/SkillService.d.ts
|
|
520
581
|
/**
|
|
521
582
|
* Service for loading and managing skills from configured skill directories.
|
|
@@ -644,60 +705,6 @@ declare class SkillService {
|
|
|
644
705
|
private loadSkillFile;
|
|
645
706
|
}
|
|
646
707
|
//#endregion
|
|
647
|
-
//#region src/services/McpClientManagerService.d.ts
|
|
648
|
-
/**
|
|
649
|
-
* Service for managing MCP client connections to remote servers
|
|
650
|
-
*/
|
|
651
|
-
declare class McpClientManagerService {
|
|
652
|
-
private clients;
|
|
653
|
-
private serverConfigs;
|
|
654
|
-
private connectionPromises;
|
|
655
|
-
private logger;
|
|
656
|
-
constructor(logger?: LoggerLike);
|
|
657
|
-
/**
|
|
658
|
-
* Synchronously kill all stdio MCP server child processes.
|
|
659
|
-
* Must be called by the owner (e.g. transport/command layer) during shutdown.
|
|
660
|
-
*/
|
|
661
|
-
cleanupChildProcesses(): void;
|
|
662
|
-
/**
|
|
663
|
-
* Connect to an MCP server based on its configuration with timeout
|
|
664
|
-
* Uses the timeout from server config, falling back to default (30s)
|
|
665
|
-
*/
|
|
666
|
-
connectToServer(serverName: string, config: McpServerConfig): Promise<void>;
|
|
667
|
-
registerServerConfigs(configs: Record<string, McpServerConfig>): void;
|
|
668
|
-
getKnownServerNames(): string[];
|
|
669
|
-
getServerRequestTimeout(serverName: string): number | undefined;
|
|
670
|
-
ensureConnected(serverName: string): Promise<McpClientConnection>;
|
|
671
|
-
private createConnection;
|
|
672
|
-
/**
|
|
673
|
-
* Perform the actual connection to MCP server
|
|
674
|
-
*/
|
|
675
|
-
private performConnection;
|
|
676
|
-
private connectStdioClient;
|
|
677
|
-
private connectHttpClient;
|
|
678
|
-
private connectSseClient;
|
|
679
|
-
/**
|
|
680
|
-
* Get a connected client by server name
|
|
681
|
-
*/
|
|
682
|
-
getClient(serverName: string): McpClientConnection | undefined;
|
|
683
|
-
/**
|
|
684
|
-
* Get all connected clients
|
|
685
|
-
*/
|
|
686
|
-
getAllClients(): McpClientConnection[];
|
|
687
|
-
/**
|
|
688
|
-
* Disconnect from a specific server
|
|
689
|
-
*/
|
|
690
|
-
disconnectServer(serverName: string): Promise<void>;
|
|
691
|
-
/**
|
|
692
|
-
* Disconnect from all servers
|
|
693
|
-
*/
|
|
694
|
-
disconnectAll(): Promise<void>;
|
|
695
|
-
/**
|
|
696
|
-
* Check if a server is connected
|
|
697
|
-
*/
|
|
698
|
-
isConnected(serverName: string): boolean;
|
|
699
|
-
}
|
|
700
|
-
//#endregion
|
|
701
708
|
//#region src/services/DefinitionsCacheService.d.ts
|
|
702
709
|
interface DefinitionsCacheServiceOptions {
|
|
703
710
|
cacheData?: DefinitionsCacheFile;
|
|
@@ -1116,10 +1123,14 @@ declare class UseToolTool implements Tool<UseToolToolInput> {
|
|
|
1116
1123
|
/**
|
|
1117
1124
|
* HTTP transport handler using Streamable HTTP (protocol version 2025-03-26)
|
|
1118
1125
|
* Provides stateful session management with resumability support
|
|
1126
|
+
*
|
|
1127
|
+
* Uses a hybrid server architecture:
|
|
1128
|
+
* - Raw Node.js createServer for /mcp routes (MCP SDK needs native req/res)
|
|
1129
|
+
* - Hono for REST routes (/health, /admin/shutdown)
|
|
1119
1130
|
*/
|
|
1120
1131
|
declare class HttpTransportHandler implements HttpTransportHandler$1 {
|
|
1121
1132
|
private serverFactory;
|
|
1122
|
-
private
|
|
1133
|
+
private honoApp;
|
|
1123
1134
|
private server;
|
|
1124
1135
|
private sessionManager;
|
|
1125
1136
|
private config;
|
|
@@ -1127,10 +1138,14 @@ declare class HttpTransportHandler implements HttpTransportHandler$1 {
|
|
|
1127
1138
|
private adminRateLimiter;
|
|
1128
1139
|
private logger;
|
|
1129
1140
|
constructor(serverFactory: () => Server | Promise<Server>, config: TransportConfig, adminOptions?: HttpTransportAdminOptions, logger?: LoggerLike);
|
|
1130
|
-
private
|
|
1131
|
-
private setupRoutes;
|
|
1141
|
+
private setupHonoRoutes;
|
|
1132
1142
|
private isAuthorizedShutdownRequest;
|
|
1133
1143
|
private handleAdminShutdownRequest;
|
|
1144
|
+
/**
|
|
1145
|
+
* Handle MCP protocol requests (POST/GET/DELETE /mcp)
|
|
1146
|
+
* Uses raw Node.js req/res as required by MCP SDK
|
|
1147
|
+
*/
|
|
1148
|
+
private handleMcpRequest;
|
|
1134
1149
|
private handlePostRequest;
|
|
1135
1150
|
private handleGetRequest;
|
|
1136
1151
|
private handleDeleteRequest;
|
|
@@ -1148,14 +1163,13 @@ declare class HttpTransportHandler implements HttpTransportHandler$1 {
|
|
|
1148
1163
|
*/
|
|
1149
1164
|
declare class SseTransportHandler implements HttpTransportHandler$1 {
|
|
1150
1165
|
private serverFactory;
|
|
1151
|
-
private
|
|
1166
|
+
private honoApp;
|
|
1152
1167
|
private server;
|
|
1153
1168
|
private sessionManager;
|
|
1154
1169
|
private config;
|
|
1155
1170
|
private logger;
|
|
1156
1171
|
constructor(serverFactory: Server | (() => Server), config: TransportConfig, logger?: LoggerLike);
|
|
1157
|
-
private
|
|
1158
|
-
private setupRoutes;
|
|
1172
|
+
private setupHonoRoutes;
|
|
1159
1173
|
private handleSseConnection;
|
|
1160
1174
|
private handlePostMessage;
|
|
1161
1175
|
start(): Promise<void>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as DefinitionsCacheService, E as ConfigFetcherService, S as createProxyLogger, T as findConfigFile, _ as DescribeToolsTool, a as createProxyContainer, b as RuntimeStateService, c as createStdioHttpTransportHandler, d as StdioHttpTransportHandler, f as StdioTransportHandler, g as SearchListToolsTool, h as UseToolTool, i as createHttpTransportHandler, l as createStdioTransportHandler, m as HttpTransportHandler, n as createServer, p as SseTransportHandler, r as createSessionServer, s as createSseTransportHandler, t as TRANSPORT_MODE, u as initializeSharedServices, v as SkillService, w as generateServerId, x as McpClientManagerService, y as StopServerService } from "./src-DQSfFKFP.mjs";
|
|
2
2
|
|
|
3
3
|
export { ConfigFetcherService, DefinitionsCacheService, DescribeToolsTool, HttpTransportHandler, McpClientManagerService, RuntimeStateService, SearchListToolsTool, SkillService, SseTransportHandler, StdioHttpTransportHandler, StdioTransportHandler, StopServerService, TRANSPORT_MODE, UseToolTool, createHttpTransportHandler, createProxyContainer, createProxyLogger, createServer, createSessionServer, createSseTransportHandler, createStdioHttpTransportHandler, createStdioTransportHandler, findConfigFile, generateServerId, initializeSharedServices };
|