Skip to content

Add mcp application type for MCP client applications - #4399

Merged
Malith-19 merged 1 commit into
thunder-id:mainfrom
Malith-19:feat/mcp-application-type
Jul 30, 2026
Merged

Add mcp application type for MCP client applications#4399
Malith-19 merged 1 commit into
thunder-id:mainfrom
Malith-19:feat/mcp-application-type

Conversation

@Malith-19

@Malith-19 Malith-19 commented Jul 28, 2026

Copy link
Copy Markdown
Member

Purpose

Followup to #4321. The mcp-client Console template was mapped to the browser application type, which forces a public, PKCE-only client. As noted in review, MCP client hosts like VS Code and Claude Code can also be confidential clients, so pinning them to browser was too restrictive.

This PR adds a dedicated mcp application type so MCP client applications can be public or confidential based on their own OAuth 2.0 configuration.

Approach

  • Added mcp as a new canonical application type, alongside browser, fullstack, mobile, m2m, and custom.
  • mcp applications derive Flow Secret eligibility and flow-initiation mode from their OAuth 2.0 configuration, the same way fullstack/custom apps already do.
  • Updated the mcp-client Console template to use mcp instead of browser.
  • Updated the OpenAPI spec, validation, error messages, and application-type documentation.

The Digital Wallet template mapping raised in the same issue is intentionally left as mobile and is not part of this PR.

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided.
    • Ran Vale and fixed all errors and warnings
  • Tests provided.
    • Unit Tests
    • Integration Tests
  • Breaking changes.
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

  • New Features

    • Added MCP Client as a supported application type across application creation, configuration, and management.
    • MCP applications now support OAuth-based flow initiation and Flow Secret issuance or rotation when eligible.
    • Updated MCP application templates and console behavior to preserve the new application type.
  • Documentation

    • Updated application guides and authentication guidance with MCP Client configuration, secrets, token settings, and initiation rules.
  • Bug Fixes

    • Corrected MCP application type handling in creation flows and application type resolution.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Malith-19, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 49b8c11e-7d81-4062-8d90-e9ca6a2a71b1

📥 Commits

Reviewing files that changed from the base of the PR and between 357ff34 and 218f7c3.

📒 Files selected for processing (23)
  • api/application.yaml
  • backend/internal/application/application_type_test.go
  • backend/internal/application/error_constants.go
  • backend/internal/application/model/application.go
  • backend/internal/application/model/constants.go
  • backend/internal/application/model/utils.go
  • backend/internal/application/service.go
  • backend/internal/flow/flowexec/service.go
  • backend/internal/flow/flowexec/service_test.go
  • backend/internal/system/i18n/core/defaults.go
  • backend/pkg/thunderidengine/providers/model.go
  • docs/content/guides/applications/application-settings.mdx
  • docs/content/guides/applications/manage-applications.mdx
  • docs/content/key-concepts/authentication/integration-models.mdx
  • frontend/apps/console/src/features/applications/components/edit-application/general-settings/EditGeneralSettings.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/general-settings/__tests__/EditGeneralSettings.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/mcp/McpConnectTab.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/mcp/__tests__/McpConnectTab.test.tsx
  • frontend/apps/console/src/features/applications/data/application-templates/technology-based/mcp-client.json
  • frontend/apps/console/src/features/applications/models/application.ts
  • frontend/apps/console/src/features/applications/pages/__tests__/ApplicationCreatePage.test.tsx
  • frontend/apps/console/src/features/applications/utils/__tests__/resolveApplicationType.test.ts
  • frontend/apps/console/src/features/applications/utils/resolveApplicationType.ts
📝 Walkthrough

Walkthrough

MCP is added as a supported application type across API schemas, backend validation and flow behavior, Console models and controls, application templates, tests, error metadata, and user documentation.

Changes

MCP application type support

Layer / File(s) Summary
Backend type contracts and validation
api/application.yaml, backend/internal/application/model/*, backend/internal/application/service.go, backend/internal/application/error_constants.go, backend/pkg/thunderidengine/providers/model.go, backend/internal/system/i18n/core/defaults.go
Defines ApplicationTypeMCP, accepts mcp during validation, updates API/schema metadata, and refreshes supported-type error descriptions.
Flow Secret and initiation behavior
backend/internal/application/application_type_test.go, backend/internal/application/service.go, backend/internal/flow/flowexec/*
Applies OAuth-based Flow Secret eligibility and flow-initiation resolution to MCP applications, with embedded and redirect scenarios covered by tests.
Console type resolution and templates
frontend/apps/console/src/features/applications/models/application.ts, frontend/apps/console/src/features/applications/utils/*, frontend/apps/console/src/features/applications/data/application-templates/technology-based/mcp-client.json, frontend/apps/console/src/features/applications/pages/__tests__/ApplicationCreatePage.test.tsx
Adds mcp to the frontend type union and resolver, classifies the MCP template correctly, and updates creation assertions.
Console Flow Secret controls
frontend/apps/console/src/features/applications/components/edit-application/general-settings/*, frontend/apps/console/src/features/applications/components/edit-application/mcp/McpConnectTab.tsx
Allows eligible MCP applications to display Flow Secret rotation controls and tests confidential MCP regeneration.
MCP application documentation
docs/content/guides/applications/*, docs/content/key-concepts/authentication/integration-models.mdx
Documents MCP Client as a supported type and describes its OAuth, client-secret, token, and direct-initiation behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ApplicationCreatePage
  participant ApplicationService
  participant FlowExecService
  ApplicationCreatePage->>ApplicationService: submit application with type mcp
  ApplicationService->>ApplicationService: validate MCP application fields
  ApplicationService->>FlowExecService: resolve MCP flow initiation mode
  FlowExecService->>ApplicationCreatePage: return Flow Secret or initiation mode
Loading

Possibly related issues

  • thunder-id/thunderid#4382 — Directly covers introducing and propagating the mcp application type across validation, flow behavior, templates, and documentation.

Possibly related PRs

Suggested reviewers: donomalvindula, thiva-k

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly names the new mcp application type and its MCP client scope.
Description check ✅ Passed It follows the template and includes purpose, approach, issues, PRs, checklist, and security checks.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
docs/content/guides/applications/manage-applications.mdx (1)

33-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Complete the MCP Client description.

“May be a public or confidential client” is a sentence fragment. Use a complete sentence in the table cell.

-| **MCP Client** | For AI applications that connect to MCP servers using the Model Context Protocol. May be a public or confidential client depending on its OAuth 2.0 configuration. | Depends on configuration |
+| **MCP Client** | For AI applications that connect to MCP servers using the Model Context Protocol. The client can be public or confidential, depending on its OAuth 2.0 configuration. | Depends on configuration |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/content/guides/applications/manage-applications.mdx` at line 33, Update
the MCP Client table entry to express the public-or-confidential client
statement as a complete sentence, while preserving its existing meaning and the
surrounding OAuth 2.0 configuration context.

Source: Linters/SAST tools

backend/internal/application/application_type_test.go (1)

119-121: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep the test name and eligibility comment aligned.

The test now covers MCP and also asserts eligibility when OAuth configuration is absent, but TestFullStackAndCustomFlowSecretEligibility and the comment describe only the previous cases. Rename the test and mention both eligible paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@backend/internal/application/application_type_test.go` around lines 119 -
121, Rename TestFullStackAndCustomFlowSecretEligibility to reflect coverage of
MCP and OAuth-absent eligibility, and update the adjacent comment to document
both eligible paths: confidential non-redirect embedded clients and applications
without OAuth configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/content/guides/applications/application-settings.mdx`:
- Line 69: Update the OAuth 2.0/OIDC application-type descriptions at both
referenced locations to include Custom App alongside the existing application
types. Ensure both lists consistently indicate that Custom App follows the
documented token and client-secret configuration behavior.

In `@docs/content/key-concepts/authentication/integration-models.mdx`:
- Line 65: Update the authentication model description for Full-stack, Custom,
and MCP Client applications to state that Flow Secrets require a confidential,
non-redirect OAuth client. Explicitly distinguish flow-capable grant
combinations such as token exchange from an application using only
client_credentials, and avoid implying that every confidential client without
authorization_code can initiate the flow directly.

In
`@frontend/apps/console/src/features/applications/components/edit-application/general-settings/EditGeneralSettings.tsx`:
- Around line 121-129: The Flow Secret eligibility predicates incorrectly
classify client-credentials-only MCP configurations as flow-native. Update
isFlowNativeClient in
frontend/apps/console/src/features/applications/components/edit-application/general-settings/EditGeneralSettings.tsx
lines 121-129 and the corresponding predicate in
frontend/apps/console/src/features/applications/components/edit-application/mcp/McpConnectTab.tsx
lines 137-143 to use the backend’s confidential-client eligibility rule,
excluding m2m-shaped MCP configurations from regeneration controls.

---

Nitpick comments:
In `@backend/internal/application/application_type_test.go`:
- Around line 119-121: Rename TestFullStackAndCustomFlowSecretEligibility to
reflect coverage of MCP and OAuth-absent eligibility, and update the adjacent
comment to document both eligible paths: confidential non-redirect embedded
clients and applications without OAuth configuration.

In `@docs/content/guides/applications/manage-applications.mdx`:
- Line 33: Update the MCP Client table entry to express the
public-or-confidential client statement as a complete sentence, while preserving
its existing meaning and the surrounding OAuth 2.0 configuration context.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5b339e90-f0b3-44bf-b24f-4570fa1fd68a

📥 Commits

Reviewing files that changed from the base of the PR and between 2a158a2 and 357ff34.

📒 Files selected for processing (22)
  • api/application.yaml
  • backend/internal/application/application_type_test.go
  • backend/internal/application/error_constants.go
  • backend/internal/application/model/application.go
  • backend/internal/application/model/constants.go
  • backend/internal/application/model/utils.go
  • backend/internal/application/service.go
  • backend/internal/flow/flowexec/service.go
  • backend/internal/flow/flowexec/service_test.go
  • backend/internal/system/i18n/core/defaults.go
  • backend/pkg/thunderidengine/providers/model.go
  • docs/content/guides/applications/application-settings.mdx
  • docs/content/guides/applications/manage-applications.mdx
  • docs/content/key-concepts/authentication/integration-models.mdx
  • frontend/apps/console/src/features/applications/components/edit-application/general-settings/EditGeneralSettings.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/general-settings/__tests__/EditGeneralSettings.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/mcp/McpConnectTab.tsx
  • frontend/apps/console/src/features/applications/data/application-templates/technology-based/mcp-client.json
  • frontend/apps/console/src/features/applications/models/application.ts
  • frontend/apps/console/src/features/applications/pages/__tests__/ApplicationCreatePage.test.tsx
  • frontend/apps/console/src/features/applications/utils/__tests__/resolveApplicationType.test.ts
  • frontend/apps/console/src/features/applications/utils/resolveApplicationType.ts

Comment thread docs/content/guides/applications/application-settings.mdx Outdated
Comment thread docs/content/key-concepts/authentication/integration-models.mdx Outdated
@Malith-19
Malith-19 force-pushed the feat/mcp-application-type branch from 357ff34 to 218f7c3 Compare July 30, 2026 05:29
@Malith-19 Malith-19 added the trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes label Jul 30, 2026
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Malith-19
Malith-19 added this pull request to the merge queue Jul 30, 2026
Merged via the queue into thunder-id:main with commit 4d56b8e Jul 30, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes Type/Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants