-
Notifications
You must be signed in to change notification settings - Fork 746
Description
Problem Statement
The _meta
field https://modelcontextprotocol.io/specification/2025-06-18/basic/index#meta is part of every resource type but has an incompatible type in the mcp-go struct definitions, and is not parsed for resource contents.
For example spec.
interface BlobResourceContents {
_meta?: { [key: string]: unknown };
blob: string;
mimeType?: string;
uri: string;
}
The type of _meta
is a essentially a JSON dictionary.
This meta field is used by MCP-UI extensions, which allows servers to return interactive UI components (UIResources) to clients in addition to text or markdown, for example.
Proposed Solution
Updating the _meta
field to the resource content types should be sufficient. This field is currently not parsed in ParseResourceContents
which only extracts the standard MCP fields uri
, mimeType
, text
, and blob
. It ignores any optional field _meta
.
There are currently two implementation so of the interface method isResourceContents
:
func (TextResourceContents) isResourceContents() {}
func (BlobResourceContents) isResourceContents() {}
So handling the _meta
field for these two is necessary.
MCP Spec Reference
Spec https://modelcontextprotocol.io/specification/2025-06-18/schema#resource
iinterface Resource {
_meta?: { [key: string]: unknown };
annotations?: Annotations;
description?: string;
mimeType?: string;
name: string;
size?: number;
title?: string;
uri: string;
}