You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A rather peculiar issue here: I can't make any-chat-completions work alongside mcp-notion-server. This is true for both Claude Desktop and my mcp client. Somehow it depends on the order of initialization of tools.
If I run: uv run python -m mcpcli --telegram --server chat-perplexity --server notion --server filesystem --server todoist, chat-perplexity works normally but notion server fails as all calls to it are being captured by chat-perplexity.
If I run : uv run python -m mcpcli --telegram --server notion --server chat-perplexity --server filesystem --server todoist, notion works fine but chat-perplexity fails as all calls to it are being captured by notion.
I'm specifically including other servers here because they seem to be completely unaffected by this conflict of chat-perplexity and notion. That is, they work fine with either of the two.
Have you any idea of what's happening?
The text was updated successfully, but these errors were encountered:
I think I've found the solution to the conflict between any-chat-completions-mcp and other MCP servers (like Notion). The issue is in how unknown tools are handled.
When running alongside other MCP servers, throwing an error for unknown tools causes the MCP protocol to stop trying other servers. The fix is to return proper error responses:
server.setRequestHandler(CallToolRequestSchema,async(request)=>{try{const{ name,arguments: args}=request.params;if(name===`chat-with-${AI_CHAT_NAME_CLEAN}`){if(!args?.content){thrownewError("Content is required");}constcontent=String(args.content);constclient=newOpenAI({apiKey: AI_CHAT_KEY,baseURL: AI_CHAT_BASE_URL,});constchatCompletion=awaitclient.chat.completions.create({messages: [{role: 'user',content: content}],model: AI_CHAT_MODEL,});return{content: [{type: "text",text: chatCompletion.choices[0]?.message?.content||"No response"}],isError: false};}// For any other tool, return error response instead of throwingreturn{content: [{type: "text",text: `Unknown tool: ${name}`}],isError: true};}catch(error){return{content: [{type: "text",text: `Error: ${errorinstanceofError ? error.message : String(error)}`}],isError: true};}});
Key changes:
Return error responses with isError: true instead of throwing errors
Include descriptive error messages
Add proper error handling for all cases
The fix follows the MCP protocol's expected behavior for tool routing, where servers should signal they can't handle a tool through error responses rather than throwing errors.
A rather peculiar issue here: I can't make any-chat-completions work alongside mcp-notion-server. This is true for both Claude Desktop and my mcp client. Somehow it depends on the order of initialization of tools.
If I run:
uv run python -m mcpcli --telegram --server chat-perplexity --server notion --server filesystem --server todoist
, chat-perplexity works normally but notion server fails as all calls to it are being captured by chat-perplexity.If I run :
uv run python -m mcpcli --telegram --server notion --server chat-perplexity --server filesystem --server todoist
, notion works fine but chat-perplexity fails as all calls to it are being captured by notion.I'm specifically including other servers here because they seem to be completely unaffected by this conflict of chat-perplexity and notion. That is, they work fine with either of the two.
Have you any idea of what's happening?
The text was updated successfully, but these errors were encountered: