Skip to content

CONCEPT Cited by 1 source

MIME type as first-class metadata

Definition

MIME type as first-class metadata is the API-design discipline of always declaring a MIME type on every piece of addressable content returned from a service or protocol endpoint — so clients can render, parse, or route the content correctly without sniffing. Canonicalised on this wiki via the 2026-01-08 Wix Engineering MCP Resources tutorial, which names it as a specific implementer rule: "Always specify MIME type to help clients render resource content correctly" (Source: sources/2026-01-08-wix-mcp-resources-all-you-need-to-know).

Why it matters

Without a declared MIME type:

  • Clients fall back to content sniffing — probing for recognisable byte patterns. Slow, error-prone, and historically a source of security vulnerabilities (e.g. browser MIME sniffing letting JavaScript render as HTML).
  • Rendering loses semantic information. text/markdown vs text/plain vs text/html are three different downstream rendering paths; without a declared type the client has to guess.
  • Routing becomes unreliable. A client that wants to send images to an image viewer and JSON to a parser needs the declared type — or it has to inspect every payload.

Shapes where this shows up on the wiki

  • MCP resources — Wix canonicalises "Always specify MIME type" as a per-resource discipline. Every concepts/mcp-resource registration carries a MIME type in metadata, and every handler return carries the same MIME type on the content item. Typical values: text/plain, text/markdown, application/json, image/png.
  • HTTP content negotiation / markdown-for-agentsconcepts/markdown-content-negotiation extends the same discipline to the edge: Accept: text/markdown lets agents request the markdown rendering of a human-facing HTML page directly. The Vercel content-negotiation corpus is the wiki's canonical HTTP-level instance; the Wix post is the canonical MCP-protocol-level instance.

Production implications

  • Clients filter and sort on it. Wix's resource annotations include audience (['user', 'assistant']) partly so clients can surface MCP resources in the right UI — but the MIME type is the first-pass filter (image viewer for image/*, code viewer for application/json, prose viewer for text/markdown).
  • Humans can view MCP resources directly. Unlike MCP tools, which are agent-scoped, MCP resources are intended to be human-viewable. A client without a MIME type cannot render to the user.

Seen in

Last updated · 476 distilled / 1,218 read