Skip to content

Expose server metadata in Server initializer - #258

Open
yonaskolb wants to merge 1 commit into
modelcontextprotocol:mainfrom
yonaskolb:expose-server-info-metadata
Open

yonaskolb wants to merge 1 commit into
modelcontextprotocol:mainfrom
yonaskolb:expose-server-info-metadata

Conversation

@yonaskolb

Copy link
Copy Markdown

Summary

  • expose description, website URL, and icons in the public Server initializer
  • populate the existing Server.Info fields so they are included in initialize responses
  • add a handshake test covering all server metadata, including themed icons

All new parameters default to nil, preserving existing call sites.

Verification

  • swift build
  • swift test (552 tests)
  • swift package generate-documentation --target MCP --warnings-as-errors
  • git diff --check

ianegordon added a commit to ianegordon/swift-sdk that referenced this pull request Sep 12, 2026
Issue titles are now bare 'Upstream PR#<n>'; the merge/investigate/decline
label carries the decision, so the title does not duplicate it. Two places
named the old convention and are updated.

The investigate count was also stale: it said twelve, which was true at
triage on 2026-09-10. Four were declined since (modelcontextprotocol#280, modelcontextprotocol#226, modelcontextprotocol#118, modelcontextprotocol#204) and
two were promoted and merged (modelcontextprotocol#266 as entries 9/9a, modelcontextprotocol#275 as 10/10a/10b),
leaving six — modelcontextprotocol#178, modelcontextprotocol#213, modelcontextprotocol#216, modelcontextprotocol#257, modelcontextprotocol#258, modelcontextprotocol#259 — now listed by number
rather than by count, so the sentence cannot drift again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eb9yGSXH1TVkg5Afsu9phk
ianegordon added a commit to ianegordon/swift-sdk that referenced this pull request Sep 12, 2026
Upstream PR modelcontextprotocol#258 (yonaskolb), head adcb230.

The convenience Server.init accepted name/version/title/instructions and
built a Server.Info that silently dropped description, websiteUrl and
icons -- fields Server.Info already declares and the 2025-11-25 spec
already carries in serverInfo. Before this they were reachable only by
constructing Server.Info by hand.

Additive and non-breaking: the three new parameters default to nil and
sit between title: and instructions:, so existing call sites are
unaffected. Client.init already forwarded the same three to Client.Info,
so this closes an asymmetry rather than opening one.

No adaptation; merged as authored.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zgQXRkSfYjvzQ9PW2Gg9c
ianegordon added a commit to ianegordon/swift-sdk that referenced this pull request Sep 12, 2026
Expose server metadata in the Server initializer. Moves the entry out of
the candidates table into the manifest, corrects the investigate count to
five, and pins the usage example to the tag cut from this commit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018zgQXRkSfYjvzQ9PW2Gg9c
ianegordon pushed a commit to ianegordon/swift-sdk that referenced this pull request Oct 13, 2026
…ests without a reply (upstream modelcontextprotocol#298, EhsanAzish80)

Supersedes the contributions of modelcontextprotocol#264, modelcontextprotocol#260 and modelcontextprotocol#270 (manifest entries 1-3),
which modelcontextprotocol#298 combines. Conflicts resolved in favour of modelcontextprotocol#298 in
HTTPServerTypes.swift, StatelessHTTPServerTransport.swift, Server.swift,
CancellationTests.swift and HTTPServerTransportTests.swift.

Fork changes re-applied on top:
- modelcontextprotocol#258's Server.init description/websiteUrl/icons parameters
- modelcontextprotocol#221's MockTransport receiveCallCount / finishStream
- entry 1a's collision regression tests and their makeStatelessPOSTRequest
  authorization overload

Behavior: a cancelled original POST now ends as HTTP 200 with an empty
text/event-stream and no JSON-RPC body (previously -32002 from modelcontextprotocol#260).
Follow-up on when to use -32800: fork issue #41.

Full suite: 589 tests in 43 suites passed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ianegordon added a commit to ianegordon/swift-sdk that referenced this pull request Oct 13, 2026
…rder

Entry 3a broke two conventions: letter suffixes mark fork additions, and
the Order column claims merge order, in which modelcontextprotocol#298 comes after modelcontextprotocol#258. The
maintenance procedure now says to skip superseded rows.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@varun06

varun06 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Hi @yonaskolb, thanks for this PR! I've reviewed it and it looks good to merge.

Could you please rebase it onto the latest main? CI was broken on macOS runners for every PR (a toolchain/SDK mismatch, fixed in #306), so rebasing will pick up the fix and give us a green run. I'll review and merge once it's updated.

If you're no longer able to work on this, no problem: just let us know. If we don't hear back in about two weeks, we may carry the change forward in a new PR, with credit to you.

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.

2 participants