Custom MCP Server not working with GPT-5 nor GPT-4o

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When trying to ask something using GPT-5 and have the MCP Server we are creating enabled it returns: The model returned an error. Try disabling MCP servers, or switch models. (Request ID: 6a7b3f47-37fb-44ee-8fc1-f246df3803dc)

Steps to Reproduce

  1. Enable the MCP Server (note this MCP Server works perfectly well in Auto mode)
  2. Open the Chat screen and type “Hi!”
  3. There is an error saying: The model returned an error. Try disabling MCP servers, or switch models. (Request ID: xxx)

Expected Behavior

The expected behavior would be to reply “Hi, how can I help you?”

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 24.6.0

For AI issues: which model did you use?

GPT-5 and GPT-4o

For AI issues: add Request ID with privacy disabled

Request ID: df5145ce-61d1-4c3c-8d2b-7eceaa826154

Additional Information

This was also reported here: GPT5 can't use MCP - #4 by condor

Request info:

Request ID: df5145ce-61d1-4c3c-8d2b-7eceaa826154
{"error":"ERROR_CUSTOM_MESSAGE","details":{"title":"Model returned error","detail":"The model returned an error. Try disabling MCP servers, or switch models.","additionalInfo":{},"buttons":[],"planChoices":[]},"isExpected":true}
ConnectError: [invalid_argument] Error
    at iol.$endAiConnectTransportReportError (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4814:319459)
    at Zhr._doInvokeHandler (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:488:212075)
    at Zhr._invokeHandler (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:488:211817)
    at Zhr._receiveRequest (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:488:210582)
    at Zhr._receiveOneMessage (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:488:209404)
    at O_t.value (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:488:207498)
    at ye._deliver (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:49:2962)
    at ye.fire (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:49:3283)
    at Prt.fire (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4801:12154)
    at MessagePort.<anonymous> (vscode-file://vscode-app/Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:6983:18168)

The setup of the MCP Server is as follows:

"my-mcp": {
      "command": "npx",
      "args": [
            "-y",
            "mcp-remote",
            "https://integrations.someurl.com/mcp/",
            "--header",
            "x-mcd-id:XXX",
            "--header",
            "x-mcd-token: YYY"
      ]
    }

Does this stop you from using Cursor

Yes - Cursor is unusable

hi @Federico_Benitez and welcome to Cursor Forum.
Thank you for your bug report.

Have you tried the MCP Logs in the bottom pane to see if any errors occur or which MCP response could have created that?

image

Hi @condor ,
Thanks for coming back.

Yes, there are no outputs generated in the logs.

I even tried changing from customer headers to use the “Authorization” header with a Bearer token but still does not work.

```
“my-mcp”: {

  "command": "npx",

“args”: [

“-y”,

“mcp-remote”,

someurl.com — /mcp/”,

“–header”,

“Authorization: Bearer XXX:YYY”

  \]

}

```

Thank you for the update.

Have you tried the MCP in other AI setups/integrations or in the MCP inspector to see if the request to MCP or response works and if the issue happens on when your MCP is getting queried or when it responds?

Yes, the MCP Server works in Cursor with other models and with inspector. I now just made progress trying the MCP Server in OpenAI playground and I got this error:

I disabled that Tool in Cursor and now it works. I need to understand why the schema is not working for that tool.

It would be great if Cursor can provide a similar error message as this issue was very difficult to find without that message from OpenAI Playground.

I have another question that might be you can help me with, is there a way to setup my MCP Server in cursor to pass the Authorization header without having to use the remote-mcp MCP Client?

The current implementation lists following Authentication options:

"names": {
                            "type": "array",
                            "description": "A list of names",
                        }

But you need to specify the items type as well, so it should be like this:

"names": {
                            "type": "array",
                            "items": {"type": "string"},
                            "description": "A list of names.",
                        },

This fixed the issue.

Yes, it says:

MCP servers use environment variables for authentication. Pass API keys and tokens through the config.Cursor supports OAuth for servers that require it.

So, I have my remote server and I want to pass the API Keys, how do I do it? I am doing it using remote-mcp MCP Client but I prefer NOT to use an external dependency if it is not needed.

You can add OAuth to your server

For different reasons we do not want to do that. So there is no way to pass the API token natively?

1 Like

@Federico_Benitez currently not as header, but we have this feature request on the list. Others use gateways like you do.

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.