Skip to content

Context7 Platform -- Up-to-date docs for AI agents

feat(openai-apps): add OpenAI Apps SDK domain verification endpoint (#2517)

Enes Gules1b0c211e6654
diff --git a/.changeset/many-plants-listen.md b/.changeset/many-plants-listen.md
new file mode 100644
index 00000000..7a87a61d
--- /dev/null
+++ b/.changeset/many-plants-listen.md
@@ -0,0 +1,5 @@
+---
+"@upstash/context7-mcp": patch
+---
+
+Add endpoint for OpenAI Apps SDK domain verification.
diff --git a/packages/mcp/src/index.ts b/packages/mcp/src/index.ts
index af234e2d..6862ff20 100644
--- a/packages/mcp/src/index.ts
+++ b/packages/mcp/src/index.ts
@@ -11,7 +11,12 @@ import express from "express";
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import { Command } from "commander";
import { AsyncLocalStorage } from "async_hooks";
-import { SERVER_VERSION, RESOURCE_URL, AUTH_SERVER_URL } from "./lib/constants.js";
+import {
+ SERVER_VERSION,
+ RESOURCE_URL,
+ AUTH_SERVER_URL,
+ OPENAI_APPS_CHALLENGE_TOKEN,
+} from "./lib/constants.js";
/** Default HTTP server port */
const DEFAULT_PORT = 3000;
@@ -477,6 +482,20 @@ async function main() {
}
);
+ // OpenAI Apps SDK domain verification challenge
+ app.get(
+ "/.well-known/openai-apps-challenge",
+ (_req: express.Request, res: express.Response) => {
+ if (!OPENAI_APPS_CHALLENGE_TOKEN) {
+ return res.status(404).json({
+ error: "not_found",
+ message: "Endpoint not found.",
+ });
+ }
+ res.type("text/plain").send(OPENAI_APPS_CHALLENGE_TOKEN);
+ }
+ );
+
// Catch-all 404 handler - must be after all other routes
app.use((_req: express.Request, res: express.Response) => {
res.status(404).json({
diff --git a/packages/mcp/src/lib/constants.ts b/packages/mcp/src/lib/constants.ts
index c4154a91..b1811814 100644
--- a/packages/mcp/src/lib/constants.ts
+++ b/packages/mcp/src/lib/constants.ts
@@ -14,3 +14,4 @@ export const CLERK_DOMAIN = "clerk.context7.com";
export const CONTEXT7_API_BASE_URL = process.env.CONTEXT7_API_URL || `${CONTEXT7_BASE_URL}/api`;
export const RESOURCE_URL = process.env.RESOURCE_URL || MCP_RESOURCE_URL;
export const AUTH_SERVER_URL = process.env.AUTH_SERVER_URL || CONTEXT7_BASE_URL;
+export const OPENAI_APPS_CHALLENGE_TOKEN = process.env.OPENAI_APPS_CHALLENGE_TOKEN;