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 <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-10-10 15:10:46 +08:00
parent 4b4a1e4460
commit ada788a236
3 changed files with 11 additions and 5 deletions

View file

@ -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'