| 1 | import { DEFAULT_MCP_AUTH_SCOPES } from '../apps/api/src/access-control.js';
|
| 2 |
|
| 3 | export function GET(request: Request): Response {
|
| 4 | const origin = new URL(request.url).origin;
|
| 5 | return Response.json(
|
| 6 | {
|
| 7 | resource: `${origin}/mcp`,
|
| 8 | authorization_servers: [origin],
|
| 9 | scopes_supported: DEFAULT_MCP_AUTH_SCOPES,
|
| 10 | bearer_methods_supported: ['header'],
|
| 11 | },
|
| 12 | {
|
| 13 | headers: {
|
| 14 | 'access-control-allow-origin': '*',
|
| 15 | 'cache-control': 'public, max-age=300',
|
| 16 | },
|
| 17 | },
|
| 18 | );
|
| 19 | }
|
| 20 |
|
| 21 | export function OPTIONS(): Response {
|
| 22 | return new Response(null, {
|
| 23 | status: 204,
|
| 24 | headers: {
|
| 25 | 'access-control-allow-headers': 'authorization, content-type, mcp-protocol-version',
|
| 26 | 'access-control-allow-methods': 'GET, OPTIONS',
|
| 27 | 'access-control-allow-origin': '*',
|
| 28 | 'access-control-max-age': '86400',
|
| 29 | },
|
| 30 | });
|
| 31 | }
|