Add MCP setup guidance and OAuth flow#30
Merged
Conversation
Contributor
Author
|
Addressed the schema review comment in bb82fa9: the MCP OAuth string-array validation now uses Cleverbrush |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original request
Add user-facing instructions for the existing MCP server: how to use it, what URL to configure, how to install/connect it in popular clients, and include MCP OAuth support for compatible clients.
Summary
This adds in-app MCP setup instructions and an OAuth approval flow for MCP clients.
What changed
/mcp/oauth/authorizeand preserved callback redirects through password, Google, and Passport login flows.WWW-Authenticatechallenge with protected-resource metadata for unauthenticated clients./.well-known/*and/external-api/oauth/*resolve to the API endpoints.Reasoning
The settings UI now gives users the exact copy/paste configuration they need without requiring documentation outside the app. OAuth was added alongside API-key fallback so clients such as Claude and Codex can connect through a user approval flow, while existing scripts and clients that only support custom headers can still use xpenser API keys. The implementation follows the existing contract-first API structure, Next.js server-action patterns, and existing MCP endpoint/tool boundaries.
Validation
npm run lintnpm run typechecknpm test(60 files, 341 tests)Lint and testDeploy PR environmentPlaywright e2ehttps://xpenser-pr-030.cleverbrush.com, opened Settings > Preferences, verified the MCP server section, preview MCP URL, Claude/Codex/Cursor instructions, Codex TOML, Cursor JSON, API-key bearer fallback, and empty MCP OAuth connections state./.well-known/oauth-authorization-server,/.well-known/oauth-protected-resource/external-api/mcp, unauthenticated/external-api/mcpWWW-Authenticatechallenge, dynamic client registration, and/mcp/oauth/authorizeconsent screen for a registered client.xpenser-web-pr-30/xpenser-api-pr-30and broaderpr-30/pr-030service-name searches. SigNoz returned no PR Add MCP setup guidance and OAuth flow #30 service telemetry and direct lookup of fresh preview trace IDs09481c086dbe462bcec5b954399eb135and9ed15c7eff4cf52396e253eeff19b72dreturned no spans after an ingestion wait. This appears to be a PR-environment telemetry gap outside the application change; not marked as passed.Screenshots / Preview
/tmp/xpenser-pr-030-mcp-settings.png.https://xpenser-pr-030.cleverbrush.com/external-api/mcp[mcp_servers.xpenser]"type": "streamable-http""Authorization": "Bearer ${XPENSER_API_KEY}"Checklist