@h1deya/langchain-mcp-tools 0.1.8 → 0.1.10

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.
Files changed (2) hide show
  1. package/README.md +24 -6
  2. package/package.json +6 -3
package/README.md CHANGED
@@ -4,12 +4,30 @@ This package is intended to simplify the use of
4
4
  [Model Context Protocol (MCP)](https://modelcontextprotocol.io/)
5
5
  server tools with LangChain / TypeScript.
6
6
 
7
+ [Model Context Protocol (MCP)](https://modelcontextprotocol.io/),
8
+ introduced by
9
+ [Anthropic](https://www.anthropic.com/news/model-context-protocol),
10
+ extends the capabilities of LLMs by enabling interaction with external tools and resources,
11
+ such as web search and database access.
12
+ Thanks to its open-source nature, MCP has gained significant traction in the developer community,
13
+ with over 400 MCP servers already developed and shared:
14
+
15
+ - [Smithery: MCP Server Registry](https://smithery.ai/)
16
+ - [Glama’s list of Open-Source MCP servers](https://glama.ai/mcp/servers)
17
+
18
+ In the MCP framework, external features are encapsulated in an MCP server
19
+ that runs in a separate process.
20
+ This clear decoupling allows for easy adoption and reuse of
21
+ any of the significant collections of MCP servers listed above.
22
+
23
+ To make it easy for LangChain to take advantage of such a vast resource base,
24
+ this package offers quick and seamless access from LangChain to MCP servers.
25
+
7
26
  It contains a utility function `convertMcpToLangchainTools()`.
8
- This function handles parallel initialization of specified multiple MCP servers
9
- and converts their available tools into an array of
10
- [LangChain-compatible tools](https://js.langchain.com/docs/how_to/tool_calling/).
27
+ This async function handles parallel initialization of specified multiple MCP servers
28
+ and converts their available tools into an array of LangChain-compatible tools.
11
29
 
12
- A python equivalent of this utility library is available
30
+ A python equivalent of this utility is available
13
31
  [here](https://pypi.org/project/langchain-mcp-tools)
14
32
 
15
33
  ## Requirements
@@ -46,8 +64,8 @@ const { tools, cleanup } = await convertMcpToLangchainTools(mcpServers);
46
64
  ```
47
65
 
48
66
  This utility function initializes all specified MCP servers in parallel,
49
- and returns [LangChain Tools](https://api.js.langchain.com/modules/_langchain_core.tools.html)
50
- (`tools: StructuredTool[]`)
67
+ and returns LangChain Tools
68
+ ([`tools: StructuredTool[]`](https://api.js.langchain.com/classes/_langchain_core.tools.StructuredTool.html))
51
69
  by gathering available MCP tools from the servers,
52
70
  and by wrapping them into LangChain tools.
53
71
  It also returns an async callback function (`cleanup: McpServerCleanupFn`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h1deya/langchain-mcp-tools",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "MCP To LangChain Tools Conversion Utility",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -8,8 +8,11 @@
8
8
  "mcp",
9
9
  "mcp-client",
10
10
  "langchain",
11
+ "langchain-typescript",
12
+ "tool-call",
11
13
  "tool-calling",
12
- "typescript"
14
+ "typescript",
15
+ "nodejs"
13
16
  ],
14
17
  "author": "hideya kawahara",
15
18
  "type": "module",
@@ -34,7 +37,7 @@
34
37
  "test": "vitest run",
35
38
  "test:watch": "vitest",
36
39
  "test:coverage": "vitest run --coverage",
37
- "clean": "git clean -fdx"
40
+ "clean": "git clean -fdxn -e .env && read -p 'OK?' && git clean -fdx -e .env"
38
41
  },
39
42
  "dependencies": {
40
43
  "@langchain/core": "^0.3.27",