Using my own OpenAI API key, at almost every new prompt I get this error:
“Unable to reach the model provider
We’re having trouble connecting to the model provider. This might be temporary - please try again in a moment.”
However, restarting Cursor fixes the problem until the next prompt when it happens again. So it’s definitely not a problem with the key - it’s a problem with Cursor.
Steps to Reproduce
Input OpenAI API key (do not use custom URL for API endpoint - although this happens either way). Enter and submit a prompt using an OpenAI model.
Restart Cursor and the next prompt will work. Subsequent prompts will put you back in the same error loop until Cursor is restarted again.
Expected Behavior
It should accept the prompt, and respond without issue.
Update: I had a suspicion and turned off my MCP servers, at which point the issue seemed to go away. So this seems to have something to do with how function/tool definitions are constructed in the OpenAI calls?
Wow thank you for the very quick response.
To answer your question about the OpenAI models, I’ve tried 5.1-codex of various strengths and 5.2 thinking of various strengths (my initial thought was that it was model-specific).
I’ll try to troubleshoot the MCP issue. I’ve noticed that my MCP servers will get flicked on automatically sometimes, so I was offering the agent far too many tools. I’ll turn them on one-by-one over the course of the next few prompts and see what happens.
Here are my MCP definitions (with keys redacted). I’m going to outright remove the Docker MCP toolkit as I haven’t found it very useful. But the github MCP server runs locally in docker (it works fine).
After I deleted the Docker MCP Toolkit I was able to turn the MCP servers on one by one and I didn’t run into the issue again. So perhaps that was it. Apologies for bothering you, if so.
I did notice the the problem is much more prevalent if the custom OpenAI domain button is on, but from a search, I believe this is a known issue.