Skip to content

fix(mcp-apps): SEP-1865 capability declaration + content/structuredContent split - #79

Open
asachs01 wants to merge 1 commit into
mainfrom
sep-1865-compliance-backport
Open

asachs01 wants to merge 1 commit into
mainfrom
sep-1865-compliance-backport

Conversation

@asachs01

@asachs01 asachs01 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

SEP-1865 compliance backport (mechanical)

Part of a fleet-wide mechanical SEP-1865 compliance backport across WYRE-AI MCP servers. A compliance audit found zero MUST-level violations but two consistent SHOULD-level gaps. This PR closes both for syncro-mcp, touching only the capability declaration and the content/structuredContent split for the card-attached tool. No refactors, no dependency bumps, no card-building logic changes.

1. Explicit io.modelcontextprotocol/ui capability declaration

Per the ext-apps spec's Capability Negotiation section, servers negotiate MCP Apps support via the standard extensions capability mechanism (SEP-1724). syncro-mcp was not declaring this, relying on implicit support.

Before (src/mcp-server.ts):

capabilities: {
  tools: {},
  resources: {},
},

After:

capabilities: {
  tools: {},
  resources: {},
  extensions: {
    "io.modelcontextprotocol/ui": {
      mimeTypes: ["text/html;profile=mcp-app"],
    },
  },
},

2. content/structuredContent separation

syncro_tickets_get previously JSON-stringified the entire ticket payload (including the _card UI attachment) into a single content text block. SEP-1865 expects content to carry a human-readable summary and structuredContent to carry the machine-readable payload.

Before (src/domains/tickets.ts):

return {
  content: [{ type: "text", text: JSON.stringify(payload, null, 2) }],
};

After:

const summary = `Ticket #${ticket.number ?? ticket.id} (${
  ticket.status ?? "unknown status"
}): ${ticket.subject ?? "no subject"}`;

return {
  content: [{ type: "text", text: summary }],
  structuredContent: payload,
};

payload (ticket data + _card when present) moves to structuredContent; content now carries a concise one-line summary instead of a JSON dump.

Tests updated

  • tests/domains/tickets.test.tssyncro_tickets_get test now asserts on structuredContent instead of parsing content[0].text as JSON.
  • tests/mcp-apps.test.ts — added:
    • a test asserting content is plain text (not JSON-parseable) and contains the summary, while structuredContent carries the full payload.
    • a test asserting the server declares io.modelcontextprotocol/ui in capabilities.extensions.

Test output (real, from this branch)

> @wyre-ai/syncro-mcp@1.1.6 test
> vitest run

 RUN  v5.0.0 /Users/asachs/work/syncro-mcp

 Test Files  15 passed (15)
      Tests  163 passed (163)
   Start at  21:07:37
   Duration  517ms (transform 61%, import 25%, tests 10%, worker 4%)

Build output

> @wyre-ai/syncro-mcp@1.1.6 build
> tsc

(clean, no errors, no output — tsc succeeded)

No pre-existing test failures encountered; full suite is green before and after.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features
    • Ticket retrieval now provides a concise, readable summary with the ticket number, status, and subject.
    • Complete ticket details remain available in structured data for supported integrations.
    • Added support for displaying HTML-based MCP Apps content through compatible interfaces.

…t content/structuredContent (SEP-1865)

- Server capabilities now explicitly declare the io.modelcontextprotocol/ui
  extension per the ext-apps Capability Negotiation section, instead of
  relying on implicit support.
- syncro_tickets_get now returns a human-readable text summary in
  `content` and moves the full ticket + _card payload into
  `structuredContent`, matching the SEP-1865 content/structuredContent
  split instead of JSON-stringifying the whole payload into content.
- Updated tests/domains/tickets.test.ts and tests/mcp-apps.test.ts to
  assert the new split and the capability declaration.

Part of a fleet-wide mechanical SEP-1865 compliance backport.
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 747d11e8-3bcf-4d78-abc4-b9cfcb1a81cc

📥 Commits

Reviewing files that changed from the base of the PR and between 885d29e and 244f160.

📒 Files selected for processing (4)
  • src/domains/tickets.ts
  • src/mcp-server.ts
  • tests/domains/tickets.test.ts
  • tests/mcp-apps.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The ticket-get operation now returns concise text and exposes the full ticket payload through structuredContent. The MCP server declares the MCP Apps UI extension and supports text/html;profile=mcp-app. Tests cover both contracts.

Changes

MCP Apps support

Layer / File(s) Summary
Ticket response contract
src/domains/tickets.ts, tests/domains/tickets.test.ts, tests/mcp-apps.test.ts
Ticket retrieval returns text containing the ticket number, status, and subject. The full payload remains in structuredContent. Tests validate both representations.
MCP Apps capability declaration
src/mcp-server.ts, tests/mcp-apps.test.ts
createMcpServer declares io.modelcontextprotocol/ui and supports text/html;profile=mcp-app.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: arutherford

Merge Risk: ⚪ Minimal · up to 244f1

The ticket response and MCP Apps capability declaration preserve their intended client contracts. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Changelog Entry ⚠️ Warning The PR changes runtime behavior in src/domains/tickets.ts: syncro_tickets_get now returns a human-readable content summary and moves the full payload to structuredContent. It also adds the pub… Add a changelog entry under ## [Unreleased], in ### Changed, for the syncro_tickets_get content/structuredContent response change and the MCP Apps capability declaration.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the two main changes: the MCP Apps capability declaration and the separation of human-readable content from structured content.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Changelog Entry

Explanation

The PR changes runtime behavior in src/domains/tickets.ts: syncro_tickets_get now returns a human-readable content summary and moves the full payload to structuredContent. It also adds the public io.modelcontextprotocol/ui capability declaration in src/mcp-server.ts. The PR changes no CHANGELOG.md file; the base and head changelog objects are identical. Therefore, it adds no corresponding entry under ## [Unreleased].

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sep-1865-compliance-backport
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch sep-1865-compliance-backport

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant