Repository navigation
Description
Summary
All three SDKs return tool results as a single MCP text content block. There is no ImageContent, AudioContent, EmbeddedResource, or resource_link path, and no declared-artifact convention. A media-producing module can only return a path string or a multi-megabyte base64 string inside text.
This is consistent with the current spec (apcore-mcp SRS FR-EXEC-002: "SHALL return ... JSON string in the MCP text content"), so this issue is a spec change proposal, not an implementation divergence.
Cross-language result
| SDK | Version / HEAD | Result shape | Other content types | Evidence |
|---|---|---|---|---|
| Python | 0.23.4 / 2887706 |
[{"type":"text","text":...}] |
None | server/router.py:337, 415, 557 |
| TypeScript | 0.23.4 / 8506903 |
TextContentDict[] only |
None | src/types.ts:177-180, src/server/router.ts:63, 544-759, factory.ts:720-726 |
| Rust | 0.23.4 / a991ed1 |
Vec<TextContent> |
Internal trace → _meta.trace only |
src/server/types.rs:54-93, factory.rs:846-857 |
Both TypeScript and Rust already expose outputSchema + structuredContent; that covers structured JSON, not file handoff. resources exist only for documentation (docs://{module_id}) and system metadata, not for call artifacts.
Impact
- AI clients receive media as text, not as files, so they cannot preview, save, or pass artifacts to another tool.
- Large binary results inflate model context and may be truncated by the client.
- Media pipelines must invent a path convention, and the receiving client has no portable way to fetch the file.
- For a local pipeline this is the difference between "the agent can inspect the render" and "the agent gets a filename".
Proposed fix
Add a declared-artifact convention to the adapter spec, implemented in all three SDKs:
- A module output field can opt into artifact handling, e.g.
"x-mcp-artifact": trueor a descriptor-levelartifacts: ["final_path"]. - The adapter emits:
- a
textsummary (unchanged), plus - a
resource_link(orEmbeddedResourcebelow a small configurable threshold) pointing at the file, withmimeTypeandname.
- a
- Never embed large files as base64; define a size threshold and a documented fallback to a path string.
- Keep
structuredContentfor the structured part of the result.
Add a conformance fixture (artifact_content.json) with a driver contract so all three SDKs emit the same shape.
Acceptance criteria
- A module returning
{ "summary": "...", "artifact": "/path/final.mp4" }yields a text summary plus a resource link, with no base64 payload. - The behavior is identical in Python, TypeScript, and Rust.
- Clients that do not support resource links continue to receive the text summary.
- The SRS/feature docs describe the convention and the size threshold.
Related
- Python issue:
aiperceivable/apcore-mcp-python#10 - Spec:
apcore-mcp/docs/srs-apcore-mcp.mdFR-EXEC-002;docs/prd-apcore-mcp.mdOQ-1
Activity
tercel commentedon Nov 29, 2026
The beta media-link pilot landed in #130 across Python, TypeScript, and Rust. The adapter accepts an opaque ID in an x-mcp-artifact output field, retains text and structured data, and serves authorized bytes via resources/read with expiry and size bounds. This closes the resource-link pilot scope. The original local-path and inline-content alternatives are outside that delivered contract. Paired verification: https://github.com/aiperceivable/apcore-surfaces/actions/runs/46205760166