Context7 Platform -- Up-to-date docs for AI agents
CTX7-3186: Add MCP server title and scalable icons (#3418)
Enes Gulese8240444aeb1
diff --git a/.changeset/mcp-server-title-icons.md b/.changeset/mcp-server-title-icons.mdnew file mode 100644index 00000000..f78cf36d--- /dev/null+++ b/.changeset/mcp-server-title-icons.md@@ -0,0 +1,5 @@+---+"@upstash/context7-mcp": patch+---++Advertise a server title and scalable icons (SVG and a 512x512 PNG) in the MCP handshake and the server card.diff --git a/packages/mcp/src/index.ts b/packages/mcp/src/index.tsindex 27a39c4a..b9ac7b7e 100644--- a/packages/mcp/src/index.ts+++ b/packages/mcp/src/index.ts@@ -26,6 +26,8 @@ import {RESOURCE_URL,OAUTH_AUTH_SERVER_URL,OPENAI_APPS_CHALLENGE_TOKEN,+ SERVER_ICONS,+ SERVER_TITLE,mcpServerCard,} from "./lib/constants.js";import { maybeElicitAuthSignIn } from "./lib/auth/auth-prompt.js";@@ -257,16 +259,12 @@ function aliasArgs(aliases: AliasMap) {function createMcpServer(mcpContext: McpRequestContext) {const serverInfo = {name: "Context7",+ title: SERVER_TITLE,version: SERVER_VERSION,websiteUrl: "https://context7.com",description:"Context7 provides up-to-date documentation and code examples for libraries and frameworks.",- icons: [- {- src: "https://context7.com/context7-icon-green.png",- mimeType: "image/png",- },- ],+ icons: SERVER_ICONS,};const serverOptions = {// The collections are static for the process lifetime. Explicitly disablingdiff --git a/packages/mcp/src/lib/constants.ts b/packages/mcp/src/lib/constants.tsindex f336ffb2..4662053e 100644--- a/packages/mcp/src/lib/constants.ts+++ b/packages/mcp/src/lib/constants.ts@@ -34,17 +34,32 @@ export const EMA_ISSUER =export const EMA_JWKS_URL = process.env.EMA_JWKS_URL || `${CONTEXT7_API_BASE_URL}/oauth/ema-jwks`;export const OPENAI_APPS_CHALLENGE_TOKEN = process.env.OPENAI_APPS_CHALLENGE_TOKEN;+export const SERVER_TITLE = "Context7";+// The vector icon scales to any size; the PNG is 512x512.+export const SERVER_ICONS = [+ {+ src: "https://context7.com/context7-icon-green.svg",+ mimeType: "image/svg+xml",+ sizes: ["any"],+ },+ {+ src: "https://context7.com/context7-icon-green.png",+ mimeType: "image/png",+ sizes: ["512x512"],+ },+];+/** Describe the remote server using the experimental Server Card v1 schema. */export function mcpServerCard(resourceUrl = RESOURCE_URL) {return {$schema: "https://static.modelcontextprotocol.io/schemas/v1/server-card.schema.json",name: "io.github.upstash/context7",- title: "Context7",+ title: SERVER_TITLE,description:"Up-to-date, version-specific documentation and code examples for software libraries.",version: SERVER_VERSION,websiteUrl: "https://context7.com",- icons: [{ src: "https://context7.com/context7-icon-green.png", mimeType: "image/png" }],+ icons: SERVER_ICONS,remotes: [{type: "streamable-http",