Skip to content

MCP Client Time out when adding specific POST Operation #39

@amantaras

Description

@amantaras

MCP Client Time out when adding specific POST Operation (/redact) Open API specification file at the end of the issue.

I am using MCP Inspector and this is the trace of the error:

Client <-> Proxy sessionId: <REDACTED_SESSION_ID>
Received POST message for sessionId <REDACTED_SESSION_ID>
Received GET message for sessionId <REDACTED_SESSION_ID>
Received POST message for sessionId <REDACTED_SESSION_ID>
Received POST message for sessionId <REDACTED_SESSION_ID>
Error from MCP server: Error: SSE stream disconnected: TypeError: terminated
at processStream (file:///.../node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js:203:88)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error from MCP server: Error: Error POSTing to endpoint (HTTP 500): <title>500 - The request timed out.</title>

500 - The request timed out.

The web server failed to respond within the specified time.
at StreamableHTTPClientTransport.send (file:///.../node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js:284:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error from inspector client: Error: No connection established for request ID: 1
at StreamableHTTPServerTransport.send (file:///.../node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.js:592:27)
at file:///.../node_modules/@modelcontextprotocol/inspector/server/build/mcpProxy.js:32:35
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Browser shows:
index-.js:23222 Uncaught (in promise) McpError: MCP error -32001: Request timed out
at timeoutHandler (index-.js:23222:43)

Open API json that I am using to import (just in case this is the source of problems)

{"openapi":"3.1.0","info":{"title":"Image PII Redactor API","version":"1.0.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/config":{"get":{"summary":"Read Config","operationId":"read_config_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Read Config Config Get"}}}}}}},"/app-config.js":{"get":{"summary":"Runtime Config Js","description":"Serve a small JS snippet with runtime discoverable values.\n\nFrontend loads this before bootstrapping React. Keep it minimal to avoid\nadding latency. If additional config is needed, extend here.","operationId":"runtime_config_js_app_config_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"string","title":"Response Runtime Config Js App Config Js Get"}}}}}}},"/agent/settings":{"get":{"summary":"Read Agent Settings","description":"Return the current chat agent configuration variables.","operationId":"read_agent_settings_agent_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSettingsResponse"}}}}}},"post":{"summary":"Update Agent Settings","description":"Persist chat agent configuration variables and restart the backend agent.","operationId":"update_agent_settings_agent_settings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSettingsUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/redact":{"get":{"summary":"Describe Redact Endpoint","description":"Provide metadata so MCP/APIM clients can discover redact capabilities.","operationId":"describe_redact_endpoint_redact_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedactMetadataResponse"}}}}}},"post":{"tags":["mcp-tools"],"summary":"Redact PII entities from an image","description":"Redacts PII from a base64-encoded PNG/JPEG image. Provide fields such as analyzer, language, all_entities, selected_entities, fill_color, and debug. Returns a redacted image and metadata.","operationId":"redactImage","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedactRequest","properties":{"image_base64":{"type":"string","description":"Base64 encoded PNG or JPEG image to redact."},"analyzer":{"type":"string","enum":["Local Analyzer","Azure AI Language","Local Analyzer + Azure AI Language"],"description":"Preferred analyzer backend. Defaults to automatic selection."},"language":{"type":"string","description":"ISO language code used for OCR and entity detection.","default":"en"},"all_entities":{"type":["string","boolean"],"description":"Set to false to limit redaction to selected_entities.","default":"true"},"selected_entities":{"items":{"type":"string"},"type":["array","null"],"description":"Subset of entity types to redact when all_entities is false."},"fill_color":{"type":"string","description":"Mask colour in hex format (default '#000000').","default":"#000000"},"debug":{"type":["string","boolean"],"description":"Enable verbose detection metadata (true/false).","default":"true"}},"type":"object","required":["image_base64"],"description":"Redaction parameters"},"example":{"image_base64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...","analyzer":"Local Analyzer + Azure AI Language","language":"en","all_entities":"true","selected_entities":["EMAIL_ADDRESS","US_SOCIAL_SECURITY_NUMBER"],"fill_color":"#000000","debug":"false"}},"multipart/form-data":{"schema":{"properties":{"image_base64":{"type":"string","description":"Base64 encoded PNG/JPEG provided as form field."},"analyzer":{"type":"string"},"language":{"type":"string","default":"en"},"all_entities":{"type":"string","default":"true"},"selected_entities":{"type":"string","description":"JSON array string of entity types (required when all_entities=false)."},"fill_color":{"type":"string","default":"#000000"},"debug":{"type":"string","default":"true"}},"type":"object","required":["image_base64"]},"encoding":{"image_base64":{"contentType":"text/plain"},"selected_entities":{"contentType":"application/json"}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Redactimage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"options":{"summary":"Options Redact Endpoint","description":"Return CORS-friendly metadata for discovery clients.","operationId":"options_redact_endpoint_redact_options","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/redact/metadata":{"get":{"tags":["mcp-tools"],"summary":"Describe Redact Endpoint Metadata","description":"MCP discovery endpoint for redact tool.\n\nProvides request schema and usage metadata so MCP/APIM clients\ncan correctly register and expose the redact tool.","operationId":"describe_redact_endpoint_metadata_redact_metadata_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedactMetadataResponse"}}}}}}},"/status":{"get":{"summary":"Status","description":"Expose runtime status for the UI (e.g. Azure availability).","operationId":"status_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Status Status Get"}}}}}}},"/agent/status":{"get":{"summary":"Agent Status","operationId":"agent_status_agent_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentStatusResponse"}}}}}}},"/agent/chat":{"post":{"summary":"Agent Chat","operationId":"agent_chat_agent_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMessageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AgentAttachmentModel":{"properties":{"type":{"type":"string","title":"Type"},"data":{"type":"string","title":"Data"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["type","data"],"title":"AgentAttachmentModel"},"AgentMessageRequest":{"properties":{"message":{"type":"string","minLength":1,"title":"Message"},"threadId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Threadid"},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/AgentAttachmentModel"},"type":"array"},{"type":"null"}],"title":"Attachments"}},"type":"object","required":["message"],"title":"AgentMessageRequest","description":"Payload accepted by the /agent/chat endpoint."},"AgentMessageResponse":{"properties":{"agentId":{"type":"string","title":"Agentid"},"threadId":{"type":"string","title":"Threadid"},"runId":{"type":"string","title":"Runid"}},"type":"object","required":["agentId","threadId","runId"],"title":"AgentMessageResponse","description":"Structured response returned by the chat agent endpoint."},"AgentSettingsResponse":{"properties":{"variables":{"items":{"$ref":"#/components/schemas/AgentSettingsVariable"},"type":"array","title":"Variables"}},"type":"object","title":"AgentSettingsResponse"},"AgentSettingsUpdateItem":{"properties":{"key":{"type":"string","title":"Key"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"}},"additionalProperties":false,"type":"object","required":["key"],"title":"AgentSettingsUpdateItem"},"AgentSettingsUpdateRequest":{"properties":{"variables":{"items":{"$ref":"#/components/schemas/AgentSettingsUpdateItem"},"type":"array","title":"Variables"}},"type":"object","title":"AgentSettingsUpdateRequest"},"AgentSettingsVariable":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"required":{"type":"boolean","title":"Required","default":false},"secret":{"type":"boolean","title":"Secret","default":false},"isSet":{"type":"boolean","title":"Isset","default":false}},"type":"object","required":["key","label"],"title":"AgentSettingsVariable"},"AgentStatusResponse":{"properties":{"ready":{"type":"boolean","title":"Ready"},"agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"},"server_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Server Label"},"server_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Server Url"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools","default":[]},"approval_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Mode"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["ready"],"title":"AgentStatusResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"RedactMetadataResponse":{"properties":{"method":{"type":"string","title":"Method","description":"HTTP verb used to submit redaction requests","default":"POST"},"description":{"type":"string","title":"Description","default":"Submit base64-encoded PNG/JPEG data and optional analyzer controls. See requestSchema for accepted fields."},"request_schema":{"additionalProperties":true,"type":"object","title":"Request Schema"}},"type":"object","title":"RedactMetadataResponse","description":"Describe how clients should interact with the redact endpoint."},"RedactRequest":{"properties":{"image_base64":{"type":"string","title":"Image Base64"},"analyzer":{"type":"string","title":"Analyzer","default":"Local Analyzer + Azure AI Language"},"language":{"type":"string","title":"Language","default":"en"},"all_entities":{"anyOf":[{"type":"string"},{"type":"boolean"}],"title":"All Entities","default":"true"},"selected_entities":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Selected Entities"},"fill_color":{"type":"string","title":"Fill Color","default":"#000000"},"debug":{"anyOf":[{"type":"string"},{"type":"boolean"}],"title":"Debug","default":"true"}},"type":"object","required":["image_base64"],"title":"RedactRequest","description":"Incoming redaction request (tolerant of older/double-encoded clients).\n\nNotes:\n - Some callers (e.g. APIM test console) are sending the entire JSON body as a\n single serialized string. We unwrap that in a model-level validator.\n - "selected_entities" may arrive as a JSON string; we coerce it to a list.\n - Boolean-like fields arrive as strings; we keep them as str for existing\n downstream parsing but accept bools."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}

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