Skip to content

[BUG] [v0.0.7] cortex-mcp-types embedded resource annotations are silently dropped on round-trip #53324

@marvinayisi

Description

@marvinayisi

Project

cortex

Description

A valid embedded MCP resource with top-level annotations deserializes into Content, but the annotations disappear when the value is serialized again.

Error Message

EMBEDDED_RESOURCE_ANNOTATIONS_ROUNDTRIP={
  "type": "resource",
  "resource": {
    "uri": "file:///tmp/demo.txt",
    "text": "hello"
  }
}

Debug Logs

N/A

System Information

Cortex crate: cortex-mcp-types 0.0.7
Commit: 7954d02
Date: 2026-04-10
OS: macOS

Screenshots

https://github.com/marvinayisi/issue-images/blob/main/mcp-embedded-resource-annotations-20260410-074112.png

Steps to Reproduce

  1. Create a tiny Rust crate depending on cortex-mcp-types from this workspace.
  2. Deserialize an embedded resource content block that includes valid top-level annotations.
  3. Serialize the Content back to JSON and inspect the output.

Expected Behavior

The embedded resource annotations should survive the round-trip.

Actual Behavior

The round-tripped content loses the top-level annotations entirely.

Additional Context

  • Authoritative spec: https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/refs/heads/main/schema/2024-11-05/schema.ts
  • Code path: /Users/odeili/Projects/platform/cortex/src/cortex-mcp-types/src/content.rs
  • Duplicate check on 2026-04-10:
  • cortex-mcp-types EmbeddedResource annotations dropped round-trip

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