OAuth Applications
Create an OAuth application in your organization so MCP clients such as Claude can connect to MaiAgent MCP through OAuth authorization, without members pasting API Keys into config files; covers creat
OAuth applications let MCP clients such as Claude connect to MaiAgent MCP using the standard OAuth 2.1 authorization flow. An administrator first creates an application in the organization and obtains a Client ID; a member enters the Client ID in the MCP client, signs in to MaiAgent in the browser, and clicks "Authorize" to complete the connection, without pasting an API Key into a config file.
Differences from API Keys:
What the member does
Signs in in the browser and clicks "Authorize"
Creates a key and pastes it into the client's config file or header
Acts as
The member who completed authorization
The member the key is bound to
Which organization is operated on
The organization the application belongs to
The organization the key belongs to
Credential validity
Access tokens last 1 hour and the client renews them automatically; re-authorization is required if the authorization is revoked, the application is deleted, or the member is disabled
Depends on the key's expiration time
Revoking everything at once
Delete the application, and every member's authorization becomes invalid immediately
Revoke keys one by one
With both methods, the operations allowed depend on the member's own role permissions. For how to manage API Keys, see API Key Management.
Who Can Use This
Open the OAuth Applications page and view the application list and Connection Information
Role permission Organization Overview Permission
Create, edit, and delete applications, and regenerate a Client Secret
"OAuth Application Management Permission" under the role permission Organization Permissions (organization owners have it by default; for how to set it, see Edit Role Permissions)
Authorize an MCP client through an application
An active member of the organization the application belongs to who can sign in to MaiAgent with a password (see Members Who Sign In Only with SSO)
Members without management permission can only view the page after entering it: the edit icon is replaced by a view (eye) icon, and the delete button cannot be clicked.
How to Open This Page
In the left menu, click Organization Settings → Organization Overview, then in the Management Actions area click OAuth Applications.
At the top of the page is Connection Information, which provides the three endpoints needed to set up an MCP client. Each one can be copied with Copy:
Discovery endpoint
Clients that support OAuth 2.0 Authorization Server Metadata can obtain the other endpoints from here automatically
Authorization endpoint (Authorize)
The page where members sign in and authorize
Token endpoint
Where the client exchanges and renews access tokens
The columns of the application list below include Name, Client ID, Type, Authorized Members (the number of members who have authorized through this application), and Created At.
Create an Application
Click Create Application to open the Create OAuth Application window.
Enter a Name, for example
Claude.Select the Application Type (it cannot be changed after creation; to change it, delete the application and create it again):
TypeWhen to usePublic
MCP clients (such as Claude); uses PKCE authorization and does not issue a Client Secret
Confidential
Server-side integrations; issues a Client Secret
Enter the Redirect URIs: the URLs the flow is allowed to redirect back to after authorization, for example Claude's
https://claude.ai/api/mcp/auth_callback. If you need multiple URLs, click Add Redirect URI. Onlyhttps://is accepted;http://is allowed only forlocalhost,127.0.0.1, and::1used in local development.After you confirm, the screen shows the Client ID; a Confidential application also shows a Client Secret.
Each organization can create up to 20 OAuth applications. When the limit is reached, the Create Application button cannot be clicked and shows the message "The organization's OAuth application limit (20) has been reached."
Let Members Connect to MaiAgent MCP with OAuth
The administrator gives members the application's Client ID (plus the Client Secret for Confidential applications) and the MaiAgent MCP service endpoint (see MaiAgent MCP).
In the MCP client, the member adds a custom connector: enter the MaiAgent MCP service endpoint as the server URL, and enter the Client ID (and Client Secret) in the OAuth settings. The client's Redirect URI must be exactly the same as the one registered in the application.
The client opens a browser, and the member signs in to MaiAgent with their company email and password. When the organization has LDAP credential login enabled, the password is the corporate password.
The authorization page shows "Authorize application name?", the account currently signed in, and the organization this application belongs to. After confirming everything is correct, click "Authorize."
Return to the MCP client and the connection is complete. When reconnecting later, the authorization page does not appear again as long as the authorization is still valid.
Members Who Sign In Only with SSO
The sign-in screen on the authorization page offers only Email and password, with no SSO sign-in button. Members who sign in only with SSO and have no MaiAgent password currently cannot complete authorization; have them connect to MaiAgent MCP with an API Key instead.
Manage Applications
Edit
Click the edit icon in the list to change the Name and Redirect URIs; the Application Type cannot be changed. The Client ID is shown at the top of the window and can be copied directly.
Regenerate Secret
Only Confidential applications have a Client Secret. After you click Regenerate Secret in the edit window and confirm:
The old Client Secret becomes invalid immediately; update every server-side configuration that uses it.
Members who are already connected are not affected; only later token exchanges are affected.
The new Client Secret is likewise shown only once.
Delete
After you click the delete icon in the list and confirm, the tokens of every member connected through this application become invalid immediately, and this action cannot be undone. Members then need to re-authorize through a different application.
FAQ
Q: The Create Application button cannot be clicked?
There are two possible reasons: you do not have the "OAuth Application Management Permission" (hovering over the button shows "You do not have OAuth application management permission. Please contact your organization administrator"), or the organization already has 20 applications.
Q: The Redirect URI cannot be saved?
Only https:// URLs are accepted; http:// can be used only for localhost, 127.0.0.1, and ::1. The URL must exactly match the URL the MCP client actually redirects back to, including the path and port.
Q: After connecting, I can't find the Agent or knowledge base I expected?
An OAuth connection operates on the organization the application belongs to. Confirm that the Client ID the member uses comes from the correct organization, and that the member's role in that organization has permission to access those resources.
Q: I forgot to save the Client Secret?
The system cannot show it again. In the edit window, click Regenerate Secret to get a new Secret, and update the server-side configuration.
Last updated
Was this helpful?