GeezerVison is showing github.com — mcp/experimental: add ServerCard convenience helper (SEP-2127) by SamMorrowDrums · Pull Request #1024 · modelcontextprotocol/go-sdk
Conversation
Summary
Draft Go reference implementation for SEP-2127 MCP Server Cards.
This adds an experimental mcp/experimental/servercard package that ports the server-side convenience helper from modelcontextprotocol/python-sdk#2951 for building a static Server Card from mcp.Implementation metadata and serving it with the discovery CORS/cache headers.
Tracking / coordination
This is opened as a draft because it is a nontrivial experimental API and should be promoted after WG review / proposal soak.
Validation
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jun 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see SEP-2127 isolated under mcp/experimental/servercard rather than touching core mcp.
Local check on this branch:
go test ./mcp/experimental/servercard/... -count=1
All pass. Validation coverage for version ranges, ETag/If-None-Match, and discovery headers looks solid.
Please rebase onto current main before merge (branch is behind). No other concerns from my side on the experimental API shape.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
SamMorrowDrums reacted with heart emoji
tadasant
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a pass at an automated review to ensure alignment with some of the latest Server Card changes -- no blockers, lgtm!
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
SamMorrowDrums reacted with heart emoji
olgasafonova
added a commit
to olgasafonova/mcp-servercard-go
that referenced
this pull request
Jul 24, 2026
The bead assumed SEP-2127 had stalled. PR #2127 is still open and
CHANGES_REQUESTED, which reads as stalled, but the work moved elsewhere:
- PR #2893 merged 26-06-2026, refactoring SEP-2127 from Standards Track
to an Extensions Track charter that delegates the wire format to
experimental-ext-server-card
- .well-known was dropped as the card location; it is now
GET <streamable-http-url>/server-card
- modelcontextprotocol/go-sdk#1024 adds an official
mcp/experimental/servercard package, challenging this repo's
"reference implementation for Go" framing
So servercard.WellKnownPath, WellKnownPathFor() and the application/json
content type in handler.go are all divergences from normative text. The
card struct in card.go is still correct.
The one production adopter has already migrated: gateway.pipeworx.io
301s from the old path to /mcp/server-card (verified live).
54 claims tagged: 87% HIGH, 11% MEDIUM, 2% LOW.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
SamMorrowDrums
added a commit
to modelcontextprotocol/ext-server-card
that referenced
this pull request
Aug 12, 2026
The WG's proposed priorities for the core-maintainer roadmap, per the
Jul 27 meeting. Three tracks, in priority order:
1. **Graduate the Server Card as an official MCP extension** — gated on
merging an SDK reference impl (Python [python-sdk#2951], Go
[go-sdk#1024], TS [typescript-sdk#2527]), landing best practices
([#40]/[#36]), and keeping the GitHub showcase ([#34]) in sync.
2. **Describe what a server does, not just where to reach it** — the
primitives / static-capability work ([#30]), framed around the problem:
a card lists URLs but no operations for consumers that never connect.
3. **Authentication** — express real-world per-remote auth ([#13]); land
a limited shape first, expand as a fast-follow.
Kept deliberately short as a strawman for public comment. Docs-only;
`format:check` passes.
[python-sdk#2951]:
modelcontextprotocol/python-sdk#2951
[go-sdk#1024]: modelcontextprotocol/go-sdk#1024
[typescript-sdk#2527]:
modelcontextprotocol/typescript-sdk#2527
[#13]:
#13
[#30]:
#30
[#34]:
#34
[#40]:
#40
[#36]:
#36
---------
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 904e057e-7dd0-4dfc-9e15-571ddeb8475f
Copilot-Session: 2eabcc66-5630-47ce-b193-171bbcaff1e8
|
Status check on this one, since the surrounding context has moved a lot since the last push (Jul 21):
Timeline
- Jun 25: PR opened as the Go reference implementation for SEP-2127, tracked in experimental-ext-server-card#16.
- Jun 28: community approval (@piyushbag).
- Jul 20: ext-server-card#42 (AI Catalog discovery) merged. @tadasant said the reference PRs would be marked ready and merged pending SDK maintainer approval, and left a no-blockers review here.
- Jul 24 and Aug 12: #46 (ETag revalidation, already covered here) and the WG roadmap landed. The roadmap lists "a merged SDK reference implementation" as the remaining requirement under SEP-2133, and names this PR and python-sdk#2951.
- Aug 3 and Aug 20: SEP text updates (#3109, #3242).
- Oct 6: SEP-2127 merged.
Current state of this PR
- Mergeable and CI green (including client and server conformance).
- No Go SDK maintainer review yet, so it's the only blocker.
schema.json is unchanged upstream since the 3b2d974 pin used in the docs. The only upstream drift is docs/discovery.md.
Small doc updates that look needed
- The "AI Catalog context" section of
docs/server_cards.md (and its .src.md) still describes ext-server-card#42 as a "draft PR" and the "intended discovery direction". It merged Jul 20, so that wording can now point at docs/discovery.md directly.
Scope compared with the other SDKs
This PR is the server-side helper only (build, validate, serve). The TypeScript (#2527) and Python (#3139) drafts also cover the client side:
- fetching
/.well-known/ai-catalog.json
- fetching and validating the cards it references
- resolving a remote's URL and headers
- checking a card against the live
initialize result
@SamMorrowDrums, are you still planning to drive this? If it helps, I'm happy to do the doc refresh above. I can also send the client-side discovery as a follow-up PR stacked on this one, so this PR stays server-only and reviewable.
@maciej-kisiel @guglielmo-san, could one of you take a look when you get a chance? Per the WG roadmap, a merged reference implementation is what SEP-2127 is waiting on.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The server card SEP is merged, conformance tests are planned and so I hope we can unblock SDK implementation now.
|
guglielmo-san reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Adds experimental Server Card types and helpers for SEP-2127, including
building a card from implementation metadata and serving it with discovery
headers.
Co-authored-by: Copilot <[email protected]>
Validate nested input formats, icon themes, URIs, Unicode lengths, and
exact versions. Avoid caching handler error responses.
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 38f143e1-c0ff-47a9-ae4d-fd6ea9a5b7fd
Document building, serving, and publishing Server Cards with the Go SDK,
including AI Catalog context, security guidance, and checked examples.
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 38f143e1-c0ff-47a9-ae4d-fd6ea9a5b7fd
|
|
func Handler(card *ServerCard) http.Handler {
|
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
|
setDiscoveryHeaders(w.Header())
|
|
|
if r.Method != http.MethodGet && r.Method != http.MethodHead {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CORS preflight request should be handled too
if r.Method == http.MethodOptions {
w.WriteHeader(http.StatusNoContent)
return
}
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
|
|
|
// Handler returns an HTTP handler that serves card as a Server Card discovery
|
|
|
// document.
|
|
|
func Handler(card *ServerCard) http.Handler {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If card is static, there is no need to validate, marshal and sha on every request, it can be done once before returning the http.HandlerFunc
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+179
to
+187
|
|
if cfg.name == "" {
|
|
|
return nil, errors.New("server card name must be set")
|
|
|
}
|
|
|
if impl.Version == "" {
|
|
|
return nil, errors.New("implementation version must be set to build a Server Card")
|
|
|
}
|
|
|
if cfg.description == "" {
|
|
|
return nil, errors.New("server card description must be set")
|
|
|
}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if withDescription() and withName() are not provided, should we fallback to impl.Description and impl.Name ?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+353
to
+357
|
|
func setDiscoveryHeaders(h http.Header) {
|
|
|
h.Set("Access-Control-Allow-Origin", "*")
|
|
|
h.Set("Access-Control-Allow-Methods", http.MethodGet)
|
|
|
h.Set("Access-Control-Allow-Headers", "Content-Type")
|
|
|
}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
func setDiscoveryHeaders(h http.Header) { |
|
h.Set("Access-Control-Allow-Origin", "*") |
|
h.Set("Access-Control-Allow-Methods", http.MethodGet) |
|
h.Set("Access-Control-Allow-Headers", "Content-Type") |
|
} |
|
func setDiscoveryHeaders(h http.Header) { |
|
h.Set("Access-Control-Allow-Origin", "*") |
|
h.Set("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS") |
|
h.Set("Access-Control-Allow-Headers", "Content-Type, If-None-Match") |
|
h.Set("Access-Control-Expose-Headers", "ETag") |
|
} |
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Reviewers
+2 more reviewers
Reviewers whose approvals may not affect merge requirements
At least 1 approving review is required to merge this pull request.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|