From ada788a236abd9e583ed1f94dea32aaa3ee707ee Mon Sep 17 00:00:00 2001 From: oliver Date: Sat, 10 Oct 2026 15:10:46 +0800 Subject: [PATCH] Skip MCP era probe for Bailian-compatible connect. Omit Client versionNegotiation so the SDK stays on legacy initialize; Bailian answers the 2026 server/discover probe with HTTP 500 and never reaches search. Co-authored-by: Cursor --- lib/client.js | 7 +++++-- package.json | 2 +- test/compatibility.test.js | 7 +++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/client.js b/lib/client.js index e3eca38..bdd14e8 100644 --- a/lib/client.js +++ b/lib/client.js @@ -32,9 +32,12 @@ export async function callMcpSearch(server, key, args, signal) { } let runtime; + // Do not opt into MCP 2026 era negotiation. SDK default is legacy (plain + // 2025 initialize, no server/discover probe). Bailian/DashScope answers + // that probe with HTTP 500 and connect fails before any search call. const client = new Client( - { name: 'dsh-search-mcp', version: '0.2.41' }, - { capabilities: {}, versionNegotiation: { mode: 'auto' } }, + { name: 'dsh-search-mcp', version: '0.2.42' }, + { capabilities: {} }, ); try { runtime = server.transport === 'stdio' diff --git a/package.json b/package.json index 63c8a1f..8218edb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dsh-search-mcp", - "version": "0.2.41", + "version": "0.2.42", "description": "Replace dsh's built-in web search with search MCP servers (Tavily / Brave / Exa / Perplexity / DuckDuckGo / custom), configured from the web Settings page. When this plugin is enabled the built-in DeepSeek search provider is disabled.", "type": "module", "main": "lib/index.js", diff --git a/test/compatibility.test.js b/test/compatibility.test.js index 347914a..de0a38d 100644 --- a/test/compatibility.test.js +++ b/test/compatibility.test.js @@ -12,7 +12,7 @@ test('package exports resolve and peerDependencies stay open', async () => { assert.equal(pkg.exports['.'], './lib/index.js') assert.equal(pkg.exports['./client'], './lib/client.browser.js') assert.equal(pkg.engines.node, '>=20') - assert.equal(pkg.version, '0.2.41') + assert.equal(pkg.version, '0.2.42') assert.equal(pkg.dsh.client.immediately, false) assert.equal(pkg.dependencies['@modelcontextprotocol/client'], '2.0.0') assert.ok(!Object.hasOwn(pkg.dependencies, '@modelcontextprotocol/sdk')) @@ -99,7 +99,10 @@ test('HTTP transport inherits DSH proxy with env fallback and pins DNS on direct assert.match(transport, /parseHttpEndpoint/) assert.match(transport, /validateHttpEndpoint\(server\.url, \{ signal \}\)/) assert.match(transport, /redirect: 'error'/) - assert.match(transport, /versionNegotiation:\s*\{\s*mode:\s*['"]auto['"]/) + // Bailian rejects the MCP 2026 era probe (HTTP 500); keep Client options + // at legacy default (capabilities only — no negotiation field). + assert.match(transport, /\{\s*capabilities:\s*\{\s*\}\s*\}/) + assert.doesNotMatch(transport, /mode:\s*['"]auto['"]/) }) test('bundle inserts search-mcp without pinning web.searchProvider (Desktop 0.2 boot-safe)', async () => {