Skip to content

Support binary API responses - #125

Open
Tsopic wants to merge 1 commit into
anyproto:mainfrom
Tsopic:codex/binary-response-support
Open

Support binary API responses#125
Tsopic wants to merge 1 commit into
anyproto:mainfrom
Tsopic:codex/binary-response-support

Conversation

@Tsopic

@Tsopic Tsopic commented Jul 10, 2026

Copy link
Copy Markdown

Summary

  • Detect binary success responses from the loaded OpenAPI operation and request them as Axios arraybuffer data.
  • Return image/* downloads as MCP image content.
  • Return PDF and other binary downloads as embedded MCP resources with MIME type and base64 data.
  • Preserve JSON/text success responses and structured JSON/text errors, including on binary-capable operations.

This makes the REST Files API download operation usable through MCP instead of JSON-stringifying or corrupting binary response bytes.

Closes #15.

Testing

  • npm run lint
  • npm run typecheck
  • npm test — 9 files, 95 tests passed
  • npm run build

New coverage verifies direct and referenced binary OpenAPI responses, Axios binary response configuration, image/PDF content, MIME handling, base64 encoding, JSON success variants, and structured JSON/text errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude Desktop cannot access files through localhost gateway URLs returned by AnyType MCP

1 participant