Skip to content

Commit 6006292

Browse files
author
hideya
committed
Update to ver 0.3.6
1 parent ded61ed commit 6006292

File tree

7 files changed

+64
-25
lines changed

7 files changed

+64
-25
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
9+
## [0.3.6] - 2025-08-24
10+
11+
### Added
12+
- "schema_transformations" flag to the config file to check the effect of
13+
the transformations.
14+
15+
816
## [0.3.5] - 2025-08-23
917

1018
### Added

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ See [README_DEV.md](https://github.com/hideya/mcp-client-langchain-ts/blob/main/
101101
- **Multiple LLM providers**: OpenAI, Anthropic, Google (GenAI)
102102
- **Schema Compatibility Support**: Automatically adjusts tools schema for LLM compatibility, which can help some failing MCP servers run successfully.
103103
See [this page](https://github.com/hideya/langchain-mcp-tools-ts/blob/main/README.md#llm-provider-schema-compatibility)
104-
for details.
104+
for details.
105+
If you want to disable the schema trnaformations, add `"schema_transformations": false,` to the top level of the config file.
105106
- **Command & URL servers**: Support for both local and remote MCP servers
106107
- **Real-time logging**: Live stdio MCP server logs with customizable log directory
107108
- **Interactive testing**: Example queries for the convenience of repeated testing
@@ -243,6 +244,12 @@ Create a `llm_mcp_config.json5` file:
243244
"headers": {
244245
"Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}"
245246
}
247+
},
248+
249+
// To connect a remote MCP server with OAuth, use "mcp-remote"
250+
"notionMCP": {
251+
"command": "npx",
252+
"args": ["-y", "mcp-remote", "https://mcp.notion.com/mcp"],
246253
}
247254
}
248255
}

llm_mcp_config.json5

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Keep all the credentials and private into the `.env` file
66
// and refer to them with `${...}` notation as needed.
77
{
8+
// "schema_transformations": false,
9+
810
// "llm": {
911
// // https://docs.anthropic.com/en/docs/about-claude/pricing
1012
// // https://console.anthropic.com/settings/billing
@@ -19,8 +21,8 @@
1921
// // https://platform.openai.com/docs/pricing
2022
// // https://platform.openai.com/settings/organization/billing/overview
2123
// "provider": "openai",
22-
// "model": "gpt-4.1-nano",
23-
// // "model": "gpt-5-mini",
24+
// // "model": "gpt-4.1-nano",
25+
// "model": "gpt-5-mini",
2426
// // "temperature": 0.0, // 'temperature' is not supported with "o4-mini"
2527
// // "max_completion_tokens": 10000, // Use 'max_completion_tokens' instead of 'max_tokens'
2628
// },
@@ -61,6 +63,7 @@
6163
"Are there any weather alerts in California?",
6264
// "What's the news from Tokyo today?",
6365
// "Open the webpage at bbc.com",
66+
// "Tell me how many github repositories I have?"
6467
// "Tell me about my Notion account",
6568
],
6669

@@ -118,8 +121,6 @@
118121
// "Authorization": "Bearer ${GITHUB_PERSONAL_ACCESS_TOKEN}"
119122
// }
120123
// },
121-
// // NOTE: When accessing the GitHub MCP server, [GitHub PAT (Personal Access Token)](https://github.com/settings/personal-access-tokens)
122-
// // alone is not enough; your GitHub account must have an active Copilot subscription or be assigned a Copilot license through your organization.
123124

124125
// // https://github.com/microsoft/playwright-mcp
125126
// "playwright": {
@@ -134,15 +135,23 @@
134135
// "env": { "BRAVE_API_KEY": "${BRAVE_API_KEY}" }
135136
// },
136137

137-
// notion: {
138-
// "command": "npx",
139-
// "args": ["-y", "@notionhq/notion-mcp-server"],
140-
// "env": {
141-
// // Although the following implies that this MCP server is designed for
142-
// // OpenAI LLMs, it works fine with others models.
143-
// // Tested with Claude and Gemini (with schema adjustments).
144-
// "OPENAPI_MCP_HEADERS": '{"Authorization": "Bearer ${NOTION_INTEGRATION_SECRET}", "Notion-Version": "2022-06-28"}'
145-
// },
138+
// The following Notion local MCP server is not recommended anymore?
139+
// Refs:
140+
// - https://developers.notion.com/docs/get-started-with-mcp
141+
// - https://www.npmjs.com/package/@notionhq/notion-mcp-server
142+
//
143+
// "notionApi": {
144+
// "command": "npx",
145+
// "args": ["-y", "@notionhq/notion-mcp-server"],
146+
// "env": {
147+
// "NOTION_TOKEN": "${NOTION_INTEGRATION_SECRET}"
148+
// }
146149
// },
150+
151+
// Run Notion remote MCP server via mcp-remote
152+
// "notionMCP": {
153+
// "command": "npx",
154+
// "args": ["-y", "mcp-remote", "https://mcp.notion.com/mcp"],
155+
// }
147156
}
148157
}

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@h1deya/mcp-client-cli",
3-
"version": "0.3.5",
3+
"version": "0.3.6",
44
"description": "Simple MCP Client to quickly test and explore MCP servers from the command line",
55
"license": "MIT",
66
"keywords": [
@@ -52,7 +52,7 @@
5252
"publish:do": "npm run publish:prepare && npm publish --access=public"
5353
},
5454
"dependencies": {
55-
"@h1deya/langchain-mcp-tools": "^0.3.5",
55+
"@h1deya/langchain-mcp-tools": "^0.3.6",
5656
"@langchain/anthropic": "^0.3.11",
5757
"@langchain/cerebras": "^0.0.3",
5858
"@langchain/core": "^0.3.61",

src/index.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ function addLogFileWatcher(logPath: string, serverName: string) {
160160

161161
const watcher = fs.watch(logPath, (eventType: string, filename: unknown) => {
162162
if (eventType === 'change') {
163-
// console.log(`*** file updated: "${filename}"`);
164163
const stats = fs.statSync(logPath);
165164
const currentSize = stats.size;
166165
if (currentSize > lastSize) {
@@ -181,11 +180,11 @@ function addLogFileWatcher(logPath: string, serverName: string) {
181180

182181
// Application initialization
183182
async function initializeReactAgent(config: Config, verbose: boolean, logDir: string) {
184-
const llmProvider = config.llm.provider as LlmProvider;
183+
const llmApiProvider = config.llm.provider as LlmProvider;
185184

186185
console.log("Initializing model...", config.llm, "\n");
187186
const llmConfig = {
188-
modelProvider: llmProvider,
187+
modelProvider: llmApiProvider,
189188
model: config.llm.model,
190189
temperature: config.llm.temperature,
191190
maxTokens: config.llm.max_tokens,
@@ -213,6 +212,14 @@ async function initializeReactAgent(config: Config, verbose: boolean, logDir: st
213212
}
214213
});
215214

215+
const schemaTransformations =
216+
(config.schema_transformations === undefined) || config.schema_transformations;
217+
218+
const llmProvider = schemaTransformations && (llmApiProvider === "openai" ||
219+
llmApiProvider === "google_gemini" || llmApiProvider === "google_genai" ||
220+
llmApiProvider === "anthropic" || llmApiProvider === "xai")
221+
? llmApiProvider : "none" as LlmProvider;
222+
216223
const toolsAndCleanup = await convertMcpToLangchainTools(
217224
config.mcp_servers,
218225
{ llmProvider, logLevel: verbose ? "debug" : "info" }

src/load-config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export interface Config {
3939
mcp_servers: {
4040
[key: string]: MCPServerConfig;
4141
}
42+
schema_transformations?: boolean;
4243
}
4344

4445
export function loadConfig(path: string): Config {
@@ -61,6 +62,7 @@ export function loadConfig(path: string): Config {
6162
delete config.llm.model_provider;
6263
}
6364
console.log(config);
65+
console.log(config.schema_transformations);
6466

6567
// Validate required fields
6668
validateConfig(config);
@@ -107,6 +109,12 @@ function validateConfig(config: unknown): asserts config is Config {
107109
throw new Error(`Invalid configuration for MCP server "${key}": ${error instanceof Error ? error.message : String(error)}`);
108110
}
109111
});
112+
113+
if ("schema_transformations" in config) {
114+
if (typeof config.schema_transformations !== "boolean") {
115+
throw new Error("schema_transformations must be a boolean if provided");
116+
}
117+
}
110118
}
111119

112120
function validateLLMConfig(llmConfig: unknown): asserts llmConfig is LLMConfig {

0 commit comments

Comments
 (0)