File tree Expand file tree Collapse file tree 5 files changed +17
-1
lines changed Expand file tree Collapse file tree 5 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 5050 "prefill" : {
5151 "query" : " hello world"
5252 }
53+ },
54+ "authorizationServer" : {
55+ "title" : " Authorization server" ,
56+ "type" : " string" ,
57+ "description" : " Authorization server" ,
58+ "editor" : " textfield"
5359 }
5460 }
5561}
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export enum Routes {
88 MCP = '/mcp' ,
99 SSE = '/sse' ,
1010 MESSAGE = '/message' ,
11+ WELL_KNOWN_OAUTH_AUTHORIZATION_SERVER = '/.well-known/oauth-authorization-server' ,
1112}
1213
1314export const getHelpMessage = ( host : string ) => `To interact with the server you can either:
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import { getActorRunData } from './utils.js';
1919export function createExpressApp (
2020 host : string ,
2121 mcpServer : ActorsMcpServer ,
22+ authorizationServer : string ,
2223) : express . Express {
2324 const app = express ( ) ;
2425 let transportSSE : SSEServerTransport ;
@@ -64,6 +65,13 @@ export function createExpressApp(
6465 res . status ( 200 ) . end ( ) ;
6566 } ) ;
6667
68+ app . head ( Routes . WELL_KNOWN_OAUTH_AUTHORIZATION_SERVER , async ( _req : Request , res : Response ) => {
69+ // The endpoint is the same
70+ const response = await fetch ( `${ authorizationServer } ${ Routes . WELL_KNOWN_OAUTH_AUTHORIZATION_SERVER } ` ) ;
71+ const data = await response . json ( ) ;
72+ res . status ( 200 ) . json ( data ) . end ( ) ;
73+ } ) ;
74+
6775 app . get ( Routes . SSE , async ( req : Request , res : Response ) => {
6876 try {
6977 log . info ( `Received GET message at: ${ Routes . SSE } ` ) ;
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ if (STANDBY_MODE) {
3535 enableDefaultActors : false ,
3636 } ) ;
3737
38- const app = createExpressApp ( HOST , mcpServer ) ;
38+ const app = createExpressApp ( HOST , mcpServer , input . authorizationServer ) ;
3939 log . info ( 'Actor is running in the STANDBY mode.' ) ;
4040
4141 // Load only Actors specified in the input
Original file line number Diff line number Diff line change @@ -183,6 +183,7 @@ export type Input = {
183183 maxActorMemoryBytes ?: number ;
184184 debugActor ?: string ;
185185 debugActorInput ?: unknown ;
186+ authorizationServer ?: string ;
186187} ;
187188
188189export interface ToolCacheEntry {
You can’t perform that action at this time.
0 commit comments