Issue with MCP server integration and third-party models (Gemini, ChatGPT, Claude, …)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Hi Cursor support team,

I’m running into a persistent issue when using my custom MCP server with third-party AI models in Cursor.

  • The issue happens whenever I pick a specific model (like Gemini, ChatGPT, or Claude). In that case, Cursor shows this error:

    The model returned an error. Try disabling MCP servers, or switch models.

  • But when the model is set to “Auto”, my MCP server works fine.

Steps to Reproduce

  1. Enable the MCP server “facturation-pro” in Cursor.

  2. Select a specific third-party AI model (e.g. Gemini, ChatGPT, Claude) in the chat.

  3. Submit any prompt in the chat.

Expected Behavior

Expected behavior would be:

  • The message “The model returned an error. Try disabling MCP servers, or switch models.” should not appear.

  • When I call the MCP (asking for an invoice or a quote), it should work — but that’s secondary, since as soon as the MCP is enabled and its tools are detected, no message can be sent to ChatGPT, Claude, or Gemini anyway.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.5.11 (Universal)
VSCode Version: 1.99.3
Commit: 2f2737de9aa376933d975ae30290447c910fdf40
Date: 2025-09-05T03:48:32.332Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 25.0.0

For AI issues: which model did you use?

Any model fail, except auto

For AI issues: add Request ID with privacy disabled

Request ID: 831dfb76-5beb-451b-a100-450cdd217caa

Additional Information

My MCP server is a Node.js implementation using stdio transport. I went deep into debugging to make sure it fully respects JSON-RPC 2.0 and doesn’t pollute stdout with non-JSON content.

  • JSON-RPC 2.0 compliance: All responses are valid JSON-RPC 2.0, including proper error structures with the original request id. Notifications (notifications/) don’t receive responses, as required.

  • Logging: All debug/error logs (from my server and dependencies) go to stderr. stdout is strictly reserved for JSON-RPC messages. Non-JSON outputs (including emojis) have been removed.

  • Environment (.env): Verified that environment vars (MCP_DEBUG) load correctly via dotenv and are respected by conditional loggers.

  • Server behavior: The server initializes fine, lists tools (tools/list works with no visible errors), and looks ready to go — but the error pops up specifically when I try using third-party models.

Here’s my MCP repo in case you want to check the implementation:

I’d really appreciate it if you could look into this. Happy to provide more details or run extra tests if needed.

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor


Bug report (fixed)

What was breaking (non-auto agents)
Some agents didn’t list or call my MCP tools, while “auto” worked fine. Tools either didn’t show up or crashed when optional args were missing.

Root cause (my mistake)

  • Invalid JSON Schema: I put required inside each property. JSON Schema wants required as a root array. “auto” was forgiving, others weren’t.

  • Fragile arg handling: I assumed args would always be an object. Some agents send none if all params are optional, so destructuring failed.

Fix (agent-agnostic)

  • Built proper JSON Schema: move required to root, strip from properties, add additionalProperties: false.

  • Normalized args with args || {}.

  • Made validation accept empty args.

Now it work!

1 Like

Thank you, I’m glad you were able to find and fix the issue by yourself :slight_smile: