Skip to content

adding MCP server to OpenAI Tools not working #255

@Telemarker77

Description

@Telemarker77

I've been trying for hours to get AOpenAI "playground to simply connect to my NLWeb MCP server (default).

I am using the mcp_handler.py code that is on the microsoft/NLWeb repo.

OpenAI sends this :
{ "jsonrpc": "2.0", "method": "initialize", "id": 1, "params": { "protocolVersion": "2025-03-26", "capabilities": {}, "clientInfo": { "name": "openai-mcp", "version": "1.0.0" } } }

and the NLWeb server sends back :

400

{ "type": "function_response", "status": "error", "error": "Unknown function: None" }

Image

Image

Image

and this was my terminal output:

2025-07-03 05:59:00,664 - core.mcp_handler - ERROR - logger:151 - Empty MCP request body Empty MCP request body 2025-07-03 05:59:03,648 - core.mcp_handler - ERROR - logger:151 - Empty MCP request body Empty MCP request body 2025-07-03 05:59:07,319 - core.mcp_handler - ERROR - logger:151 - Empty MCP request body Empty MCP request body 2025-07-03 05:59:13,021 - core.mcp_handler - ERROR - logger:151 - Empty MCP request body Empty MCP request body 2025-07-03 05:59:15,598 - core.mcp_handler - ERROR - logger:151 - Empty MCP request body Empty MCP request body 2025-07-03 05:59:18,381 - core.mcp_handler - ERROR - logger:151 - Empty MCP request body Empty MCP request body 2025-07-03 05:59:22,465 - core.mcp_handler - ERROR - logger:151 - Empty MCP request body Empty MCP request body 2025-07-03 05:59:28,300 - core.mcp_handler - ERROR - logger:151 - Empty MCP request body Empty MCP request body

WHne I use the /static/mcp_test.html tool it works fine:

POST/mcp
{
"function_call": {
"name": "ask",
"arguments": "{"query":"I have a really bad headache","query_id":"query_1751522226795_k82oehe6j"}"
}
}

200 response with expected payload:

{
"type": "function_response",
"status": "success",
"response": {
"asking_sites": {
"message": "Asking Medicines, Healthdirect, Pregnancy-birth-and-baby"
},
"results": [
{
"url": "https://headacheaustralia.org.au/",
"name": "",
"site": "Partner-Website",
"siteUrl": "Partner-Website",
"score": 85,
"description": "Migraine and Headache Australia is an organization dedicated to providing information and support related to headaches and migraines.",
"schema_object": {
"url": "https://headacheaustral....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions