MCP OAuth Clients

Package: agentrouter.mcp.v1 Service: McpOAuthClientsService

Endpoints

Create an MCP OAuth client

What it does: Registers a new OAuth client under a project. The client_secret is wrapped by the secret service and discarded; only an sm:// reference is persisted.

Request fields:

FieldRequiredDescription
customer_idnoDefaults to the caller's session customer when empty.
project_idnoDefaults to the caller's session project when empty.
provideryesRequired: stable provider key, e.g. "github".
provider_nameyesRequired: human-friendly provider display name.
client_idyesRequired: OAuth client id from the provider.
client_secretyesRequired: OAuth client secret. WRITE-ONLY -- wrapped by the secret service and never returned on any response.
authorization_urlyesRequired: OAuth authorization endpoint URL.
token_urlyesRequired: OAuth token endpoint URL.
scopesnoOptional: requested OAuth scopes.
redirect_urisnoOptional: allowed redirect URIs.
metadatanoOptional: free-form provider configuration.
server_idsnoOptional: MCP server ids this client serves.
statusnoOptional: initial status ("active""inactive"). Defaults to "active" when empty.

Response fields:

FieldRequiredDescription
idoutput-onlyServer-assigned uuid row id. Output-only.
customer_idoutput-onlyOwning customer scope. Defaults to the caller's session customer when empty on the request; immutable once set.
project_idoutput-onlyOwning project scope. Defaults to the caller's session project when empty on the request; immutable once set.
provideryesStable provider key, e.g. "github", "google". Unique per (customer, project). Required on create.
provider_nameyesHuman-friendly display name for the provider, e.g. "GitHub".
client_idyesOAuth client id issued by the upstream provider.
authorization_urlyesOAuth authorization endpoint URL.
token_urlyesOAuth token endpoint URL.
scopesnoOAuth scopes requested during the authorization flow.
redirect_urisnoAllowed redirect URIs for the authorization-code flow.
metadatanoFree-form provider configuration (discovery_url, token_auth_method, ...). Mirrors the dashboard's jsonb metadata column.
server_idsnoMCP server ids this client serves. Empty means "all servers in the project".
statusnoLifecycle status: "active""inactive""revoked".
created_atoutput-onlyRow creation time. Output-only.
updated_atoutput-onlyLast mutation time. Output-only.
{"signatures":{"go":"c.McpOAuthClients().CreateMcpOAuthClient(ctx, \u0026mcpv1.CreateMcpOAuthClientRequest{...})","python":"client.mcpoauthclients.createmcpoauthclient(...)","typescript":"client.mcpoauthclients.createmcpoauthclient({...})","cli":"tare api mcp oauth-clients create --provider $PROVIDER --provider-name $PROVIDER_NAME --client-id $CLIENT_ID --client-secret $CLIENT_SECRET --authorization-url $AUTHORIZATION_URL --token-url $TOKEN_URL","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../mcp-oauth-clients\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"provider\": \"...\",\n    \"provider_name\": \"...\",\n    \"client_id\": \"...\",\n    \"client_secret\": \"...\",\n    \"authorization_url\": \"...\",\n    \"token_url\": \"...\",\n    \"scopes\": [],\n    \"redirect_uris\": [],\n    \"metadata\": {},\n    \"server_ids\": [],\n    \"status\": \"...\"\n  }'"},"examples":{"go":"// No Go SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","cli":"tare api mcp oauth-clients create --provider $PROVIDER --provider-name $PROVIDER_NAME --client-id $CLIENT_ID --client-secret $CLIENT_SECRET --authorization-url $AUTHORIZATION_URL --token-url $TOKEN_URL","curl":"curl -X POST \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../mcp-oauth-clients\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"provider\": \"...\",\n    \"provider_name\": \"...\",\n    \"client_id\": \"...\",\n    \"client_secret\": \"...\",\n    \"authorization_url\": \"...\",\n    \"token_url\": \"...\",\n    \"scopes\": [],\n    \"redirect_uris\": [],\n    \"metadata\": {},\n    \"server_ids\": [],\n    \"status\": \"...\"\n  }'"},"persona":"Authenticated (API key or session token)","httpVerb":"POST","httpPath":"/v1/customers/{customer_id}/projects/{project_id}/mcp-oauth-clients","slug":"create-an-mcp-oauth-client"}

Get an MCP OAuth client

What it does: Returns a single OAuth client by id. Never returns the client_secret. Account tier: any project member may read.

Request fields:

FieldRequiredDescription
customer_idnoDefaults to the caller's session customer when empty.
project_idnoDefaults to the caller's session project when empty.
idyesRequired: uuid of the client to fetch (McpOAuthClient.id).

Response fields:

FieldRequiredDescription
idoutput-onlyServer-assigned uuid row id. Output-only.
customer_idoutput-onlyOwning customer scope. Defaults to the caller's session customer when empty on the request; immutable once set.
project_idoutput-onlyOwning project scope. Defaults to the caller's session project when empty on the request; immutable once set.
provideryesStable provider key, e.g. "github", "google". Unique per (customer, project). Required on create.
provider_nameyesHuman-friendly display name for the provider, e.g. "GitHub".
client_idyesOAuth client id issued by the upstream provider.
authorization_urlyesOAuth authorization endpoint URL.
token_urlyesOAuth token endpoint URL.
scopesnoOAuth scopes requested during the authorization flow.
redirect_urisnoAllowed redirect URIs for the authorization-code flow.
metadatanoFree-form provider configuration (discovery_url, token_auth_method, ...). Mirrors the dashboard's jsonb metadata column.
server_idsnoMCP server ids this client serves. Empty means "all servers in the project".
statusnoLifecycle status: "active""inactive""revoked".
created_atoutput-onlyRow creation time. Output-only.
updated_atoutput-onlyLast mutation time. Output-only.
{"signatures":{"go":"c.McpOAuthClients().GetMcpOAuthClient(ctx, \u0026mcpv1.GetMcpOAuthClientRequest{...})","python":"client.mcpoauthclients.getmcpoauthclient(...)","typescript":"client.mcpoauthclients.getmcpoauthclient({...})","cli":"tare api mcp oauth-clients get \u003cid\u003e","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../mcp-oauth-clients/01H...\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","cli":"tare api mcp oauth-clients get \u003cid\u003e","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../mcp-oauth-clients/01H...\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Authenticated (API key or session token)","httpVerb":"GET","httpPath":"/v1/customers/{customer_id}/projects/{project_id}/mcp-oauth-clients/{id}","slug":"get-an-mcp-oauth-client"}

List MCP OAuth clients

What it does: Lists every non-deleted OAuth client in the (customer, project) scope. Account tier: any project member may read.

Request fields:

FieldRequiredDescription
customer_idnoDefaults to the caller's session customer when empty.
project_idnoDefaults to the caller's session project when empty.
pagenoCursor-pagination inputs (page size + continuation token).

Response fields:

FieldRequiredDescription
clientsnoOAuth clients in the requested scope (metadata only, no secrets).
pagenoCursor-pagination outputs (next-page token).
{"signatures":{"go":"c.McpOAuthClients().ListMcpOAuthClients(ctx, \u0026mcpv1.ListMcpOAuthClientsRequest{...})","python":"client.mcpoauthclients.listmcpoauthclients(...)","typescript":"client.mcpoauthclients.listmcpoauthclients({...})","cli":"tare api mcp oauth-clients list","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../mcp-oauth-clients\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","cli":"tare api mcp oauth-clients list","curl":"curl \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../mcp-oauth-clients\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Authenticated (API key or session token)","httpVerb":"GET","httpPath":"/v1/customers/{customer_id}/projects/{project_id}/mcp-oauth-clients","slug":"list-mcp-oauth-clients"}

Update an MCP OAuth client

What it does: Applies a partial patch. Omitted scalar strings ("") leave the existing value untouched. A non-empty client_secret rotates the wrapped secret in place.

Request fields:

FieldRequiredDescription
customer_idnoDefaults to the caller's session customer when empty.
project_idnoDefaults to the caller's session project when empty.
idyesRequired: uuid of the client to update (McpOAuthClient.id).
provider_namenoMutable scalar fields. Empty string leaves the existing value untouched.
client_idnoundocumented
client_secretnoOptional: a non-empty value rotates the wrapped client secret in place. Empty leaves the stored secret untouched. WRITE-ONLY.
authorization_urlnoundocumented
token_urlnoundocumented
statusnoundocumented
scopesnoRepeated / map fields: a non-nil value REPLACES the stored value; a nil/omitted value leaves it untouched (see the replace_* flags).
redirect_urisnoundocumented
metadatanoundocumented
server_idsnoundocumented
replace_scopesnoBecause proto3 cannot distinguish an omitted repeated/map field from an explicit "set to empty", these booleans opt in to clearing the matching collection. When false, an empty scopes/redirect_uris/ metadata/server_ids is treated as "leave untouched".
replace_redirect_urisnoundocumented
replace_metadatanoundocumented
replace_server_idsnoundocumented

Response fields:

FieldRequiredDescription
idoutput-onlyServer-assigned uuid row id. Output-only.
customer_idoutput-onlyOwning customer scope. Defaults to the caller's session customer when empty on the request; immutable once set.
project_idoutput-onlyOwning project scope. Defaults to the caller's session project when empty on the request; immutable once set.
provideryesStable provider key, e.g. "github", "google". Unique per (customer, project). Required on create.
provider_nameyesHuman-friendly display name for the provider, e.g. "GitHub".
client_idyesOAuth client id issued by the upstream provider.
authorization_urlyesOAuth authorization endpoint URL.
token_urlyesOAuth token endpoint URL.
scopesnoOAuth scopes requested during the authorization flow.
redirect_urisnoAllowed redirect URIs for the authorization-code flow.
metadatanoFree-form provider configuration (discovery_url, token_auth_method, ...). Mirrors the dashboard's jsonb metadata column.
server_idsnoMCP server ids this client serves. Empty means "all servers in the project".
statusnoLifecycle status: "active""inactive""revoked".
created_atoutput-onlyRow creation time. Output-only.
updated_atoutput-onlyLast mutation time. Output-only.
{"signatures":{"go":"c.McpOAuthClients().UpdateMcpOAuthClient(ctx, \u0026mcpv1.UpdateMcpOAuthClientRequest{...})","python":"client.mcpoauthclients.updatemcpoauthclient(...)","typescript":"client.mcpoauthclients.updatemcpoauthclient({...})","cli":"tare api mcp oauth-clients update --id $ID","curl":"curl -X PATCH \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../mcp-oauth-clients/01H...\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"provider_name\": \"...\",\n    \"client_id\": \"...\",\n    \"client_secret\": \"...\",\n    \"authorization_url\": \"...\",\n    \"token_url\": \"...\",\n    \"status\": \"...\",\n    \"scopes\": [],\n    \"redirect_uris\": [],\n    \"metadata\": {},\n    \"server_ids\": [],\n    \"replace_scopes\": false,\n    \"replace_redirect_uris\": false,\n    \"replace_metadata\": false,\n    \"replace_server_ids\": false\n  }'"},"examples":{"go":"// No Go SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","cli":"tare api mcp oauth-clients update --id $ID","curl":"curl -X PATCH \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../mcp-oauth-clients/01H...\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"provider_name\": \"...\",\n    \"client_id\": \"...\",\n    \"client_secret\": \"...\",\n    \"authorization_url\": \"...\",\n    \"token_url\": \"...\",\n    \"status\": \"...\",\n    \"scopes\": [],\n    \"redirect_uris\": [],\n    \"metadata\": {},\n    \"server_ids\": [],\n    \"replace_scopes\": false,\n    \"replace_redirect_uris\": false,\n    \"replace_metadata\": false,\n    \"replace_server_ids\": false\n  }'"},"persona":"Authenticated (API key or session token)","httpVerb":"PATCH","httpPath":"/v1/customers/{customer_id}/projects/{project_id}/mcp-oauth-clients/{id}","slug":"update-an-mcp-oauth-client"}

Delete an MCP OAuth client

What it does: Soft-deletes a client (deleted_at set).

Request fields:

FieldRequiredDescription
customer_idnoDefaults to the caller's session customer when empty.
project_idnoDefaults to the caller's session project when empty.
idyesRequired: uuid of the client to soft-delete (McpOAuthClient.id).
{"signatures":{"go":"c.McpOAuthClients().DeleteMcpOAuthClient(ctx, \u0026mcpv1.DeleteMcpOAuthClientRequest{...})","python":"client.mcpoauthclients.deletemcpoauthclient(...)","typescript":"client.mcpoauthclients.deletemcpoauthclient({...})","cli":"tare api mcp oauth-clients delete \u003cid\u003e","curl":"curl -X DELETE \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../mcp-oauth-clients/01H...\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"examples":{"go":"// No Go SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","python":"# No Python SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","typescript":"// No TypeScript SDK wrapper for McpOAuthClientsService yet -- use the CLI or curl example below.","cli":"tare api mcp oauth-clients delete \u003cid\u003e","curl":"curl -X DELETE \"${AGENTROUTER_BASE_URL}/v1/customers/cust_01H.../projects/proj_01H.../mcp-oauth-clients/01H...\" \\\n  -H \"Authorization: Bearer ak-${AGENTROUTER_API_KEY}\""},"persona":"Authenticated (API key or session token)","httpVerb":"DELETE","httpPath":"/v1/customers/{customer_id}/projects/{project_id}/mcp-oauth-clients/{id}","slug":"delete-an-mcp-oauth-client"}