@h1deya/langchain-mcp-tools 0.1.17 → 0.1.19
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.
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { StructuredTool } from '@langchain/core/tools';
|
|
2
|
-
|
|
3
|
-
command: string;
|
|
4
|
-
args: readonly string[];
|
|
5
|
-
env?: Readonly<Record<string, string>>;
|
|
6
|
-
}
|
|
2
|
+
import { StdioServerParameters } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
7
3
|
export interface McpServersConfig {
|
|
8
|
-
[key: string]:
|
|
4
|
+
[key: string]: StdioServerParameters;
|
|
9
5
|
}
|
|
10
6
|
export interface McpToolsLogger {
|
|
11
7
|
debug(message: string, ...args: any[]): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
1
2
|
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
2
3
|
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
3
4
|
import { CallToolResultSchema, ListToolsResultSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
4
|
-
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
5
5
|
import { jsonSchemaToZod } from '@n8n/json-schema-to-zod';
|
|
6
6
|
import { Logger } from './logger.js';
|
|
7
7
|
// Custom error type for MCP server initialization failures
|
|
@@ -108,6 +108,7 @@ async function convertSingleMcpToLangchainTools(serverName, config, logger) {
|
|
|
108
108
|
command: config.command,
|
|
109
109
|
args: config.args,
|
|
110
110
|
env: env,
|
|
111
|
+
stderr: config.stderr
|
|
111
112
|
});
|
|
112
113
|
client = new Client({
|
|
113
114
|
name: "mcp-client",
|
package/dist/logger.d.ts
CHANGED
|
@@ -16,12 +16,11 @@ declare class Logger {
|
|
|
16
16
|
private parseLogLevel;
|
|
17
17
|
private log;
|
|
18
18
|
private formatValue;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
fatal: (...args: unknown[]) => void;
|
|
19
|
+
trace(...args: unknown[]): void;
|
|
20
|
+
debug(...args: unknown[]): void;
|
|
21
|
+
info(...args: unknown[]): void;
|
|
22
|
+
warn(...args: unknown[]): void;
|
|
23
|
+
error(...args: unknown[]): void;
|
|
24
|
+
fatal(...args: unknown[]): void;
|
|
26
25
|
}
|
|
27
26
|
export { Logger, LogLevel, LogLevelString };
|
package/dist/logger.js
CHANGED
|
@@ -49,14 +49,11 @@ class Logger {
|
|
|
49
49
|
return 'undefined';
|
|
50
50
|
return typeof value === 'object' ? JSON.stringify(value, null, 2) : String(value);
|
|
51
51
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
warn = this.createLogMethod(LogLevel.WARN);
|
|
59
|
-
error = this.createLogMethod(LogLevel.ERROR);
|
|
60
|
-
fatal = this.createLogMethod(LogLevel.FATAL);
|
|
52
|
+
trace(...args) { this.log(LogLevel.TRACE, ...args); }
|
|
53
|
+
debug(...args) { this.log(LogLevel.DEBUG, ...args); }
|
|
54
|
+
info(...args) { this.log(LogLevel.INFO, ...args); }
|
|
55
|
+
warn(...args) { this.log(LogLevel.WARN, ...args); }
|
|
56
|
+
error(...args) { this.log(LogLevel.ERROR, ...args); }
|
|
57
|
+
fatal(...args) { this.log(LogLevel.FATAL, ...args); }
|
|
61
58
|
}
|
|
62
59
|
export { Logger, LogLevel };
|