Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Add optional `scope` and `resource` fields to AI MCP endpoints instead of passthrough

Saiff41fe9a7da9a
diff --git a/backend/src/ee/routes/v1/ai-mcp-endpoint-router.ts b/backend/src/ee/routes/v1/ai-mcp-endpoint-router.ts
index bbd4876fe1..be8aa68d06 100644
--- a/backend/src/ee/routes/v1/ai-mcp-endpoint-router.ts
+++ b/backend/src/ee/routes/v1/ai-mcp-endpoint-router.ts
@@ -575,16 +575,15 @@ export const registerAiMcpEndpointRouter = async (server: FastifyZodProvider) =>
params: z.object({
endpointId: z.string().uuid().trim().min(1)
}),
- body: z
- .object({
- redirect_uris: z.array(z.string()),
- token_endpoint_auth_method: z.string(),
- grant_types: z.array(z.string()),
- response_types: z.array(z.string()),
- client_name: z.string(),
- client_uri: z.string().optional()
- })
- .passthrough(),
+ body: z.object({
+ redirect_uris: z.array(z.string()),
+ token_endpoint_auth_method: z.string(),
+ grant_types: z.array(z.string()),
+ response_types: z.array(z.string()),
+ client_name: z.string(),
+ client_uri: z.string().optional(),
+ scope: z.string().optional()
+ }),
response: {
200: z.object({
client_id: z.string(),
@@ -735,15 +734,14 @@ export const registerAiMcpEndpointRouter = async (server: FastifyZodProvider) =>
params: z.object({
endpointId: z.string().uuid().trim().min(1)
}),
- body: z
- .object({
- grant_type: z.literal("authorization_code"),
- code: z.string(),
- redirect_uri: z.string().url(),
- code_verifier: z.string(),
- client_id: z.string()
- })
- .passthrough(),
+ body: z.object({
+ grant_type: z.literal("authorization_code"),
+ code: z.string(),
+ redirect_uri: z.string().url(),
+ code_verifier: z.string(),
+ client_id: z.string(),
+ resource: z.string().optional()
+ }),
response: {
200: z.object({
access_token: z.string(),