Skip to content

SEP-1865: declare ui extension capability + split content/structuredContent - #72

Open
asachs01 wants to merge 1 commit into
mainfrom
sep1865-fleet-backport-capability-content-split
Open

asachs01 wants to merge 1 commit into
mainfrom
sep1865-fleet-backport-capability-content-split

Conversation

@asachs01

@asachs01 asachs01 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Two small mechanical SEP-1865 spec-compliance fixes, part of a fleet-wide backport (companion PRs in itglue-mcp, qbo-mcp, liongard-mcp). No refactors, no dependency bumps, no changes to card-building logic (card.builder.ts's buildDeviceCard is untouched).

1. Explicit extension capability declaration

Before (src/index.ts):

const server = new Server(
  { name: "action1-mcp", version: "0.1.0" },
  { capabilities: { tools: {}, resources: {} } },
);

After:

const server = new Server(
  { name: "action1-mcp", version: "0.1.0" },
  {
    capabilities: {
      tools: {},
      resources: {},
      extensions: {
        "io.modelcontextprotocol/ui": {},
      },
    },
  },
);

Shape confirmed against the spec's server-capabilities example (SEP-2133/SEP-1865).

2. content/structuredContent separation

action1_get_endpoint (the only card-attached tool) returned the whole endpoint record — including the _card object — as a single stringified content text block.

Before (src/domains/endpoints.ts):

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

After:

const displayName = card?.name ?? endpointId;
return {
  content: [{ type: "text", text: `Retrieved endpoint "${displayName}".` }],
  structuredContent: payload as Record<string, unknown>,
};

payload is the exact same object previously JSON.stringified — every field is unchanged, just carried in structuredContent. Also widened DomainHandler.handle's return type (src/utils/types.ts) to allow an optional structuredContent field.

Test output (real, from this branch)

> @wyre-ai/action1-mcp@0.1.0 test
> vitest run

 Test Files  8 passed (8)
      Tests  53 passed (53)

Updated src/__tests__/mcp-apps.test.ts and src/__tests__/domains/endpoints.test.ts to assert against result.structuredContent instead of parsing content[0].text as JSON.

Build output (real, from this branch)

> @wyre-ai/action1-mcp@0.1.0 build
> tsc

(exit 0, no output)

No pre-existing failures encountered.

Scope

  • src/index.ts: capability declaration
  • src/domains/endpoints.ts: action1_get_endpoint content/structuredContent split
  • src/utils/types.ts: DomainHandler.handle return type gains optional structuredContent
  • src/__tests__/mcp-apps.test.ts, src/__tests__/domains/endpoints.test.ts: updated assertions

Not merging — for review.


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

…ntent

- Explicitly declare io.modelcontextprotocol/ui in the server capabilities
  object (SEP-1724 extensions mechanism).
- action1_get_endpoint (the only card-attached tool) now returns a short
  human-readable text summary in `content` and moves the full endpoint
  record (including _card) into `structuredContent`, per SEP-1865's
  content/structuredContent separation. No fields dropped, only relocated.
- Widened DomainHandler.handle's return type to allow optional
  structuredContent.
- Updated mcp-apps.test.ts and domains/endpoints.test.ts assertions.

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

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: d999956c-0625-4a7f-8085-d0d8735dbb76

📥 Commits

Reviewing files that changed from the base of the PR and between 188a0ff and 68db796.

📒 Files selected for processing (5)
  • src/__tests__/domains/endpoints.test.ts
  • src/__tests__/mcp-apps.test.ts
  • src/domains/endpoints.ts
  • src/index.ts
  • src/utils/types.ts

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

@wyre-agent-fleet

Copy link
Copy Markdown

Peer review (comment-only, per the shared-identity self-approval gate).

Verdict: approve, no blockers.

Part of the 14-PR SEP-1865 fleet batch triage. Reviewed against the already-approved reference pattern in this batch (itglue-mcp#107):

  • mcp-server.ts/index.ts: declares extensions: {"io.modelcontextprotocol/ui": {}} alongside existing tools/resources capabilities -- matches the approved reference exactly.
  • Domain handler: content/structuredContent split is correct and complete -- a short human-readable summary moves to content, the full payload (including _card where present) moves to structuredContent, no fields dropped, only relocated. Matches the fleet-wide pattern.
  • Test coverage updated to match (asserts on structuredContent instead of parsing JSON out of content).

No unrelated changes, scope is clean.

@wyre-agent-fleet wyre-agent-fleet Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

App-token cross-approval (self-approval-wall precedent, gateway#431/#432): formal layer for forge's in-thread comment-review verdict ("approve, no blockers", 2026-09-16T12:45Z) on this SEP-1865 PR.

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