-
Notifications
You must be signed in to change notification settings - Fork 0
Add MCP server card endpoint #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import type { APIRoute } from "astro"; | ||
|
|
||
| export const prerender = true; | ||
|
|
||
| const serverCard = { | ||
| $schema: "https://static.modelcontextprotocol.io/schemas/mcp-server-card/v1.json", | ||
| version: "1.0", | ||
| protocolVersion: "2025-06-18", | ||
| serverInfo: { | ||
| name: "asynctalk", | ||
| title: "AsyncTalk", | ||
| version: "2.0.0", | ||
| }, | ||
| description: "AsyncTalk 是一档中文 Web 开发播客。", | ||
| documentationUrl: "https://asynctalk.com", | ||
| transport: { | ||
| type: "streamable-http", | ||
| endpoint: "/mcp", | ||
| }, | ||
| capabilities: { | ||
| tools: {}, | ||
| prompts: {}, | ||
| resources: {}, | ||
| }, | ||
| }; | ||
|
|
||
| export const GET: APIRoute = () => { | ||
| return new Response(JSON.stringify(serverCard, null, 2), { | ||
| headers: { | ||
| "Access-Control-Allow-Origin": "*", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The endpoint only returns Useful? React with 👍 / 👎. |
||
| "Cache-Control": "public, max-age=3600", | ||
| "Content-Type": "application/json; charset=utf-8", | ||
| "X-Content-Type-Options": "nosniff", | ||
| }, | ||
| }); | ||
| }; | ||
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.
The server card advertises
transport.endpointas/mcp, but this change does not add any/mcphandler or rewrite in the repo (I checked with a repo-widerg -uu -n "\bmcp\b|server-card", which only finds this new file). In deployments built from this code, clients that discover the card will attempt to connect to/mcpand receive a 404, so discovery now directs users to a non-functional MCP endpoint.Useful? React with 👍 / 👎.