@h1deya/langchain-mcp-tools 0.1.2 → 0.1.3
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 +6 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,10 +16,10 @@ npm i @h1deya/langchain-mcp-tools
|
|
|
16
16
|
## Quick Start
|
|
17
17
|
|
|
18
18
|
`convertMcpToLangchainTools()` utility function accepts MCP server configuration
|
|
19
|
-
|
|
20
|
-
[Claude for Desktop](https://modelcontextprotocol.io/quickstart/user)
|
|
21
|
-
|
|
22
|
-
e.g.:
|
|
19
|
+
that follows the same structure as
|
|
20
|
+
[Claude for Desktop](https://modelcontextprotocol.io/quickstart/user),
|
|
21
|
+
but only the contents of the `mcpServers` property,
|
|
22
|
+
and is expressed as a JS Object, e.g.:
|
|
23
23
|
|
|
24
24
|
```ts
|
|
25
25
|
const mcpServers: McpServersConfig = {
|
|
@@ -42,7 +42,7 @@ const mcpServers: McpServersConfig = {
|
|
|
42
42
|
const { tools, cleanup } = await convertMcpToLangchainTools(mcpServers);
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
The utility function initializes all
|
|
45
|
+
The utility function initializes all specified MCP servers in parallel,
|
|
46
46
|
and returns LangChain Tools (`tools: DynamicStructuredTool[]`)
|
|
47
47
|
by gathering all the available MCP server tools,
|
|
48
48
|
and by wrapping them into [LangChain Tools](https://js.langchain.com/docs/how_to/tool_calling/).
|
|
@@ -52,6 +52,7 @@ which is used to close all the connections to the MCP servers when finished.
|
|
|
52
52
|
The returned tools can be used with LangChain, e.g.:
|
|
53
53
|
|
|
54
54
|
```ts
|
|
55
|
+
// import { ChatAnthropic } from '@langchain/anthropic';
|
|
55
56
|
const llm = new ChatAnthropic({ model: 'claude-3-5-haiku-latest' });
|
|
56
57
|
|
|
57
58
|
// import { createReactAgent } from '@langchain/langgraph/prebuilt';
|