Skip to content

resource content type blob/text silently dropped in all --output modes #108

@piezox

Description

@piezox

Bug

When an MCP tool returns a { type: "resource", resource: { uri, mimeType, text } } content item, the resource text/blob is silently dropped across all --output modes. The result is either empty output or a truncated [Object] placeholder with no accessible content.

Reproduction

Using the GitHub MCP server (github.get_file_contents):

# plain output
mcporter call github.get_file_contents owner=myorg repo=myrepo path=docs/README.md
# Output: "successfully downloaded text file (SHA: abc123)"
# File content: MISSING

# --output json
mcporter call github.get_file_contents owner=myorg repo=myrepo path=docs/README.md --output json
# Output: { content: [ { type: 'text', text: 'successfully downloaded...' }, { type: 'resource', resource: [Object] } ] }
# resource blob: [Object] -- Node.js truncation, content unreachable

The actual MCP server response (verified by calling the SSE endpoint directly with curl) contains:

{
  "type": "resource",
  "resource": {
    "uri": "repo://org/repo/sha/.../path",
    "mimeType": "text/plain; charset=utf-8",
    "text": "...full file contents here..."
  }
}

Workaround

Calling the SSE endpoint directly with curl bypasses mcporter and returns full content.

Expected Behavior

  • --output text / --output markdown: render resource.text or decode resource.blob
  • --output json / --output raw: include the full resource object, not a Node.js [Object] truncation

Environment

  • mcporter 0.7.3, Node v22.22.1, Linux x64
  • GitHub MCP server via HTTP/SSE transport

Root Cause Hypothesis

Output renderers likely only handle type: "text" and type: "image". The type: "resource" content items appear to have no renderer -- the text/blob fields inside are never extracted. The --output raw path compounds this by using Node.js object serialization which truncates nested objects as [Object].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions