We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43f433c commit a6e78b7Copy full SHA for a6e78b7
src/server/auth/handlers/metadata.ts
@@ -0,0 +1,17 @@
1
+import express, { RequestHandler } from "express";
2
+import { OAuthMetadata } from "../../../shared/auth.js";
3
+import cors from 'cors';
4
+
5
+export function metadataHandler(metadata: OAuthMetadata): RequestHandler {
6
+ // Nested router so we can configure middleware and restrict HTTP method
7
+ const router = express.Router();
8
9
+ // Configure CORS to allow any origin, to make accessible to web-based MCP clients
10
+ router.use(cors());
11
12
+ router.get("/", (req, res) => {
13
+ res.status(200).json(metadata);
14
+ });
15
16
+ return router;
17
+}
0 commit comments