Skip to content

Commit 577fadd

Browse files
fix(mcp): add urlencoded body parser for consent form callback
The consent form submits via HTML form (application/x-www-form-urlencoded) but only express.json() was registered. Add express.urlencoded() so the /auth/callback POST handler can parse form-encoded bodies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 111da6f commit 577fadd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ app.use(
112112
})
113113
);
114114

115-
// JSON body parsing (after auth router, which has its own parsing)
115+
// Body parsing (after auth router, which has its own parsing)
116116
app.use(express.json());
117+
app.use(express.urlencoded({ extended: true }));
117118

118119
// Bearer auth middleware for /mcp endpoint
119120
const bearerAuth = requireBearerAuth({

0 commit comments

Comments
 (0)