Skip to content

Commit 157b2ce

Browse files
committed
Update to ver 0.3.6
1 parent ba7760d commit 157b2ce

6 files changed

Lines changed: 45 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ 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+
- More log messages for remote servers
13+
14+
### Changed
15+
- Update the descriptions of the schema compatibility issue in README.md
16+
17+
818
## [0.3.5] - 2025-08-23
919

1020
### Added

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,24 +331,24 @@ Different LLM providers have incompatible JSON Schema requirements for function
331331
- **Google Gemini API**: Rejects nullable fields and `$defs` references, requires strict OpenAPI 3.0 subset compliance
332332
- **Anthropic Claude** and **xAI Grok**: Very relaxed schema requirements with no documented restrictions
333333

334-
**Note**: Google Vertex AI provides OpenAI-compatible endpoints that support nullable fields.
334+
**Note**: Google Vertex AI provides OpenAI-compatible endpoints that support more relaxed requirements.
335335

336336
#### Real-World Impact
337337

338338
This creates challenges for developers trying to create universal schemas across providers.
339339

340340
Many MCP servers generate schemas that don't satisfy all providers' requirements.
341-
For example, the official Notion MCP server [@notionhq/notion-mcp-server](https://www.npmjs.com/package/@notionhq/notion-mcp-server) (as of Jul 2, 2025) produces:
341+
For example, the official Notion local MCP server [@notionhq/notion-mcp-server](https://www.npmjs.com/package/@notionhq/notion-mcp-server) (version 1.9.0) and the remote server (at "https://mcp.notion.com/mcp", via "mcp-remote 0.1.18") produces:
342342

343343
**OpenAI Warnings:**
344344
```
345-
Zod field at `#/definitions/API-get-users/properties/start_cursor` uses `.optional()` without `.nullable()` which is not supported by the API. See: https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#all-fields-must-be-required
345+
Zod field at `#/definitions/read_file/properties/tail` uses `.optional()` without `.nullable()` which is not supported by the API. See: https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#all-fields-must-be-required
346346
... followed by many more
347347
```
348348

349349
**Gemini Errors:**
350350
```
351-
GoogleGenerativeAIFetchError: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent: [400 Bad Request] * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[children].items.properties[paragraph].properties[rich_text].items.properties[mention].any_of[0].required: only allowed for OBJECT type
351+
[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent: [400 Bad Request] Invalid JSON payload received. Unknown name "exclusiveMaximum" at 'tools[0].function_declarations[14].parameters.properties[1].value': Cannot find field.
352352
... followed by many more
353353
```
354354

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@h1deya/langchain-mcp-tools",
3-
"version": "0.3.5",
3+
"version": "0.3.6",
44
"description": "MCP To LangChain Tools Conversion Utility",
55
"license": "MIT",
66
"keywords": [

src/langchain-mcp-tools.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,23 @@ async function convertSingleMcpToLangchainTools(
422422
transport = await createHttpTransportWithFallback(url, urlConfig, logger, serverName);
423423
logger.info(`MCP server "${serverName}": created transport, attempting connection`);
424424

425+
// Set up message and error handlers
426+
transport.onmessage = (message) => {
427+
logger.debug(`MCP server "${serverName}": Message Received:`, JSON.stringify(message, null, 2));
428+
}
429+
430+
transport.onerror = (error) => {
431+
// FIXME: somehow git remote server seems to send error with "{}" after closing
432+
if (Object.keys(error).length === 0) {
433+
return;
434+
}
435+
logger.error(`MCP server "${serverName}":`, error);
436+
}
437+
438+
transport.onclose = () => {
439+
logger.info(`MCP server "${serverName}": remote connection closed`);
440+
}
441+
425442
} else if ((transportType === "ws" || transportType === "websocket") ||
426443
(!transportType && (url?.protocol === "ws:" || url?.protocol === "wss:"))
427444
) {

testfiles/simple-usage.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,11 @@ export async function test(): Promise<void> {
109109
// }
110110
// },
111111

112-
// notion: {
113-
// "command": "npx",
114-
// "args": ["-y", "@notionhq/notion-mcp-server"],
115-
// "env": {
116-
// // Although the following implies that this MCP server is designed for
117-
// // OpenAI LLMs, it works fine with others models.
118-
// // Tested Claude and Gemini (with schema adjustments).
119-
// "OPENAPI_MCP_HEADERS": `{"Authorization": "Bearer ${process.env.NOTION_INTEGRATION_SECRET}", "Notion-Version": "2022-06-28"}`
120-
// },
121-
// },
122-
112+
// The following Notion local MCP server is not recommended anymore?
113+
// Refs:
114+
// - https://developers.notion.com/docs/get-started-with-mcp
115+
// - https://www.npmjs.com/package/@notionhq/notion-mcp-server
116+
//
123117
// "notion": {
124118
// "command": "npx",
125119
// "args": ["-y", "@suekou/mcp-notion-server"],
@@ -128,6 +122,12 @@ export async function test(): Promise<void> {
128122
// }
129123
// },
130124

125+
// Run Notion remote MCP server via mcp-remote
126+
// "notionMCP": {
127+
// "command": "npx",
128+
// "args": ["-y", "mcp-remote", "https://mcp.notion.com/mcp"],
129+
// },
130+
131131
// sqlite: {
132132
// command: "uvx",
133133
// args: [

0 commit comments

Comments
 (0)