From 9ebee6cb991b511ae7e72775936bccc4badc88eb Mon Sep 17 00:00:00 2001 From: Manoj K Date: Sun, 24 Aug 2025 19:58:39 +0530 Subject: [PATCH] fix: scopes for windsurf --- apps/webapp/app/routes/api.oauth.clients.tsx | 2 ++ apps/webapp/app/routes/oauth.register.tsx | 2 +- apps/webapp/app/services/oauth2.server.ts | 10 +++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/webapp/app/routes/api.oauth.clients.tsx b/apps/webapp/app/routes/api.oauth.clients.tsx index b0f2433..0244cea 100644 --- a/apps/webapp/app/routes/api.oauth.clients.tsx +++ b/apps/webapp/app/routes/api.oauth.clients.tsx @@ -100,6 +100,8 @@ export const action = async ({ request }: ActionFunctionArgs) => { "mcp", "mcp:read", "mcp:write", + "mcp.read", + "mcp.write", ]; const requestedScopes = Array.isArray(allowedScopes) diff --git a/apps/webapp/app/routes/oauth.register.tsx b/apps/webapp/app/routes/oauth.register.tsx index 739dcac..cbdac6c 100644 --- a/apps/webapp/app/routes/oauth.register.tsx +++ b/apps/webapp/app/routes/oauth.register.tsx @@ -35,7 +35,7 @@ export async function action({ request }: ActionFunctionArgs) { responseTypes: response_types || ["code"], clientType: "mcp", // Special flag for MCP clients requirePkce: true, - allowedScopes: "mcp", + allowedScopes: "mcp,mcp.read,mcp.write,mcp:read,mcp:write", }); return json({ diff --git a/apps/webapp/app/services/oauth2.server.ts b/apps/webapp/app/services/oauth2.server.ts index 35af4c3..a374d21 100644 --- a/apps/webapp/app/services/oauth2.server.ts +++ b/apps/webapp/app/services/oauth2.server.ts @@ -297,7 +297,7 @@ export class OAuth2Service { ]; // MCP-related scopes - const mcpScopes = ["mcp", "mcp:read", "mcp:write"]; + const mcpScopes = ["mcp", "mcp:read", "mcp:write", "mcp.read", "mcp.write"]; const hasAuthScopes = scopes.some((s) => authScopes.includes(s)); const hasIntegrationScopes = scopes.some((s) => @@ -359,6 +359,14 @@ export class OAuth2Service { description: "Write to MCP endpoints", icon: "pencil", }, + "mcp.read": { + description: "Read MCP endpoints", + icon: "eye", + }, + "mcp.write": { + description: "Write to MCP endpoints", + icon: "pencil", + }, }; return scopes.map((scope) => ({