@portel/photon-core 1.2.0 → 1.3.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 CHANGED
@@ -200,6 +200,87 @@ await depManager.clearAllCache();
200
200
 
201
201
  ---
202
202
 
203
+ ### MCP SDK Transport
204
+
205
+ Connect to external MCPs using the official `@modelcontextprotocol/sdk`. Supports multiple transports:
206
+
207
+ ```typescript
208
+ import {
209
+ SDKMCPClientFactory,
210
+ SDKMCPTransport,
211
+ loadMCPConfig,
212
+ createSDKMCPClientFactory,
213
+ resolveMCPSource
214
+ } from '@portel/photon-core';
215
+
216
+ // Create from config
217
+ const config = {
218
+ mcpServers: {
219
+ // stdio transport (local process)
220
+ github: {
221
+ command: 'npx',
222
+ args: ['-y', '@modelcontextprotocol/server-github'],
223
+ env: { GITHUB_TOKEN: 'your-token' }
224
+ },
225
+ // SSE transport (HTTP)
226
+ remote: {
227
+ url: 'http://localhost:3000/mcp',
228
+ transport: 'sse'
229
+ },
230
+ // WebSocket transport
231
+ realtime: {
232
+ url: 'ws://localhost:8080/mcp',
233
+ transport: 'websocket'
234
+ },
235
+ // Streamable HTTP transport
236
+ streaming: {
237
+ url: 'http://localhost:3000/mcp',
238
+ transport: 'streamable-http'
239
+ }
240
+ }
241
+ };
242
+
243
+ const factory = new SDKMCPClientFactory(config);
244
+ const github = factory.create('github');
245
+
246
+ // List tools
247
+ const tools = await github.list();
248
+
249
+ // Call a tool
250
+ const issues = await github.call('list_issues', { repo: 'owner/repo' });
251
+
252
+ // Or use the proxy for fluent API
253
+ import { createMCPProxy } from '@portel/photon-core';
254
+ const githubProxy = createMCPProxy(github);
255
+ const issues = await githubProxy.list_issues({ repo: 'owner/repo' });
256
+ ```
257
+
258
+ **Transport Types:**
259
+
260
+ | Transport | Config | Use Case |
261
+ |-----------|--------|----------|
262
+ | `stdio` | `command`, `args` | Local CLI-based MCPs |
263
+ | `sse` | `url`, `transport: 'sse'` | HTTP Server-Sent Events |
264
+ | `streamable-http` | `url`, `transport: 'streamable-http'` | HTTP streaming |
265
+ | `websocket` | `url`, `transport: 'websocket'` | WebSocket connections |
266
+
267
+ **Helper Functions:**
268
+
269
+ ```typescript
270
+ // Load config from standard locations
271
+ // Checks: PHOTON_MCP_CONFIG env, ./photon.mcp.json, ~/.config/photon/mcp.json
272
+ const config = await loadMCPConfig();
273
+
274
+ // Create factory from default config
275
+ const factory = await createSDKMCPClientFactory();
276
+
277
+ // Resolve marketplace sources to config
278
+ const config = resolveMCPSource('github', 'anthropics/mcp-server-github', 'github');
279
+ // → { command: 'npx', args: ['-y', '@anthropics/mcp-server-github'], transport: 'stdio' }
280
+ ```
281
+
282
+ ---
283
+
203
284
  ### `SchemaExtractor`
204
285
 
205
286
  Extracts JSON schemas from TypeScript method signatures and JSDoc comments.
package/dist/base.d.ts CHANGED
@@ -26,7 +26,19 @@
26
26
  * }
27
27
  * }
28
28
  * ```
29
+ *
30
+ * With MCP access (requires runtime support):
31
+ * ```typescript
32
+ * export default class SlackReporter extends PhotonMCP {
33
+ * async report() {
34
+ * const github = this.mcp('github');
35
+ * const issues = await github.call('list_issues', { repo: 'foo/bar' });
36
+ * // Or with proxy: await github.list_issues({ repo: 'foo/bar' })
37
+ * }
38
+ * }
39
+ * ```
29
40
  */
41
+ import { MCPClient, MCPClientFactory } from './mcp-client.js';
30
42
  /**
31
43
  * Simple base class for creating Photon MCPs
32
44
  *
@@ -35,6 +47,16 @@
35
47
  * - Return value = Tool result
36
48
  */
37
49
  export declare class PhotonMCP {
50
+ /**
51
+ * MCP client factory - injected by runtime
52
+ * @internal
53
+ */
54
+ protected _mcpFactory?: MCPClientFactory;
55
+ /**
56
+ * Cache of MCP client instances
57
+ * @internal
58
+ */
59
+ private _mcpClients;
38
60
  /**
39
61
  * Get MCP name from class name
40
62
  * Converts PascalCase to kebab-case (e.g., MyAwesomeMCP → my-awesome-mcp)
@@ -54,5 +76,50 @@ export declare class PhotonMCP {
54
76
  */
55
77
  onInitialize?(): Promise<void>;
56
78
  onShutdown?(): Promise<void>;
79
+ /**
80
+ * Get an MCP client for calling external MCP servers
81
+ *
82
+ * Enables Photons to call tools on other MCP servers via the MCP protocol.
83
+ * This is language-agnostic - the MCP can be written in any language
84
+ * (Python, Rust, Go, etc.) as long as it speaks MCP protocol.
85
+ *
86
+ * @param mcpName The name of the MCP server to connect to
87
+ * @returns MCP client with call(), list(), find() methods, plus proxy for direct tool calls
88
+ *
89
+ * @example
90
+ * ```typescript
91
+ * // Using call() method
92
+ * const github = this.mcp('github');
93
+ * const issues = await github.call('list_issues', { repo: 'owner/repo' });
94
+ *
95
+ * // Using proxy (tool name as method)
96
+ * const issues = await github.list_issues({ repo: 'owner/repo' });
97
+ *
98
+ * // Listing available tools
99
+ * const tools = await github.list();
100
+ *
101
+ * // Finding tools
102
+ * const issueTools = await github.find('issue');
103
+ * ```
104
+ *
105
+ * @throws Error if MCP factory is not set (runtime doesn't support MCP access)
106
+ */
107
+ mcp(mcpName: string): MCPClient & Record<string, (params?: any) => Promise<any>>;
108
+ /**
109
+ * Set the MCP client factory
110
+ * Called by the runtime to enable MCP access
111
+ *
112
+ * @internal
113
+ */
114
+ setMCPFactory(factory: MCPClientFactory): void;
115
+ /**
116
+ * Check if MCP access is available
117
+ */
118
+ hasMCPAccess(): boolean;
119
+ /**
120
+ * List all available MCP servers
121
+ * Requires MCP factory to be set
122
+ */
123
+ listMCPServers(): Promise<string[]>;
57
124
  }
58
125
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;GAMG;AACH,qBAAa,SAAS;IACpB;;;OAGG;IACH,MAAM,CAAC,UAAU,IAAI,MAAM;IAQ3B;;;OAGG;IACH,MAAM,CAAC,cAAc,IAAI,MAAM,EAAE;IA0BjC;;OAEG;IACG,WAAW,C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/base.js CHANGED
@@ -26,7 +26,19 @@
26
26
  * }
27
27
  * }
28
28
  * ```
29
+ *
30
+ * With MCP access (requires runtime support):
31
+ * ```typescript
32
+ * export default class SlackReporter extends PhotonMCP {
33
+ * async report() {
34
+ * const github = this.mcp('github');
35
+ * const issues = await github.call('list_issues', { repo: 'foo/bar' });
36
+ * // Or with proxy: await github.list_issues({ repo: 'foo/bar' })
37
+ * }
38
+ * }
39
+ * ```
29
40
  */
41
+ import { createMCPProxy } from './mcp-client.js';
30
42
  /**
31
43
  * Simple base class for creating Photon MCPs
32
44
  *
@@ -35,6 +47,16 @@
35
47
  * - Return value = Tool result
36
48
  */
37
49
  export class PhotonMCP {
50
+ /**
51
+ * MCP client factory - injected by runtime
52
+ * @internal
53
+ */
54
+ _mcpFactory;
55
+ /**
56
+ * Cache of MCP client instances
57
+ * @internal
58
+ */
59
+ _mcpClients = new Map();
38
60
  /**
39
61
  * Get MCP name from class name
40
62
  * Converts PascalCase to kebab-case (e.g., MyAwesomeMCP → my-awesome-mcp)
@@ -88,5 +110,75 @@ export class PhotonMCP {
88
110
  throw error;
89
111
  }
90
112
  }
113
+ /**
114
+ * Get an MCP client for calling external MCP servers
115
+ *
116
+ * Enables Photons to call tools on other MCP servers via the MCP protocol.
117
+ * This is language-agnostic - the MCP can be written in any language
118
+ * (Python, Rust, Go, etc.) as long as it speaks MCP protocol.
119
+ *
120
+ * @param mcpName The name of the MCP server to connect to
121
+ * @returns MCP client with call(), list(), find() methods, plus proxy for direct tool calls
122
+ *
123
+ * @example
124
+ * ```typescript
125
+ * // Using call() method
126
+ * const github = this.mcp('github');
127
+ * const issues = await github.call('list_issues', { repo: 'owner/repo' });
128
+ *
129
+ * // Using proxy (tool name as method)
130
+ * const issues = await github.list_issues({ repo: 'owner/repo' });
131
+ *
132
+ * // Listing available tools
133
+ * const tools = await github.list();
134
+ *
135
+ * // Finding tools
136
+ * const issueTools = await github.find('issue');
137
+ * ```
138
+ *
139
+ * @throws Error if MCP factory is not set (runtime doesn't support MCP access)
140
+ */
141
+ mcp(mcpName) {
142
+ if (!this._mcpFactory) {
143
+ throw new Error(`MCP access not available. To use this.mcp('${mcpName}'), the Photon must be run in a runtime that supports MCP access (e.g., NCP with MCP servers configured).`);
144
+ }
145
+ // Return cached client if available
146
+ let client = this._mcpClients.get(mcpName);
147
+ if (client) {
148
+ return client;
149
+ }
150
+ // Create new client and cache it
151
+ const rawClient = this._mcpFactory.create(mcpName);
152
+ client = createMCPProxy(rawClient);
153
+ this._mcpClients.set(mcpName, client);
154
+ return client;
155
+ }
156
+ /**
157
+ * Set the MCP client factory
158
+ * Called by the runtime to enable MCP access
159
+ *
160
+ * @internal
161
+ */
162
+ setMCPFactory(factory) {
163
+ this._mcpFactory = factory;
164
+ // Clear cached clients when factory changes
165
+ this._mcpClients.clear();
166
+ }
167
+ /**
168
+ * Check if MCP access is available
169
+ */
170
+ hasMCPAccess() {
171
+ return !!this._mcpFactory;
172
+ }
173
+ /**
174
+ * List all available MCP servers
175
+ * Requires MCP factory to be set
176
+ */
177
+ async listMCPServers() {
178
+ if (!this._mcpFactory) {
179
+ return [];
180
+ }
181
+ return this._mcpFactory.listServers();
182
+ }
91
183
  }
92
184
  //# sourceMappingURL=base.js.map
package/dist/base.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;GAMG;AACH,MAAM,OAAO,SAAS;IACpB;;;OAGG;IACH,MAAM,CAAC,UAAU;QACf,OAAO,IAAI,CAAC,IAAI;aACb,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,iCAAiC;aACrD,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC;aAC1B,WAAW,EAAE;aACb,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,sBAAsB;IAC9C,CAAC;IAED;;;OAGG;IACH,MAAM,CA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AS,CAAC,CAAC;QACnC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;OAKG;IACH,aAAa,CAAC,OAAyB;QACrC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;QAC3B,4CAA4C;QAC5C,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,YAAY;QACV,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,cAAc;QAClB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;IACxC,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -38,6 +38,8 @@ export { SchemaExtractor } from './schema-extractor.js';
38
38
  export { formatOutput, detectFormat, renderPrimitive, renderList, renderTable, renderTree, renderNone, formatKey, formatValue, formatToMimeType, printSuccess, printError, printInfo, printWarning, printHeader, STATUS, } from './cli-formatter.js';
39
39
  export { resolvePath, listFiles, ensureDir, resolvePhotonPath, listPhotonFiles, ensurePhotonDir, DEFAULT_PHOTON_DIR, type ResolverOptions, } from './path-resolver.js';
40
40
  export * from './types.js';
41
+ export { MCPClient, MCPError, MCPNotConnectedError, MCPToolError, createMCPProxy, type MCPToolInfo, type MCPToolResult, type MCPTransport, type MCPClientFactory, } from './mcp-client.js';
42
+ export { SDKMCPTransport, SDKMCPClientFactory, loadMCPConfig, createSDKMCPClientFactory, resolveMCPSource, type MCPServerConfig, type MCPConfig, } from './mcp-sdk-transport.js';
41
43
  export { isAskYield, isEmitYield, getAskType, getEmitType, isAsyncGeneratorFunction, isAsyncGenerator, executeGenerator, extractAsks, createPrefilledProvider, NeedsInputError, wrapAsGenerator, type AskYield, type AskText, type AskPassword, type AskConfirm, type AskSelect, type AskNumber, type AskFile, type AskDate, type EmitYield, type EmitStatus, type EmitProgress, type EmitStream, type EmitLog, type EmitToast, type EmitThinking, type EmitArtifact, type PhotonYield, type InputProvider, type OutputHandler, type GeneratorExecutorConfig, type ExtractedAsk, isInputYield, isProgressYield, isStreamYield, isLogYield, extractYields, type PromptYield, type ConfirmYield, type SelectYield, type ProgressYield, type StreamYield, type LogYield, type ExtractedYield, } from './generator.js';
42
44
  export { prompt, confirm, elicit, elicitReadline, elicitNativeDialog, setPromptHandler, getPromptHandler, setElicitHandler, getElicitHandler, type ElicitOptions, type ElicitResult, type ElicitHandler, type PromptHandler, } from './elicit.js';
43
45
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,UAAU,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,MAAM,GACP,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,KAAK,eAAe,GACrB,MAAM,oBAAoB,CAAC;AAG5B,cAAc,YAAY,CAAC;AAI3B,OAAO,EAEL,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW,EAGX,wBAAwB,EACxB,gBAAgB,EAGhB,gBAAgB,EAG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AAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAEL,MAAM,EACN,OAAO,EAEP,MAAM,EACN,cAAc,EACd,kBAAkB,EAElB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAEhB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -44,6 +44,10 @@ export { formatOutput, detectFormat, renderPrimitive, renderList, renderTable, r
44
44
  export { resolvePath, listFiles, ensureDir, resolvePhotonPath, listPhotonFiles, ensurePhotonDir, DEFAULT_PHOTON_DIR, } from './path-resolver.js';
45
45
  // Types
46
46
  export * from './types.js';
47
+ // MCP Protocol Client - for calling external MCPs from Photons
48
+ export { MCPClient, MCPError, MCPNotConnectedError, MCPToolError, createMCPProxy, } from './mcp-client.js';
49
+ // MCP SDK Transport - official SDK-based transport implementation
50
+ export { SDKMCPTransport, SDKMCPClientFactory, loadMCPConfig, createSDKMCPClientFactory, resolveMCPSource, } from './mcp-sdk-transport.js';
47
51
  // Generator-based tools with ask/emit pattern
48
52
  // See generator.ts for comprehensive documentation
49
53
  export {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,wBAAwB;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,oBAAoB;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,iBAAiB;AACjB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,UAAU,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EACX,MAAM,GACP,MAAM,oBAAoB,CAAC;AAE5B,kBAAkB;AAClB,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,kBAAkB,GAEnB,MAAM,oBAAoB,CAAC;AAE5B,QAAQ;AACR,cAAc,YAAY,CAAC;AAE3B,8CAA8C;AAC9C,mDAAmD;AACnD,OAAO;AACL,sCAAsC;AACtC,UAAU,EACV,WAAW,EACX,UAAU,EACV,WAAW;AAEX,sBAAsB;AACtB,wBAAwB,EACxB,gBAAgB;AAEhB,2CAA2C;AAC3C,gBAAgB;AAEhB,kDAAkD;AAClD,WAAW;AAEX,qBAAqB;AACrB,uBAAuB,EACvB,eAAe;AAEf,UAAU;AACV,eAAe;AA+Bf,oCAAoC;AACpC,YAAY,EACZ,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,GAQd,MAAM,gBAAgB,CAAC;AAExB,iEAAiE;AACjE,OAAO;AACL,uDAAuD;AACvD,MAAM,EACN,OAAO;AACP,2BAA2B;AAC3B,MAAM,EACN,cAAc,EACd,kBAAkB;AAClB,oCAAoC;AACpC,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAMjB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,wBAAwB;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,oBAAoB;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,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-0,0 +1,179 @@
1
+ /**
2
+ * MCP Protocol Client for Photons
3
+ *
4
+ * Enables Photons to call external MCPs via the MCP protocol.
5
+ * This is runtime-agnostic - the actual transport is provided by the runtime (NCP, Lumina, etc.)
6
+ *
7
+ * Usage in Photon:
8
+ * ```typescript
9
+ * export default class MyPhoton extends PhotonMCP {
10
+ * async doSomething() {
11
+ * const github = this.mcp('github');
12
+ * const issues = await github.call('list_issues', { repo: 'foo/bar' });
13
+ * }
14
+ * }
15
+ * ```
16
+ */
17
+ /**
18
+ * Tool information returned from MCP discovery
19
+ */
20
+ export interface MCPToolInfo {
21
+ name: string;
22
+ description?: string;
23
+ inputSchema?: {
24
+ type: 'object';
25
+ properties?: Record<string, any>;
26
+ required?: string[];
27
+ };
28
+ }
29
+ /**
30
+ * Result from an MCP tool call
31
+ */
32
+ export interface MCPToolResult {
33
+ content: Array<{
34
+ type: 'text' | 'image' | 'resource';
35
+ text?: string;
36
+ data?: string;
37
+ mimeType?: string;
38
+ }>;
39
+ isError?: boolean;
40
+ }
41
+ /**
42
+ * Interface that runtimes must implement to provide MCP connectivity
43
+ * This keeps photon-core runtime-agnostic
44
+ */
45
+ export interface MCPTransport {
46
+ /**
47
+ * Call a tool on an MCP server
48
+ * @param mcpName The MCP server name
49
+ * @param toolName The tool to call
50
+ * @param parameters Tool parameters
51
+ */
52
+ callTool(mcpName: string, toolName: string, parameters: Record<string, any>): Promise<MCPToolResult>;
53
+ /**
54
+ * List available tools on an MCP server
55
+ * @param mcpName The MCP server name
56
+ */
57
+ listTools(mcpName: string): Promise<MCPToolInfo[]>;
58
+ /**
59
+ * Check if an MCP server is connected/available
60
+ * @param mcpName The MCP server name
61
+ */
62
+ isConnected(mcpName: string): Promise<boolean>;
63
+ }
64
+ /**
65
+ * Factory interface for creating MCP clients
66
+ * Runtimes implement this to provide MCP access to Photons
67
+ */
68
+ export interface MCPClientFactory {
69
+ /**
70
+ * Create an MCP client for a specific server
71
+ * @param mcpName The MCP server name
72
+ */
73
+ create(mcpName: string): MCPClient;
74
+ /**
75
+ * List all available MCP servers
76
+ */
77
+ listServers(): Promise<string[]>;
78
+ }
79
+ /**
80
+ * MCP Client - Protocol wrapper for calling external MCPs
81
+ *
82
+ * Provides a clean async interface for Photons to call MCP tools.
83
+ * The actual protocol communication is handled by the transport layer.
84
+ */
85
+ export declare class MCPClient {
86
+ private mcpName;
87
+ private transport;
88
+ private toolsCache;
89
+ constructor(mcpName: string, transport: MCPTransport);
90
+ /**
91
+ * Get the MCP server name
92
+ */
93
+ get name(): string;
94
+ /**
95
+ * Call a tool on this MCP server
96
+ *
97
+ * @param toolName The tool to call
98
+ * @param parameters Tool parameters
99
+ * @returns Tool result (parsed from MCP response)
100
+ *
101
+ * @example
102
+ * ```typescript
103
+ * const github = this.mcp('github');
104
+ * const issues = await github.call('list_issues', { repo: 'owner/repo', state: 'open' });
105
+ * ```
106
+ */
107
+ call(toolName: string, parameters?: Record<string, any>): Promise<any>;
108
+ /**
109
+ * List all available tools on this MCP server
110
+ *
111
+ * @returns Array of tool information
112
+ *
113
+ * @example
114
+ * ```typescript
115
+ * const github = this.mcp('github');
116
+ * const tools = await github.list();
117
+ * // [{ name: 'list_issues', description: '...' }, ...]
118
+ * ```
119
+ */
120
+ list(): Promise<MCPToolInfo[]>;
121
+ /**
122
+ * Find tools matching a query
123
+ *
124
+ * @param query Search query (matches name or description)
125
+ * @returns Matching tools
126
+ *
127
+ * @example
128
+ * ```typescript
129
+ * const github = this.mcp('github');
130
+ * const issueTools = await github.find('issue');
131
+ * ```
132
+ */
133
+ find(query: string): Promise<MCPToolInfo[]>;
134
+ /**
135
+ * Check if this MCP server is connected
136
+ */
137
+ isConnected(): Promise<boolean>;
138
+ /**
139
+ * Clear the tools cache (useful after reconnection)
140
+ */
141
+ clearCache(): void;
142
+ /**
143
+ * Parse MCP tool result into a usable value
144
+ */
145
+ private parseResult;
146
+ }
147
+ /**
148
+ * Base class for MCP-related errors
149
+ */
150
+ export declare class MCPError extends Error {
151
+ readonly mcpName: string;
152
+ constructor(mcpName: string, message: string);
153
+ }
154
+ /**
155
+ * Error thrown when MCP server is not connected
156
+ */
157
+ export declare class MCPNotConnectedError extends MCPError {
158
+ constructor(mcpName: string);
159
+ }
160
+ /**
161
+ * Error thrown when MCP tool call fails
162
+ */
163
+ export declare class MCPToolError extends MCPError {
164
+ readonly toolName: string;
165
+ readonly details: string;
166
+ constructor(mcpName: string, toolName: string, details: string);
167
+ }
168
+ /**
169
+ * Create a proxy-based MCP client that allows direct method calls
170
+ *
171
+ * This enables a more fluent API:
172
+ * ```typescript
173
+ * const github = this.mcp('github');
174
+ * // Instead of: await github.call('list_issues', { repo: 'foo/bar' })
175
+ * // You can do: await github.list_issues({ repo: 'foo/bar' })
176
+ * ```
177
+ */
178
+ export declare function createMCPProxy(client: MCPClient): MCPClient & Record<string, (params?: any) => Promise<any>>;
179
+ //# sourceMappingURL=mcp-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-client.d.ts","sourceRoot":"","sources":["../src/mcp-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACjC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;QACpC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,OAAO,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