fix(mcp): expose standard protected resource metadata
This commit is contained in:
parent
85a9d0238c
commit
7c9d136b4d
@ -129,8 +129,8 @@ app.get('/api/health/ready', async (_req, res) => {
|
||||
}
|
||||
})
|
||||
|
||||
const mcpResourceMetadataUrl = new URL('/.well-known/oauth-protected-resource/api/mcp', config.mcpResourceUrl).href
|
||||
app.get('/.well-known/oauth-protected-resource/api/mcp', (_req, res) => {
|
||||
const mcpResourceMetadataUrl = new URL('/.well-known/oauth-protected-resource', config.mcpResourceUrl).href
|
||||
function sendMcpProtectedResourceMetadata(res: express.Response) {
|
||||
res.setHeader('Cache-Control', 'public, max-age=300')
|
||||
res.json({
|
||||
resource: config.mcpResourceUrl,
|
||||
@ -138,6 +138,12 @@ app.get('/.well-known/oauth-protected-resource/api/mcp', (_req, res) => {
|
||||
scopes_supported: [...FIELDLENS_MCP_OAUTH_SCOPES],
|
||||
bearer_methods_supported: ['header'],
|
||||
})
|
||||
}
|
||||
app.get('/.well-known/oauth-protected-resource', (_req, res) => {
|
||||
sendMcpProtectedResourceMetadata(res)
|
||||
})
|
||||
app.get('/.well-known/oauth-protected-resource/api/mcp', (_req, res) => {
|
||||
sendMcpProtectedResourceMetadata(res)
|
||||
})
|
||||
|
||||
app.use('/api/mcp', (_req, res, next) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user