Hey, I'm trying POC for fetching tools on MCP server usecase... by following below documentations link:
https://www.promptfoo.dev/docs/providers/openai/
https://github.com/promptfoo/promptfoo/blob/main/examples/openai-mcp/promptfooconfig.approval.yaml
I'm getting below error::
API error: 424 Failed Dependency
{"error":{"message":"Error retrieving tool list from MCP server: 'wm-app-mcp-server'. Http status code: 424 (Failed Dependency)","type":"external_connector_error","param":"tools","code":"http_error"}}
Below is my mcp server logic exposed with add_number tool:
import os
from mcp.server import FastMCP
mcp = FastMCP(name= "wm-app-mcp-server")
@mcp.tool()
def add_numbers(a: int, b: int) -> int:
""" Returns the sum of two numbers
"""
return a + b
def main():
mcp.settings.host="0.0.0.0"
mcp.settings.port=8080
mcp.settings.debug=True
mcp.run(transport="sse")
mcp.expose_tools_endpoint=True
if __name__ == "__main__":
main()
And my promptfoo yaml file has below provider info:
providers:
# Provider with no approval required
- id: openai:responses:gpt-4.1-2025-04-14
label: 'WM MCP Server'
config:
tools:
- type: mcp
server_label: wm-app-mcp-server
server_url:
http://localhost:8080/sse
require_approval: never
max_output_tokens: 1000
temperature: 0.2
instructions: 'You are an assistant. Use the available MCP tools to search for information.'
Can some one help me in resolving the error? Before running the test in promptfoo the server is made up and running but still I'm getting 424 status code error while fetching tools.