@1mcp/agent 0.4.0 → 0.8.0
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/README.md +57 -2
- package/build/capabilities/capabilityManager.d.ts +34 -0
- package/build/capabilities/capabilityManager.d.ts.map +1 -0
- package/build/capabilities/capabilityManager.js +13 -5
- package/build/capabilities/capabilityManager.js.map +1 -0
- package/build/client.d.ts +25 -0
- package/build/client.d.ts.map +1 -0
- package/build/client.js +3 -10
- package/build/client.js.map +1 -0
- package/build/clients/clientManager.d.ts +40 -0
- package/build/clients/clientManager.d.ts.map +1 -0
- package/build/clients/clientManager.js +45 -21
- package/build/clients/clientManager.js.map +1 -0
- package/build/config/configManager.d.ts +54 -0
- package/build/config/configManager.d.ts.map +1 -0
- package/build/config/configManager.js +1 -0
- package/build/config/configManager.js.map +1 -0
- package/build/config/transportConfig.d.ts +7 -0
- package/build/config/transportConfig.d.ts.map +1 -0
- package/build/config/transportConfig.js +1 -0
- package/build/config/transportConfig.js.map +1 -0
- package/build/constants.d.ts +43 -0
- package/build/constants.d.ts.map +1 -0
- package/build/constants.js +19 -4
- package/build/constants.js.map +1 -0
- package/build/handlers/notificationHandlers.d.ts +14 -0
- package/build/handlers/notificationHandlers.d.ts.map +1 -0
- package/build/handlers/notificationHandlers.js +1 -0
- package/build/handlers/notificationHandlers.js.map +1 -0
- package/build/handlers/requestHandlers.d.ts +10 -0
- package/build/handlers/requestHandlers.d.ts.map +1 -0
- package/build/handlers/requestHandlers.js +45 -30
- package/build/handlers/requestHandlers.js.map +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +6 -1
- package/build/index.js.map +1 -0
- package/build/logger/logger.d.ts +13 -0
- package/build/logger/logger.d.ts.map +1 -0
- package/build/logger/logger.js +7 -33
- package/build/logger/logger.js.map +1 -0
- package/build/middleware/loggingMiddleware.d.ts +6 -0
- package/build/middleware/loggingMiddleware.d.ts.map +1 -0
- package/build/middleware/loggingMiddleware.js +1 -0
- package/build/middleware/loggingMiddleware.js.map +1 -0
- package/build/server/expressServer.d.ts +10 -0
- package/build/server/expressServer.d.ts.map +1 -0
- package/build/server/expressServer.js +2 -11
- package/build/server/expressServer.js.map +1 -0
- package/build/server.d.ts +7 -0
- package/build/server.d.ts.map +1 -0
- package/build/server.js +1 -0
- package/build/server.js.map +1 -0
- package/build/serverManager.d.ts +25 -0
- package/build/serverManager.d.ts.map +1 -0
- package/build/serverManager.js +4 -2
- package/build/serverManager.js.map +1 -0
- package/build/services/configReloadService.d.ts +37 -0
- package/build/services/configReloadService.d.ts.map +1 -0
- package/build/services/configReloadService.js +1 -0
- package/build/services/configReloadService.js.map +1 -0
- package/build/types.d.ts +129 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +1 -0
- package/build/types.js.map +1 -0
- package/build/utils/clientFiltering.d.ts +37 -0
- package/build/utils/clientFiltering.d.ts.map +1 -0
- package/build/utils/clientFiltering.js +73 -0
- package/build/utils/clientFiltering.js.map +1 -0
- package/build/utils/errorHandling.d.ts +62 -0
- package/build/utils/errorHandling.d.ts.map +1 -0
- package/build/utils/errorHandling.js +1 -0
- package/build/utils/errorHandling.js.map +1 -0
- package/build/utils/errorTypes.d.ts +25 -0
- package/build/utils/errorTypes.d.ts.map +1 -0
- package/build/utils/errorTypes.js +1 -0
- package/build/utils/errorTypes.js.map +1 -0
- package/package.json +28 -11
- package/build/config/configManager.test.js +0 -106
- package/build/logger/mcpTransport.js +0 -150
- package/build/serverManager.test.js +0 -158
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
A unified Model Context Protocol server implementation that aggregates multiple MCP servers into one.
|
|
4
4
|
|
|
5
|
+
[](https://www.npmjs.com/package/@1mcp/agent)
|
|
6
|
+
[](https://www.npmjs.com/package/@1mcp/agent)
|
|
7
|
+
[](https://smithery.ai/server/@1mcp-app/agent)
|
|
8
|
+
|
|
5
9
|
## Overview
|
|
6
10
|
|
|
7
11
|
1MCP (One MCP) is designed to simplify the way you work with AI assistants. Instead of configuring multiple MCP servers for different clients (Claude Desktop, Cherry Studio, Cursor, Roo Code, Claude, etc.), 1MCP provides a single, unified server that:
|
|
@@ -62,6 +66,57 @@ Available options:
|
|
|
62
66
|
- `--tags, -g`: Filter servers by tags (see Tags section below)
|
|
63
67
|
- `--help, -h`: Show help
|
|
64
68
|
|
|
69
|
+
Example with environment variables:
|
|
70
|
+
```bash
|
|
71
|
+
# Using environment variables
|
|
72
|
+
ONE_MCP_PORT=3051 ONE_MCP_TAGS=network,filesystem npx -y @1mcp/agent
|
|
73
|
+
|
|
74
|
+
# Or in your shell configuration
|
|
75
|
+
export ONE_MCP_PORT=3051
|
|
76
|
+
export ONE_MCP_TAGS=network,filesystem
|
|
77
|
+
npx -y @1mcp/agent
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Docker
|
|
81
|
+
|
|
82
|
+
You can also run 1MCP using Docker:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Pull the latest image
|
|
86
|
+
docker pull ghcr.io/1mcp-app/agent:latest
|
|
87
|
+
|
|
88
|
+
# Run with SSE transport (default)
|
|
89
|
+
docker run -p 3050:3050 ghcr.io/1mcp-app/agent
|
|
90
|
+
|
|
91
|
+
# Run with a custom config file
|
|
92
|
+
docker run -p 3050:3050 -v /path/to/config.json:/config.json ghcr.io/1mcp-app/agent --config /config.json
|
|
93
|
+
|
|
94
|
+
# Run with stdio transport
|
|
95
|
+
docker run -i ghcr.io/1mcp-app/agent --transport stdio
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Available image tags:
|
|
99
|
+
- `latest`: Latest stable release
|
|
100
|
+
- `vX.Y.Z`: Specific version (e.g. `v1.0.0`)
|
|
101
|
+
- `sha-<commit>`: Specific commit
|
|
102
|
+
|
|
103
|
+
### Environment Variables
|
|
104
|
+
|
|
105
|
+
You can configure 1MCP using environment variables prefixed with `ONE_MCP_`:
|
|
106
|
+
- `ONE_MCP_TRANSPORT`: Transport type ("stdio" or "sse", default: "sse")
|
|
107
|
+
- `ONE_MCP_PORT`: SSE port (default: 3050)
|
|
108
|
+
- `ONE_MCP_HOST`: SSE host (default: "localhost")
|
|
109
|
+
- `ONE_MCP_CONFIG`: Path to config file
|
|
110
|
+
- `ONE_MCP_TAGS`: Comma-separated list of tags to filter servers
|
|
111
|
+
|
|
112
|
+
Example with environment variables:
|
|
113
|
+
```bash
|
|
114
|
+
docker run -p 3051:3051 \
|
|
115
|
+
-e ONE_MCP_PORT=3051 \
|
|
116
|
+
-e ONE_MCP_TAGS=network,filesystem \
|
|
117
|
+
ghcr.io/1mcp-app/agent
|
|
118
|
+
```
|
|
119
|
+
|
|
65
120
|
### Understanding Tags
|
|
66
121
|
|
|
67
122
|
Tags help you control which MCP servers are available to different clients. Think of tags as labels that describe what each server can do.
|
|
@@ -229,10 +284,10 @@ pnpm dev
|
|
|
229
284
|
|
|
230
285
|
### Debugging
|
|
231
286
|
|
|
232
|
-
|
|
287
|
+
Using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector), which is available as a package script:
|
|
233
288
|
|
|
234
289
|
```bash
|
|
235
|
-
pnpm
|
|
290
|
+
pnpm inspector
|
|
236
291
|
```
|
|
237
292
|
|
|
238
293
|
The Inspector will provide a URL to access debugging tools in your browser.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Clients, ServerInfo } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Collects capabilities from all clients and registers them with the server
|
|
4
|
+
* @param clients Record of client instances
|
|
5
|
+
* @param server The MCP server instance
|
|
6
|
+
* @param tags Array of tags to filter clients by
|
|
7
|
+
* @returns The combined server capabilities
|
|
8
|
+
*/
|
|
9
|
+
export declare function setupCapabilities(clients: Clients, serverInfo: ServerInfo): Promise<{
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
experimental?: {
|
|
12
|
+
[x: string]: unknown;
|
|
13
|
+
} | undefined;
|
|
14
|
+
logging?: {
|
|
15
|
+
[x: string]: unknown;
|
|
16
|
+
} | undefined;
|
|
17
|
+
completions?: {
|
|
18
|
+
[x: string]: unknown;
|
|
19
|
+
} | undefined;
|
|
20
|
+
prompts?: {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
listChanged?: boolean | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
resources?: {
|
|
25
|
+
[x: string]: unknown;
|
|
26
|
+
listChanged?: boolean | undefined;
|
|
27
|
+
subscribe?: boolean | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
tools?: {
|
|
30
|
+
[x: string]: unknown;
|
|
31
|
+
listChanged?: boolean | undefined;
|
|
32
|
+
} | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
//# sourceMappingURL=capabilityManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilityManager.d.ts","sourceRoot":"","sources":["../../src/capabilities/capabilityManager.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAElD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;GAY/E"}
|
|
@@ -15,7 +15,7 @@ export async function setupCapabilities(clients, serverInfo) {
|
|
|
15
15
|
setupClientToServerNotifications(clients, serverInfo);
|
|
16
16
|
setupServerToClientNotifications(clients, serverInfo);
|
|
17
17
|
// Register request handlers based on capabilities
|
|
18
|
-
registerRequestHandlers(clients, serverInfo
|
|
18
|
+
registerRequestHandlers(clients, serverInfo);
|
|
19
19
|
return capabilities;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -24,12 +24,19 @@ export async function setupCapabilities(clients, serverInfo) {
|
|
|
24
24
|
* @returns The combined server capabilities
|
|
25
25
|
*/
|
|
26
26
|
function collectCapabilities(clients) {
|
|
27
|
-
|
|
27
|
+
const capabilities = {};
|
|
28
28
|
for (const [name, clientInfo] of Object.entries(clients)) {
|
|
29
29
|
try {
|
|
30
|
-
const
|
|
31
|
-
logger.debug(`Capabilities from ${name}: ${JSON.stringify(
|
|
32
|
-
|
|
30
|
+
const serverCapabilities = clientInfo.client.getServerCapabilities() || {};
|
|
31
|
+
logger.debug(`Capabilities from ${name}: ${JSON.stringify(serverCapabilities)}`);
|
|
32
|
+
// Store capabilities per client
|
|
33
|
+
clientInfo.capabilities = serverCapabilities;
|
|
34
|
+
// Aggregate capabilities
|
|
35
|
+
capabilities.resources = { ...capabilities.resources, ...serverCapabilities.resources };
|
|
36
|
+
capabilities.tools = { ...capabilities.tools, ...serverCapabilities.tools };
|
|
37
|
+
capabilities.prompts = { ...capabilities.prompts, ...serverCapabilities.prompts };
|
|
38
|
+
capabilities.experimental = { ...capabilities.experimental, ...serverCapabilities.experimental };
|
|
39
|
+
capabilities.logging = { ...capabilities.logging, ...serverCapabilities.logging };
|
|
33
40
|
}
|
|
34
41
|
catch (error) {
|
|
35
42
|
logger.error(`Failed to get capabilities from ${name}: ${error}`);
|
|
@@ -37,3 +44,4 @@ function collectCapabilities(clients) {
|
|
|
37
44
|
}
|
|
38
45
|
return capabilities;
|
|
39
46
|
}
|
|
47
|
+
//# sourceMappingURL=capabilityManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilityManager.js","sourceRoot":"","sources":["../../src/capabilities/capabilityManager.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EACL,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAgB,EAAE,UAAsB;IAC9E,wCAAwC;IACxC,MAAM,YAAY,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;I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C,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,mCAAmC,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
2
|
+
export default function createClient(): Promise<Client<{
|
|
3
|
+
method: string;
|
|
4
|
+
params?: {
|
|
5
|
+
[x: string]: unknown;
|
|
6
|
+
_meta?: {
|
|
7
|
+
[x: string]: unknown;
|
|
8
|
+
progressToken?: string | number | undefined;
|
|
9
|
+
} | undefined;
|
|
10
|
+
} | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
method: string;
|
|
13
|
+
params?: {
|
|
14
|
+
[x: string]: unknown;
|
|
15
|
+
_meta?: {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
} | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
[x: string]: unknown;
|
|
21
|
+
_meta?: {
|
|
22
|
+
[x: string]: unknown;
|
|
23
|
+
} | undefined;
|
|
24
|
+
}>>;
|
|
25
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAGnE,wBAA8B,YAAY;;;;;;;;;;;;;;;;;;;;;;IAYzC"}
|
package/build/client.js
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
2
|
-
import { MCP_SERVER_NAME, MCP_SERVER_VERSION } from './constants.js';
|
|
2
|
+
import { MCP_SERVER_NAME, MCP_SERVER_VERSION, MCP_CLIENT_CAPABILITIES } from './constants.js';
|
|
3
3
|
export default async function createClient() {
|
|
4
4
|
const client = new Client({
|
|
5
5
|
name: MCP_SERVER_NAME,
|
|
6
6
|
version: MCP_SERVER_VERSION,
|
|
7
7
|
}, {
|
|
8
|
-
capabilities:
|
|
9
|
-
experimental: {},
|
|
10
|
-
roots: {},
|
|
11
|
-
sampling: {},
|
|
12
|
-
logging: {},
|
|
13
|
-
prompts: {},
|
|
14
|
-
resources: {},
|
|
15
|
-
tools: {},
|
|
16
|
-
},
|
|
8
|
+
capabilities: MCP_CLIENT_CAPABILITIES,
|
|
17
9
|
});
|
|
18
10
|
return client;
|
|
19
11
|
}
|
|
12
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE9F,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,YAAY;IACxC,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;QACE,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,kBAAkB;KAC5B,EACD;QACE,YAAY,EAAE,uBAAuB;KACtC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
2
|
+
import { ClientInfo, Clients, OperationOptions, ServerInfo } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates client instances for all transports with retry logic
|
|
5
|
+
* @param transports Record of transport instances
|
|
6
|
+
* @returns Record of client instances
|
|
7
|
+
*/
|
|
8
|
+
export declare function createClients(transports: Record<string, Transport>): Promise<Clients>;
|
|
9
|
+
/**
|
|
10
|
+
* Gets a client by name with error handling
|
|
11
|
+
* @param clients Record of client instances
|
|
12
|
+
* @param clientName The name of the client to get
|
|
13
|
+
* @returns The client instance
|
|
14
|
+
* @throws ClientNotFoundError if the client is not found
|
|
15
|
+
*/
|
|
16
|
+
export declare function getClient(clients: Clients, clientName: string): ClientInfo;
|
|
17
|
+
/**
|
|
18
|
+
* Executes an operation with error handling and retry logic
|
|
19
|
+
* @param operation The operation to execute
|
|
20
|
+
* @param context The execution context (client info or server info)
|
|
21
|
+
* @param options Operation options including timeout and retry settings
|
|
22
|
+
* @returns The result of the operation
|
|
23
|
+
*/
|
|
24
|
+
export declare function executeOperation<T>(operation: () => Promise<T>, contextName: string, options?: OperationOptions): Promise<T>;
|
|
25
|
+
/**
|
|
26
|
+
* Executes a client operation with error handling and retry logic
|
|
27
|
+
* @param clients Record of client instances
|
|
28
|
+
* @param clientName The name of the client to use
|
|
29
|
+
* @param operation The operation to execute
|
|
30
|
+
* @param options Operation options including timeout and retry settings
|
|
31
|
+
*/
|
|
32
|
+
export declare function executeClientOperation<T>(clients: Clients, clientName: string, operation: (clientInfo: ClientInfo) => Promise<T>, options?: OperationOptions): Promise<T>;
|
|
33
|
+
/**
|
|
34
|
+
* Executes a server operation with error handling and retry logic
|
|
35
|
+
* @param server The server to execute the operation on
|
|
36
|
+
* @param operation The operation to execute
|
|
37
|
+
* @param options Operation options including timeout and retry settings
|
|
38
|
+
*/
|
|
39
|
+
export declare function executeServerOperation<T>(server: ServerInfo, operation: (server: ServerInfo) => Promise<T>, options?: OperationOptions): Promise<T>;
|
|
40
|
+
//# sourceMappingURL=clientManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientManager.d.ts","sourceRoot":"","sources":["../../src/clients/clientManager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAK1E,OAAO,EAAgB,UAAU,EAAE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9F;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAgC3F;AAoCD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAM1E;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,CAAC,CAAC,CA2BZ;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,EAC5C,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,CAAC,CAAC,CAGZ;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,EAC5C,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,EAC7C,OAAO,GAAE,gBAAqB,GAC7B,OAAO,CAAC,CAAC,CAAC,CAEZ"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import createClient from '../client.js';
|
|
2
2
|
import logger from '../logger/logger.js';
|
|
3
|
-
import { CONNECTION_RETRY, MCP_SERVER_NAME } from '../constants.js';
|
|
4
|
-
import {
|
|
5
|
-
import { ClientConnectionError, ClientNotFoundError } from '../utils/errorTypes.js';
|
|
3
|
+
import { CONNECTION_RETRY, MCP_SERVER_NAME, ERROR_CODES } from '../constants.js';
|
|
4
|
+
import { ClientConnectionError, ClientNotFoundError, MCPError } from '../utils/errorTypes.js';
|
|
6
5
|
import { ClientStatus } from '../types.js';
|
|
7
6
|
/**
|
|
8
7
|
* Creates client instances for all transports with retry logic
|
|
@@ -85,30 +84,55 @@ export function getClient(clients, clientName) {
|
|
|
85
84
|
return client;
|
|
86
85
|
}
|
|
87
86
|
/**
|
|
88
|
-
* Executes
|
|
89
|
-
* @param clients Record of client instances
|
|
90
|
-
* @param clientName The name of the client to use
|
|
87
|
+
* Executes an operation with error handling and retry logic
|
|
91
88
|
* @param operation The operation to execute
|
|
89
|
+
* @param context The execution context (client info or server info)
|
|
92
90
|
* @param options Operation options including timeout and retry settings
|
|
93
91
|
* @returns The result of the operation
|
|
94
92
|
*/
|
|
95
|
-
export async function
|
|
96
|
-
const clientInfo = getClient(clients, clientName);
|
|
93
|
+
export async function executeOperation(operation, contextName, options = {}) {
|
|
97
94
|
const { retryCount = 0, retryDelay = 1000 } = options;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
await new Promise((resolve) => setTimeout(resolve, retryDelay));
|
|
109
|
-
}
|
|
95
|
+
let lastError;
|
|
96
|
+
for (let i = 0; i <= retryCount; i++) {
|
|
97
|
+
try {
|
|
98
|
+
return await operation();
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
102
|
+
if (i < retryCount) {
|
|
103
|
+
logger.info(`Retrying operation ${operation.name} on ${contextName} after ${retryDelay}ms`);
|
|
104
|
+
await new Promise((resolve) => setTimeout(resolve, retryDelay));
|
|
110
105
|
}
|
|
111
106
|
}
|
|
107
|
+
}
|
|
108
|
+
// If we get here, we've exhausted all retries
|
|
109
|
+
logger.error(`Operation failed on ${contextName} after ${retryCount + 1} attempts: ${lastError}`);
|
|
110
|
+
if (lastError instanceof MCPError) {
|
|
112
111
|
throw lastError;
|
|
113
|
-
}
|
|
112
|
+
}
|
|
113
|
+
const mcpError = new MCPError(`Error executing operation on ${contextName}`, ERROR_CODES.INTERNAL_SERVER_ERROR, {
|
|
114
|
+
originalError: lastError,
|
|
115
|
+
});
|
|
116
|
+
throw mcpError;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Executes a client operation with error handling and retry logic
|
|
120
|
+
* @param clients Record of client instances
|
|
121
|
+
* @param clientName The name of the client to use
|
|
122
|
+
* @param operation The operation to execute
|
|
123
|
+
* @param options Operation options including timeout and retry settings
|
|
124
|
+
*/
|
|
125
|
+
export async function executeClientOperation(clients, clientName, operation, options = {}) {
|
|
126
|
+
const clientInfo = getClient(clients, clientName);
|
|
127
|
+
return executeOperation(() => operation(clientInfo), `client ${clientName}`, options);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Executes a server operation with error handling and retry logic
|
|
131
|
+
* @param server The server to execute the operation on
|
|
132
|
+
* @param operation The operation to execute
|
|
133
|
+
* @param options Operation options including timeout and retry settings
|
|
134
|
+
*/
|
|
135
|
+
export async function executeServerOperation(server, operation, options = {}) {
|
|
136
|
+
return executeOperation(() => operation(server), 'server', options);
|
|
114
137
|
}
|
|
138
|
+
//# sourceMappingURL=clientManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clientManager.js","sourceRoot":"","sources":["../../src/clients/clientManager.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAqD,MAAM,aAAa,CAAC;AAE9F;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,UAAqC;IACvE,MAAM,OAAO,GAA+B,EAAE,CAAC;IAE/C,KAAK,MAAM,CAAC,IAAI,EAAE,S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AAQ,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAgB,EAChB,UAAkB,EAClB,SAAiD,EACjD,UAA4B,EAAE;IAE9B,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAClD,OAAO,gBAAgB,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,UAAU,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;AACxF,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAAkB,EAClB,SAA6C,EAC7C,UAA4B,EAAE;IAE9B,OAAO,gBAAgB,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
import { MCPServerParams } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration change event types
|
|
5
|
+
*/
|
|
6
|
+
export declare enum ConfigChangeEvent {
|
|
7
|
+
TRANSPORT_CONFIG_CHANGED = "transportConfigChanged"
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Configuration manager that handles loading, watching, and reloading configuration
|
|
11
|
+
*/
|
|
12
|
+
export declare class ConfigManager extends EventEmitter {
|
|
13
|
+
private static instance;
|
|
14
|
+
private configWatcher;
|
|
15
|
+
private transportConfig;
|
|
16
|
+
private configFilePath;
|
|
17
|
+
/**
|
|
18
|
+
* Private constructor to enforce singleton pattern
|
|
19
|
+
* @param configFilePath - Optional path to the config file. If not provided, uses global config path
|
|
20
|
+
*/
|
|
21
|
+
private constructor();
|
|
22
|
+
/**
|
|
23
|
+
* Get the singleton instance of ConfigManager
|
|
24
|
+
* @param configFilePath - Optional path to the config file
|
|
25
|
+
*/
|
|
26
|
+
static getInstance(configFilePath?: string): ConfigManager;
|
|
27
|
+
/**
|
|
28
|
+
* Ensure the config directory and file exist
|
|
29
|
+
*/
|
|
30
|
+
private ensureConfigExists;
|
|
31
|
+
/**
|
|
32
|
+
* Load the configuration from the config file
|
|
33
|
+
*/
|
|
34
|
+
private loadConfig;
|
|
35
|
+
/**
|
|
36
|
+
* Start watching the configuration file for changes
|
|
37
|
+
*/
|
|
38
|
+
startWatching(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Stop watching the configuration file
|
|
41
|
+
*/
|
|
42
|
+
stopWatching(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Reload the configuration from the config file
|
|
45
|
+
*/
|
|
46
|
+
reloadConfig(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Get the current transport configuration
|
|
49
|
+
* @returns The current transport configuration
|
|
50
|
+
*/
|
|
51
|
+
getTransportConfig(): Record<string, MCPServerParams>;
|
|
52
|
+
}
|
|
53
|
+
export default ConfigManager;
|
|
54
|
+
//# sourceMappingURL=configManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configManager.d.ts","sourceRoot":"","sources":["../../src/config/configManager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGtC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,wBAAwB,2BAA2B;CACpD;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAgB;IACvC,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,eAAe,CAAuC;IAC9D,OAAO,CAAC,cAAc,CAAS;IAE/B;;;OAGG;IACH,OAAO;IAOP;;;OAGG;WACW,WAAW,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,aAAa;IAOjE;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAkB1B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e,CAAC,EAAE,CAAC;gBACvE,MAAM,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;gBAC/D,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,wBAAwB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;YAC9E,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,mCAAmC,KAAK,EAAE,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,kBAAkB;QACvB,OAAO,EAAE,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IACrC,CAAC;CACF;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MCPServerParams, EnhancedTransport } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates transport instances from configuration
|
|
4
|
+
* @returns Record of transport instances
|
|
5
|
+
*/
|
|
6
|
+
export declare function createTransports(config: Record<string, MCPServerParams>): Record<string, EnhancedTransport>;
|
|
7
|
+
//# sourceMappingURL=transportConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transportConfig.d.ts","sourceRoot":"","sources":["../../src/config/transportConfig.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEjE;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CA8C3G"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transportConfig.js","sourceRoot":"","sources":["../../src/config/transportConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAyB,MAAM,2CAA2C,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EA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AAE,CAAC,CAAC;gBACtE,CAAC;gBACD,MAAM,SAAS,GAAG,IAAI,oBAAoB,CAAC,kBAA2C,CAAsB,CAAC;gBAC7G,SAAS,CAAC,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC;gBAC/C,SAAS,CAAC,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC;gBACzC,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;YAC/B,CAAC;YAED,MAAM,CAAC,KAAK,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;gBAC9B,MAAM,CAAC,KAAK,CAAC,uCAAuC,IAAI,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YAC7E,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,KAAK,CAAC,4BAA4B,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC;YAC3D,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application constants
|
|
3
|
+
*/
|
|
4
|
+
import { ClientCapabilities, ServerCapabilities } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
export declare const PORT = 3050;
|
|
6
|
+
export declare const HOST = "127.0.0.1";
|
|
7
|
+
export declare const SSE_ENDPOINT = "/sse";
|
|
8
|
+
export declare const MESSAGES_ENDPOINT = "/messages";
|
|
9
|
+
export declare const ERROR_CODES: {
|
|
10
|
+
INTERNAL_SERVER_ERROR: number;
|
|
11
|
+
TRANSPORT_NOT_FOUND: number;
|
|
12
|
+
INVALID_PARAMS: number;
|
|
13
|
+
CLIENT_CONNECTION_ERROR: number;
|
|
14
|
+
RESOURCE_NOT_FOUND: number;
|
|
15
|
+
TOOL_NOT_FOUND: number;
|
|
16
|
+
PROMPT_NOT_FOUND: number;
|
|
17
|
+
OPERATION_TIMEOUT: number;
|
|
18
|
+
BACKEND_ERROR: number;
|
|
19
|
+
CAPABILITY_NOT_SUPPORTED: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const MCP_CONFIG_FILE = "mcp.json";
|
|
22
|
+
export declare const MCP_SERVER_NAME = "1mcp";
|
|
23
|
+
export declare const MCP_SERVER_VERSION = "0.8.0";
|
|
24
|
+
export declare const MCP_URI_SEPARATOR = "_1mcp_";
|
|
25
|
+
export declare const CONFIG_DIR_NAME = "1mcp";
|
|
26
|
+
export declare const DEFAULT_CONFIG: {
|
|
27
|
+
mcpServers: {};
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Get the global config directory path based on OS
|
|
31
|
+
*/
|
|
32
|
+
export declare function getGlobalConfigDir(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Get the global config file path
|
|
35
|
+
*/
|
|
36
|
+
export declare function getGlobalConfigPath(): string;
|
|
37
|
+
export declare const CONNECTION_RETRY: {
|
|
38
|
+
MAX_ATTEMPTS: number;
|
|
39
|
+
INITIAL_DELAY_MS: number;
|
|
40
|
+
};
|
|
41
|
+
export declare const MCP_SERVER_CAPABILITIES: ServerCapabilities;
|
|
42
|
+
export declare const MCP_CLIENT_CAPABILITIES: ClientCapabilities;
|
|
43
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAG5F,eAAO,MAAM,IAAI,OAAO,CAAC;AACzB,eAAO,MAAM,IAAI,cAAc,CAAC;AAGhC,eAAO,MAAM,YAAY,SAAS,CAAC;AACnC,eAAO,MAAM,iBAAiB,cAAc,CAAC;AAG7C,eAAO,MAAM,WAAW;;;;;;;;;;;CAWvB,CAAC;AAGF,eAAO,MAAM,eAAe,aAAa,CAAC;AAC1C,eAAO,MAAM,eAAe,SAAS,CAAC;AACtC,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAE1C,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAG1C,eAAO,MAAM,eAAe,SAAS,CAAC;AACtC,eAAO,MAAM,cAAc;;CAE1B,CAAC;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAY3C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAGD,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,kBAWrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,kBAOrC,CAAC"}
|
package/build/constants.js
CHANGED
|
@@ -23,7 +23,7 @@ export const ERROR_CODES = {
|
|
|
23
23
|
// MCP constants
|
|
24
24
|
export const MCP_CONFIG_FILE = 'mcp.json';
|
|
25
25
|
export const MCP_SERVER_NAME = '1mcp';
|
|
26
|
-
export const MCP_SERVER_VERSION = '0.
|
|
26
|
+
export const MCP_SERVER_VERSION = '0.8.0';
|
|
27
27
|
export const MCP_URI_SEPARATOR = '_1mcp_';
|
|
28
28
|
// Global config paths
|
|
29
29
|
export const CONFIG_DIR_NAME = '1mcp';
|
|
@@ -56,7 +56,22 @@ export const CONNECTION_RETRY = {
|
|
|
56
56
|
};
|
|
57
57
|
export const MCP_SERVER_CAPABILITIES = {
|
|
58
58
|
logging: {},
|
|
59
|
-
resources: {
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
resources: {
|
|
60
|
+
listChanged: false,
|
|
61
|
+
},
|
|
62
|
+
tools: {
|
|
63
|
+
listChanged: false,
|
|
64
|
+
},
|
|
65
|
+
prompts: {
|
|
66
|
+
listChanged: false,
|
|
67
|
+
},
|
|
62
68
|
};
|
|
69
|
+
export const MCP_CLIENT_CAPABILITIES = {
|
|
70
|
+
roots: {
|
|
71
|
+
listChanged: false,
|
|
72
|
+
},
|
|
73
|
+
sampling: {
|
|
74
|
+
listChanged: false,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,uBAAuB;AACvB,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC;AACzB,MAAM,CAAC,MAAM,IAAI,GAAG,WAAW,CAAC;AAEhC,gBAAgB;AAChB,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC;AACnC,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAE7C,cAAc;AACd,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,qBAAqB,EAAE,CAAC,KAAK;IAC7B,mBAAmB,EAAE,CAAC,KAAK;IAC3B,cAAc,EAAE,CAAC,KAAK;IACtB,uBAAuB,EAAE,CAAC,KAAK;IAC/B,kBAAkB,EAAE,CAAC,KAAK;IAC1B,cAAc,EAAE,CAAC,KAAK;IACtB,gBAAgB,EAAE,CAAC,KAAK;IACxB,iBAAiB,EAAE,CAAC,KAAK;IACzB,aAAa,EAAE,CAAC,KAAK;IACrB,wBAAwB,EAAE,CAAC,KAAK;CACjC,CAAC;AAEF,gBAAgB;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;AAC1C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAE1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAE1C,sBAAsB;AACtB,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC;AACtC,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE,EAAE;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IAC5D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACxD,CAAC;IAED,MAAM,SAAS,GACb,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAC3D,CAAC,CAAC,GAAG,OAAO,YAAY,eAAe,EAAE;QACzC,CAAC,CAAC,GAAG,OAAO,oBAAoB,eAAe,EAAE,CAAC;IAEtD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,GAAG,kBAAkB,EAAE,IAAI,eAAe,EAAE,CAAC;AACtD,CAAC;AAED,4BAA4B;AAC5B,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,YAAY,EAAE,CAAC;IACf,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAuB;IACzD,OAAO,EAAE,EAAE;IACX,SAAS,EAAE;QACT,WAAW,EAAE,KAAK;KACnB;IACD,KAAK,EAAE;QACL,WAAW,EAAE,KAAK;KACnB;IACD,OAAO,EAAE;QACP,WAAW,EAAE,KAAK;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAuB;IACzD,KAAK,EAAE;QACL,WAAW,EAAE,KAAK;KACnB;IACD,QAAQ,EAAE;QACR,WAAW,EAAE,KAAK;KACnB;CACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Clients, ServerInfo } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sets up client-to-server notification handlers
|
|
4
|
+
* @param clients Record of client instances
|
|
5
|
+
* @param serverInfo The MCP server instance
|
|
6
|
+
*/
|
|
7
|
+
export declare function setupClientToServerNotifications(clients: Clients, serverInfo: ServerInfo): void;
|
|
8
|
+
/**
|
|
9
|
+
* Sets up server-to-client notification handlers
|
|
10
|
+
* @param clients Record of client instances
|
|
11
|
+
* @param serverInfo The MCP server instance
|
|
12
|
+
*/
|
|
13
|
+
export declare function setupServerToClientNotifications(clients: Clients, serverInfo: ServerInfo): void;
|
|
14
|
+
//# sourceMappingURL=notificationHandlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notificationHandlers.d.ts","sourceRoot":"","sources":["../../src/handlers/notificationHandlers.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAClD;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CA4B/F;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAyB/F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notificationHandlers.js","sourceRoot":"","sources":["../../src/handlers/notificationHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,gCAAgC,EAChC,iCAAiC,EACjC,qCAAqC,EACrC,iCAAiC,EACjC,mCAAmC,EACnC,6BAA6B,EAC7B,kCAAkC,GACnC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAAC,OAAgB,EAAE,UAAsB;IACvF,MAAM,yBAAyB,GAAG;QAChC,2BAA2B;QAC3B,0BAA0B;QAC1B,gCAAgC;QAChC,iCAAiC;QACjC,qCAAqC;QACrC,iCAAiC;QACjC,mCAAmC;KACpC,CAAC;IAEF,K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E;wBACN,GAAG,YAAY,CAAC,MAAM;wBACtB,MAAM,EAAE,IAAI;qBACb;iBACF,CAAC,CAAC;YACL,CAAC,EAAE,yCAAyC,IAAI,EAAE,CAAC,CACpD,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Clients, ServerInfo } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Registers all request handlers based on available capabilities
|
|
4
|
+
* @param clients Record of client instances
|
|
5
|
+
* @param server The MCP server instance
|
|
6
|
+
* @param capabilities The server capabilities
|
|
7
|
+
* @param tags Array of tags to filter clients by
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerRequestHandlers(clients: Clients, serverInfo: ServerInfo): void;
|
|
10
|
+
//# sourceMappingURL=requestHandlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestHandlers.d.ts","sourceRoot":"","sources":["../../src/handlers/requestHandlers.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA6DlD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAkBtF"}
|