File tree Expand file tree Collapse file tree
app/[locale]/oauth/mcp-authorize Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: Build and deploy MCP server to Dokploy
22
33on :
44 push :
5- branches : ["master"]
5+ branches : ["master", "feature/mcp" ]
66 paths :
77 - " mcp-server/**"
88
Original file line number Diff line number Diff line change @@ -35,29 +35,14 @@ export function McpConsentForm({
3535 setError ( null )
3636
3737 try {
38- // POST to MCP server callback — this will redirect us
39- // We use a form submission approach to follow the redirect
40- const form = document . createElement ( "form" )
41- form . method = "POST"
42- form . action = mcpCallbackUrl
43-
44- const fields = {
45- sessionId,
46- userId,
47- userRole,
48- tenantId,
49- }
50-
51- for ( const [ key , value ] of Object . entries ( fields ) ) {
52- const input = document . createElement ( "input" )
53- input . type = "hidden"
54- input . name = key
55- input . value = value
56- form . appendChild ( input )
57- }
58-
59- document . body . appendChild ( form )
60- form . submit ( )
38+ // Redirect to MCP server callback via GET with query params
39+ // The callback will generate an auth code and redirect back to Claude
40+ const url = new URL ( mcpCallbackUrl )
41+ url . searchParams . set ( "session_id" , sessionId )
42+ url . searchParams . set ( "user_id" , userId )
43+ url . searchParams . set ( "user_role" , userRole )
44+ url . searchParams . set ( "tenant_id" , tenantId )
45+ window . location . href = url . toString ( )
6146 } catch ( err ) {
6247 setError ( err instanceof Error ? err . message : "Failed to authorize" )
6348 setLoading ( null )
Original file line number Diff line number Diff line change 11{
22 "name" : " lms-mcp-server" ,
3- "version" : " 1.0.0 " ,
3+ "version" : " 1.0.1 " ,
44 "type" : " module" ,
55 "bin" : {
66 "lms-mcp" : " ./build/index.js"
Original file line number Diff line number Diff line change @@ -98,10 +98,12 @@ function createServerWithAuth(auth: AuthManager): McpServer {
9898// Create Express app
9999const app = express ( ) ;
100100
101- // OAuth auth router — handles /auth/authorize, /auth/token, /auth/register
102- // Note: The proxy overrides /.well-known/* with tenant-aware metadata,
103- // so mcpAuthRouter's metadata will only be seen if accessed directly.
101+ // OAuth auth router — mounted at /auth so routes become /auth/authorize, /auth/token, /auth/register
102+ // The SDK registers routes at /authorize, /token, /register — mounting at /auth adds the prefix.
103+ // The proxy overrides /.well-known/* with tenant-aware metadata,
104+ // so mcpAuthRouter's internal metadata routes (at /auth/.well-known/*) are never reached.
104105app . use (
106+ "/auth" ,
105107 mcpAuthRouter ( {
106108 provider : oauthProvider ,
107109 issuerUrl,
You can’t perform that action at this time.
0 commit comments