Skip to content

Commit 5479178

Browse files
Merge pull request #267 from guillermoscript/feature/mcp
Feature/mcp
2 parents 16c4e7b + 111da6f commit 5479178

4 files changed

Lines changed: 15 additions & 28 deletions

File tree

.github/workflows/deploy-mcp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build and deploy MCP server to Dokploy
22

33
on:
44
push:
5-
branches: ["master"]
5+
branches: ["master", "feature/mcp"]
66
paths:
77
- "mcp-server/**"
88

app/[locale]/oauth/mcp-authorize/mcp-consent-form.tsx

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff 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)

mcp-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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"

mcp-server/src/http-server-oauth.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@ function createServerWithAuth(auth: AuthManager): McpServer {
9898
// Create Express app
9999
const 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.
104105
app.use(
106+
"/auth",
105107
mcpAuthRouter({
106108
provider: oauthProvider,
107109
issuerUrl,

0 commit comments

Comments
 (0)