@h1deya/langchain-mcp-tools 0.3.9 → 0.4.1
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 +18 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,10 +91,10 @@ to be invoked to close all MCP server sessions when finished.
|
|
|
91
91
|
The returned tools can be used with LangChain, e.g.:
|
|
92
92
|
|
|
93
93
|
```ts
|
|
94
|
-
// import {
|
|
94
|
+
// import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
|
|
95
95
|
const model = new ChatGoogleGenerativeAI({ model: "gemini-2.5-flash" });
|
|
96
96
|
|
|
97
|
-
// import {
|
|
97
|
+
// import { createAgent } from "langchain";
|
|
98
98
|
const agent = createAgent({
|
|
99
99
|
model,
|
|
100
100
|
tools
|
|
@@ -167,10 +167,25 @@ While MCP tools can return multiple content types (text, images, etc.), this lib
|
|
|
167
167
|
|
|
168
168
|
- **LLM Compatibility and Schema Transformations**: The library can perform schema transformations for LLM compatibility.
|
|
169
169
|
[See below](https://github.com/hideya/langchain-mcp-tools-ts/blob/main/README.md#llm-provider-schema-compatibility) for details.
|
|
170
|
-
- **Passing PATH Env Variable**: The library automatically adds the `PATH` environment variable to stdio server configrations if not explicitly provided to ensure servers can find required executables.
|
|
170
|
+
- **Passing PATH Env Variable**: The library automatically adds the `PATH` environment variable to local (stdio) server configrations if not explicitly provided to ensure servers can find required executables.
|
|
171
171
|
|
|
172
172
|
## Features
|
|
173
173
|
|
|
174
|
+
### Environment Variable Configuration for Local MCP Server
|
|
175
|
+
|
|
176
|
+
If you need to pass an API key or other configurations to a local MCP server
|
|
177
|
+
via environment variables, use this example as a guide:
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
brave: {
|
|
181
|
+
command: "npx",
|
|
182
|
+
args: [ "-y", "@modelcontextprotocol/server-brave-search"],
|
|
183
|
+
env: { "BRAVE_API_KEY": `${process.env.BRAVE_API_KEY}` }
|
|
184
|
+
},
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Note**: The library automatically adds the `PATH` environment variable to local (stdio) server configrations, if not explicitly provided, to ensure servers can find required executables.
|
|
188
|
+
|
|
174
189
|
### `stderr` Redirection for Local MCP Server
|
|
175
190
|
|
|
176
191
|
A new key `"stderr"` has been introduced to specify a file descriptor
|