Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Issue with custom MCP server #2389

Unanswered
ksawaray asked this question in Q&A
Discussion options

Hi there,

I'm encountering an issue when trying to use a custom MCP server created with fastMCP for tool calls via client.responses.create().

  • OpenAI version: 1.82.1
  • Python version: 3.11.10
from openai import OpenAI
openai_api_key = os.getenv("OPENAI_API_KEY")
client = OpenAI(api_key=openai_api_key)
messages = [{"role": "user", "content": "xxxxxxx"}]
tools = [
 {
 "type": "mcp",
 "server_label": "<server label>",
 "server_url": "http://<my domain>:<port>/mcp",
 "require_approval": "never",
 }
]
response = client.responses.create(
 model="gpt-4o",
 input=messages,
 tools=tools
)

When I execute the code, I get the following error.

openai.APIStatusError: Error code: 424 - {'error': {'message': "Error retrieving tool list from MCP server: 'xxxxxxx'. Http status code: 424 (Failed Dependency)", 'type': 'external_connector_error', 'param': 'tools', 'code': 'http_error'}}

Could you please help me understand the root cause of this 424 Failed Dependency error when using a custom MCP server, and how to resolve it?
(Is the issue perhaps related to this library sending requests to https://api.openai.com/v1/responses?)

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /