# \McpOauthApi
All URIs are relative to */api*
[**discover_mcp_o_auth**](McpOauthApi.md#discover_mcp_o_auth) | **POST** /mcp/oauth/discover | discover MCP server OAuth metadata
[**get_mcp_o_auth_client_metadata**](McpOauthApi.md#get_mcp_o_auth_client_metadata) | **GET** /mcp/oauth/client-metadata.json | Orvanta's OAuth client metadata (RFC 7591)
[**mcp_o_auth_callback**](McpOauthApi.md#mcp_o_auth_callback) | **GET** /mcp/oauth/callback | MCP OAuth callback
[**refresh_mcp_o_auth**](McpOauthApi.md#refresh_mcp_o_auth) | **POST** /mcp/oauth/refresh | refresh an MCP OAuth connection's access token
[**start_mcp_o_auth_popup**](McpOauthApi.md#start_mcp_o_auth_popup) | **GET** /mcp/oauth/start | start MCP OAuth popup flow
## discover_mcp_o_auth
> models::DiscoverMcpOAuth200Response discover_mcp_o_auth(discover_mcp_o_auth_request)
discover MCP server OAuth metadata
### Parameters
**discover_mcp_o_auth_request** | [**DiscoverMcpOAuthRequest**](DiscoverMcpOAuthRequest.md) | | [required] |
### Return type
[**models::DiscoverMcpOAuth200Response**](discoverMcpOAuth_200_response.md)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_mcp_o_auth_client_metadata
> models::GetMcpOAuthClientMetadata200Response get_mcp_o_auth_client_metadata()
Orvanta's OAuth client metadata (RFC 7591)
Static client metadata document served for MCP servers that want to inspect Orvanta's registration parameters ahead of dynamic client registration.
### Parameters
This endpoint does not need any parameter.
### Return type
[**models::GetMcpOAuthClientMetadata200Response**](getMcpOAuthClientMetadata_200_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## mcp_o_auth_callback
> String mcp_o_auth_callback(state, code, error, error_description)
MCP OAuth callback
Handles the OAuth redirect from the MCP server, exchanges the code for tokens (PKCE, server-to-server), persists them encrypted per-workspace, and returns an HTML page that posts a message to window.opener and closes itself. Always returns 200 -- success/failure is conveyed via the posted message, never plaintext tokens.
### Parameters
**state** | **String** | CSRF state token, single-use, matched against the row created by /mcp/oauth/start | [required] |
**code** | Option<**String**> | OAuth authorization code (absent when the authorization server reports an error instead) | |
**error** | Option<**String**> | Error code from the authorization server, if the user denied access or the request failed | |
**error_description** | Option<**String**> | | |
### Return type
**String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: text/html
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## refresh_mcp_o_auth
> models::RefreshMcpOAuth200Response refresh_mcp_o_auth(refresh_mcp_o_auth_request)
refresh an MCP OAuth connection's access token
Uses the stored (encrypted) refresh token to obtain a new access token from the MCP server and updates the stored connection. The caller must be a member of workspace_id.
### Parameters
**refresh_mcp_o_auth_request** | [**RefreshMcpOAuthRequest**](RefreshMcpOAuthRequest.md) | | [required] |
### Return type
[**models::RefreshMcpOAuth200Response**](refreshMcpOAuth_200_response.md)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## start_mcp_o_auth_popup
> start_mcp_o_auth_popup(mcp_server_url, workspace_id, scopes)
start MCP OAuth popup flow
Opens in a popup, discovers OAuth metadata, registers a client (if needed), and redirects to the MCP server's authorization endpoint. The caller must be a member of workspace_id.
### Parameters
**mcp_server_url** | **String** | URL of the MCP server to connect to | [required] |
**workspace_id** | **String** | Workspace the resulting connection will belong to | [required] |
**scopes** | Option<**String**> | Comma/whitespace-separated list of OAuth scopes to request | |
### Return type
(empty response body)
### Authorization
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)