@dex-ai/mcp-extension 0.1.2
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/package.json +36 -0
- package/src/index.ts +25 -0
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dex-ai/mcp-extension",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "MCP (Model Context Protocol) client — discover and wire external tool servers into a Dex session.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./src/index.ts",
|
|
9
|
+
"default": "./src/index.ts"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"src"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"typecheck": "tsc --noEmit",
|
|
17
|
+
"test": "echo \"(no tests)\"",
|
|
18
|
+
"changeset": "changeset",
|
|
19
|
+
"version": "changeset version",
|
|
20
|
+
"release": "changeset publish"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@dex-ai/sdk": "^0.1.2"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"typescript": "^5.6.3",
|
|
27
|
+
"@types/bun": "latest",
|
|
28
|
+
"bun-types": "latest",
|
|
29
|
+
"@changesets/cli": "^2.29.0"
|
|
30
|
+
},
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public",
|
|
34
|
+
"registry": "https://registry.npmjs.org/"
|
|
35
|
+
}
|
|
36
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @dex-ai/mcp — Model Context Protocol client.
|
|
3
|
+
*
|
|
4
|
+
* Connects to one-or-more MCP servers, discovers their tools, and wraps
|
|
5
|
+
* each as a Tool.define() for a Dex Agent. Also forwards resources /
|
|
6
|
+
* prompts when the server exposes them.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export interface McpServerConfig {
|
|
10
|
+
name: string;
|
|
11
|
+
command?: string;
|
|
12
|
+
args?: string[];
|
|
13
|
+
/** HTTP transport instead of stdio. */
|
|
14
|
+
url?: string;
|
|
15
|
+
env?: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface McpClient {
|
|
19
|
+
readonly servers: ReadonlyArray<{ name: string; connected: boolean }>;
|
|
20
|
+
/** All discovered tools, keyed by `${serverName}:${toolName}`. */
|
|
21
|
+
tools(): Promise<unknown[]>; // AnyTool[]
|
|
22
|
+
close(): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export declare function createMcpClient(servers: McpServerConfig[]): Promise<McpClient>;
|