MCP OAuth Clients
Package: agentrouter.mcp.v1 Service: McpOAuthClientsService
Endpoints
Create an MCP OAuth client
Changed in v0.5.0 (new features): You can now register and connect an MCP server whose OAuth provider issues public clients, which have no client secret.
Changed in v0.2.0 (bug fixes): The MCP OAuth clients API is now reachable. Every call to it (from the SDKs, the REST endpoints, or the API explorer) previously returned an empty success response and saved nothing, because the service was never routed on the management API. Creating, reading, updating and deleting MCP OAuth clients now works as documented.
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:
| Field | Required | Description | |
|---|---|---|---|
customer_id | no | Defaults to the caller's session customer when empty. | |
project_id | no | Defaults to the caller's session project when empty. | |
provider | yes | Required: stable provider key, e.g. "github". | |
provider_name | yes | Required: human-friendly provider display name. | |
client_id | yes | Required: OAuth client id from the provider. | |
client_secret | no | OAuth client secret. WRITE-ONLY -- wrapped by the secret service and never returned on any response. Required for a confidential client, and rejected for a public one: set metadata token_auth_method="none" instead when the provider issues no secret (PKCE authenticates the exchange). | |
authorization_url | yes | Required: OAuth authorization endpoint URL. | |
token_url | yes | Required: OAuth token endpoint URL. | |
scopes | no | Optional: requested OAuth scopes. | |
redirect_uris | no | Optional: allowed redirect URIs. | |
metadata | no | Optional: free-form provider configuration. | |
server_ids | no | Optional: MCP server ids this client serves. | |
status | no | Optional: initial status ("active" | "inactive"). Defaults to "active" when empty. |
Response fields:
| Field | Required | Description | ||
|---|---|---|---|---|
id | output-only | Server-assigned uuid row id. Output-only. | ||
customer_id | output-only | Owning customer scope. Defaults to the caller's session customer when empty on the request; immutable once set. | ||
project_id | output-only | Owning project scope. Defaults to the caller's session project when empty on the request; immutable once set. | ||
provider | yes | Stable provider key, e.g. "github", "google". Unique per (customer, project). Required on create. | ||
provider_name | yes | Human-friendly display name for the provider, e.g. "GitHub". | ||
client_id | yes | OAuth client id issued by the upstream provider. | ||
authorization_url | yes | OAuth authorization endpoint URL. | ||
token_url | yes | OAuth token endpoint URL. | ||
scopes | no | OAuth scopes requested during the authorization flow. | ||
redirect_uris | no | Allowed redirect URIs for the authorization-code flow. | ||
metadata | no | Free-form provider configuration (discovery_url, token_auth_method, ...). Mirrors the dashboard's jsonb metadata column. | ||
server_ids | no | MCP server ids this client serves. Empty means "all servers in the project". | ||
status | no | Lifecycle status: "active" | "inactive" | "revoked". |
created_at | output-only | Row creation time. Output-only. | ||
updated_at | output-only | Last mutation time. Output-only. |
{"signatures":{"go":"func (x *McpOAuthClientsClient) CreateMcpOAuthClient(ctx context.Context, req *mcpv1.CreateMcpOAuthClientRequest) (*mcpv1.McpOAuthClient, error)","python":"create_mcp_oauth_client(req: mcp_oauth_clients_pb2.CreateMcpOAuthClientRequest) -\u003e McpOAuthClient","typescript":"createMcpOAuthClient(req: MessageInitShape\u003ctypeof tars_mcp_v1_mcp_oauth_clients_pb.CreateMcpOAuthClientRequestSchema\u003e): Promise\u003cMcpOAuthClient\u003e","cli":"tare api mcp oauth-clients create --provider $PROVIDER --provider-name $PROVIDER_NAME --client-id $CLIENT_ID --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":{"files":[{"name":"main.go","content":"// Command example is a runnable example for the AgentRouter Go SDK.\n// Set AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then `go run .`.\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\tagentrouter \"github.com/tetrateio/agentrouter-go\"\n\tmcpv1 \"github.com/tetrateio/agentrouter-go/genapi/api/tars/mcp/v1\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\tclient, err := agentrouter.New(ctx,\n\t\tagentrouter.WithBaseURL(os.Getenv(\"AGENTROUTER_BASE_URL\")),\n\t\tagentrouter.WithAPIKey(os.Getenv(\"AGENTROUTER_API_KEY\")),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"client: %v\", err)\n\t}\n\n\t// Populate the request fields -- see the \"Request fields\" table above for\n\t// the available fields and which are required.\n\treq := \u0026mcpv1.CreateMcpOAuthClientRequest{}\n\n\tresp, err := client.McpOAuthClients().CreateMcpOAuthClient(ctx, req)\n\tif err != nil {\n\t\tlog.Fatalf(\"call: %v\", err)\n\t}\n\n\tfmt.Printf(\"%+v\\n\", resp)\n}\n"},{"name":"go.mod","content":"module github.com/tetrateio/agentrouter-go-examples/mcpoauthclients/createmcpoauthclient\n\ngo 1.26\n\nrequire github.com/tetrateio/agentrouter-go v0.1.1\n\n// Point this at the directory you extracted the downloaded Go SDK tarball into.\n// The directory name matches the tarball stem on the Download SDK page.\nreplace github.com/tetrateio/agentrouter-go =\u003e ./third_party/agentrouter-go-0.1.1\n"}]},"python":{"files":[{"name":"main.py","content":"\"\"\"Runnable example for the AgentRouter Python SDK.\n\nSet AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then run `python main.py`.\n\"\"\"\nimport os\n\nfrom tars.mcp.v1 import mcp_oauth_clients_pb2\n\nfrom agentrouter_sdk import Client\n\nclient = Client(\n base_url=os.environ[\"AGENTROUTER_BASE_URL\"],\n api_key=os.environ[\"AGENTROUTER_API_KEY\"],\n)\n\n# Populate the request fields -- see the \"Request fields\" table above\n# for the available fields and which are required.\nreq = mcp_oauth_clients_pb2.CreateMcpOAuthClientRequest()\ntry:\n result = client.mcp_oauth_clients.create_mcp_oauth_client(req)\n print(result)\nexcept Exception as err:\n print(\"Error:\", err)\n"},{"name":"requirements.txt","content":"# Point this at the directory you extracted the downloaded Python SDK tarball\n# into. The directory name matches the tarball stem on the Download SDK page.\n# To install instead from PyPI once published, replace the line below with:\n# agentrouter-sdk\u003e=0.1.0\nagentrouter-sdk @ file:./third_party/agentrouter-python-0.1.1\n"}]},"typescript":{"files":[{"name":"index.ts","content":"// Runnable example for the AgentRouter TypeScript SDK.\n// Set AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then run `npm install \u0026\u0026 npx tsx index.ts`.\nimport { Client } from '@tetrate/agentrouter-sdk'\n\nconst client = new Client({\n baseUrl: process.env.AGENTROUTER_BASE_URL,\n apiKey: process.env.AGENTROUTER_API_KEY,\n})\n\n// Populate the request fields -- see the \"Request fields\" table above\n// for the available fields and which are required.\nconst req = {}\ntry {\n const result = await client.mcpOauthClients.createMcpOAuthClient(req)\n console.log(result)\n} catch (err) {\n console.error('Error:', err)\n}\n"},{"name":"package.json","content":"{\n \"name\": \"mcpoauthclients\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"type\": \"module\",\n \"dependencies\": {\n \"@tetrate/agentrouter-sdk\": \"file:./third_party/agentrouter-typescript-0.1.1\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^20.0.0\",\n \"typescript\": \"^5.4.0\"\n }\n}\n"},{"name":"tsconfig.json","content":"{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"esModuleInterop\": true,\n \"skipLibCheck\": true\n }\n}\n"}]},"cli":"tare api mcp oauth-clients create --provider $PROVIDER --provider-name $PROVIDER_NAME --client-id $CLIENT_ID --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
Changed in v0.2.0 (bug fixes): The MCP OAuth clients API is now reachable. Every call to it (from the SDKs, the REST endpoints, or the API explorer) previously returned an empty success response and saved nothing, because the service was never routed on the management API. Creating, reading, updating and deleting MCP OAuth clients now works as documented.
What it does: Returns a single OAuth client by id. Never returns the client_secret. Account tier: any project member may read.
Request fields:
| Field | Required | Description |
|---|---|---|
customer_id | no | Defaults to the caller's session customer when empty. |
project_id | no | Defaults to the caller's session project when empty. |
id | yes | Required: uuid of the client to fetch (McpOAuthClient.id). |
Response fields:
| Field | Required | Description | ||
|---|---|---|---|---|
id | output-only | Server-assigned uuid row id. Output-only. | ||
customer_id | output-only | Owning customer scope. Defaults to the caller's session customer when empty on the request; immutable once set. | ||
project_id | output-only | Owning project scope. Defaults to the caller's session project when empty on the request; immutable once set. | ||
provider | yes | Stable provider key, e.g. "github", "google". Unique per (customer, project). Required on create. | ||
provider_name | yes | Human-friendly display name for the provider, e.g. "GitHub". | ||
client_id | yes | OAuth client id issued by the upstream provider. | ||
authorization_url | yes | OAuth authorization endpoint URL. | ||
token_url | yes | OAuth token endpoint URL. | ||
scopes | no | OAuth scopes requested during the authorization flow. | ||
redirect_uris | no | Allowed redirect URIs for the authorization-code flow. | ||
metadata | no | Free-form provider configuration (discovery_url, token_auth_method, ...). Mirrors the dashboard's jsonb metadata column. | ||
server_ids | no | MCP server ids this client serves. Empty means "all servers in the project". | ||
status | no | Lifecycle status: "active" | "inactive" | "revoked". |
created_at | output-only | Row creation time. Output-only. | ||
updated_at | output-only | Last mutation time. Output-only. |
{"signatures":{"go":"func (x *McpOAuthClientsClient) GetMcpOAuthClient(ctx context.Context, req *mcpv1.GetMcpOAuthClientRequest) (*mcpv1.McpOAuthClient, error)","python":"get_mcp_oauth_client(req: mcp_oauth_clients_pb2.GetMcpOAuthClientRequest) -\u003e McpOAuthClient","typescript":"getMcpOAuthClient(req: MessageInitShape\u003ctypeof tars_mcp_v1_mcp_oauth_clients_pb.GetMcpOAuthClientRequestSchema\u003e): Promise\u003cMcpOAuthClient\u003e","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":{"files":[{"name":"main.go","content":"// Command example is a runnable example for the AgentRouter Go SDK.\n// Set AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then `go run .`.\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\tagentrouter \"github.com/tetrateio/agentrouter-go\"\n\tmcpv1 \"github.com/tetrateio/agentrouter-go/genapi/api/tars/mcp/v1\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\tclient, err := agentrouter.New(ctx,\n\t\tagentrouter.WithBaseURL(os.Getenv(\"AGENTROUTER_BASE_URL\")),\n\t\tagentrouter.WithAPIKey(os.Getenv(\"AGENTROUTER_API_KEY\")),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"client: %v\", err)\n\t}\n\n\t// Populate the request fields -- see the \"Request fields\" table above for\n\t// the available fields and which are required.\n\treq := \u0026mcpv1.GetMcpOAuthClientRequest{}\n\n\tresp, err := client.McpOAuthClients().GetMcpOAuthClient(ctx, req)\n\tif err != nil {\n\t\tlog.Fatalf(\"call: %v\", err)\n\t}\n\n\tfmt.Printf(\"%+v\\n\", resp)\n}\n"},{"name":"go.mod","content":"module github.com/tetrateio/agentrouter-go-examples/mcpoauthclients/getmcpoauthclient\n\ngo 1.26\n\nrequire github.com/tetrateio/agentrouter-go v0.1.1\n\n// Point this at the directory you extracted the downloaded Go SDK tarball into.\n// The directory name matches the tarball stem on the Download SDK page.\nreplace github.com/tetrateio/agentrouter-go =\u003e ./third_party/agentrouter-go-0.1.1\n"}]},"python":{"files":[{"name":"main.py","content":"\"\"\"Runnable example for the AgentRouter Python SDK.\n\nSet AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then run `python main.py`.\n\"\"\"\nimport os\n\nfrom tars.mcp.v1 import mcp_oauth_clients_pb2\n\nfrom agentrouter_sdk import Client\n\nclient = Client(\n base_url=os.environ[\"AGENTROUTER_BASE_URL\"],\n api_key=os.environ[\"AGENTROUTER_API_KEY\"],\n)\n\n# Populate the request fields -- see the \"Request fields\" table above\n# for the available fields and which are required.\nreq = mcp_oauth_clients_pb2.GetMcpOAuthClientRequest()\ntry:\n result = client.mcp_oauth_clients.get_mcp_oauth_client(req)\n print(result)\nexcept Exception as err:\n print(\"Error:\", err)\n"},{"name":"requirements.txt","content":"# Point this at the directory you extracted the downloaded Python SDK tarball\n# into. The directory name matches the tarball stem on the Download SDK page.\n# To install instead from PyPI once published, replace the line below with:\n# agentrouter-sdk\u003e=0.1.0\nagentrouter-sdk @ file:./third_party/agentrouter-python-0.1.1\n"}]},"typescript":{"files":[{"name":"index.ts","content":"// Runnable example for the AgentRouter TypeScript SDK.\n// Set AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then run `npm install \u0026\u0026 npx tsx index.ts`.\nimport { Client } from '@tetrate/agentrouter-sdk'\n\nconst client = new Client({\n baseUrl: process.env.AGENTROUTER_BASE_URL,\n apiKey: process.env.AGENTROUTER_API_KEY,\n})\n\n// Populate the request fields -- see the \"Request fields\" table above\n// for the available fields and which are required.\nconst req = {}\ntry {\n const result = await client.mcpOauthClients.getMcpOAuthClient(req)\n console.log(result)\n} catch (err) {\n console.error('Error:', err)\n}\n"},{"name":"package.json","content":"{\n \"name\": \"mcpoauthclients\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"type\": \"module\",\n \"dependencies\": {\n \"@tetrate/agentrouter-sdk\": \"file:./third_party/agentrouter-typescript-0.1.1\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^20.0.0\",\n \"typescript\": \"^5.4.0\"\n }\n}\n"},{"name":"tsconfig.json","content":"{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"esModuleInterop\": true,\n \"skipLibCheck\": true\n }\n}\n"}]},"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
Changed in v0.2.0 (bug fixes): The MCP OAuth clients API is now reachable. Every call to it (from the SDKs, the REST endpoints, or the API explorer) previously returned an empty success response and saved nothing, because the service was never routed on the management API. Creating, reading, updating and deleting MCP OAuth clients now works as documented.
What it does: Lists every non-deleted OAuth client in the (customer, project) scope. Account tier: any project member may read.
Request fields:
| Field | Required | Description |
|---|---|---|
customer_id | no | Defaults to the caller's session customer when empty. |
project_id | no | Defaults to the caller's session project when empty. |
page | no | Cursor-pagination inputs (page size + continuation token). |
Response fields:
| Field | Required | Description |
|---|---|---|
clients | no | OAuth clients in the requested scope (metadata only, no secrets). |
page | no | Cursor-pagination outputs (next-page token). |
{"signatures":{"go":"func (x *McpOAuthClientsClient) ListMcpOAuthClients(ctx context.Context, req *mcpv1.ListMcpOAuthClientsRequest) (*mcpv1.ListMcpOAuthClientsResponse, error)","python":"list_mcp_oauth_clients(req: mcp_oauth_clients_pb2.ListMcpOAuthClientsRequest) -\u003e ListMcpOAuthClientsResponse","typescript":"listMcpOAuthClients(req: MessageInitShape\u003ctypeof tars_mcp_v1_mcp_oauth_clients_pb.ListMcpOAuthClientsRequestSchema\u003e): Promise\u003cListMcpOAuthClientsResponse\u003e","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":{"files":[{"name":"main.go","content":"// Command example is a runnable example for the AgentRouter Go SDK.\n// Set AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then `go run .`.\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\tagentrouter \"github.com/tetrateio/agentrouter-go\"\n\tmcpv1 \"github.com/tetrateio/agentrouter-go/genapi/api/tars/mcp/v1\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\tclient, err := agentrouter.New(ctx,\n\t\tagentrouter.WithBaseURL(os.Getenv(\"AGENTROUTER_BASE_URL\")),\n\t\tagentrouter.WithAPIKey(os.Getenv(\"AGENTROUTER_API_KEY\")),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"client: %v\", err)\n\t}\n\n\t// Populate the request fields -- see the \"Request fields\" table above for\n\t// the available fields and which are required.\n\treq := \u0026mcpv1.ListMcpOAuthClientsRequest{}\n\n\tresp, err := client.McpOAuthClients().ListMcpOAuthClients(ctx, req)\n\tif err != nil {\n\t\tlog.Fatalf(\"call: %v\", err)\n\t}\n\n\tfmt.Printf(\"%+v\\n\", resp)\n}\n"},{"name":"go.mod","content":"module github.com/tetrateio/agentrouter-go-examples/mcpoauthclients/listmcpoauthclients\n\ngo 1.26\n\nrequire github.com/tetrateio/agentrouter-go v0.1.1\n\n// Point this at the directory you extracted the downloaded Go SDK tarball into.\n// The directory name matches the tarball stem on the Download SDK page.\nreplace github.com/tetrateio/agentrouter-go =\u003e ./third_party/agentrouter-go-0.1.1\n"}]},"python":{"files":[{"name":"main.py","content":"\"\"\"Runnable example for the AgentRouter Python SDK.\n\nSet AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then run `python main.py`.\n\"\"\"\nimport os\n\nfrom tars.mcp.v1 import mcp_oauth_clients_pb2\n\nfrom agentrouter_sdk import Client\n\nclient = Client(\n base_url=os.environ[\"AGENTROUTER_BASE_URL\"],\n api_key=os.environ[\"AGENTROUTER_API_KEY\"],\n)\n\n# Populate the request fields -- see the \"Request fields\" table above\n# for the available fields and which are required.\nreq = mcp_oauth_clients_pb2.ListMcpOAuthClientsRequest()\ntry:\n result = client.mcp_oauth_clients.list_mcp_oauth_clients(req)\n print(result)\nexcept Exception as err:\n print(\"Error:\", err)\n"},{"name":"requirements.txt","content":"# Point this at the directory you extracted the downloaded Python SDK tarball\n# into. The directory name matches the tarball stem on the Download SDK page.\n# To install instead from PyPI once published, replace the line below with:\n# agentrouter-sdk\u003e=0.1.0\nagentrouter-sdk @ file:./third_party/agentrouter-python-0.1.1\n"}]},"typescript":{"files":[{"name":"index.ts","content":"// Runnable example for the AgentRouter TypeScript SDK.\n// Set AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then run `npm install \u0026\u0026 npx tsx index.ts`.\nimport { Client } from '@tetrate/agentrouter-sdk'\n\nconst client = new Client({\n baseUrl: process.env.AGENTROUTER_BASE_URL,\n apiKey: process.env.AGENTROUTER_API_KEY,\n})\n\n// Populate the request fields -- see the \"Request fields\" table above\n// for the available fields and which are required.\nconst req = {}\ntry {\n const result = await client.mcpOauthClients.listMcpOAuthClients(req)\n console.log(result)\n} catch (err) {\n console.error('Error:', err)\n}\n"},{"name":"package.json","content":"{\n \"name\": \"mcpoauthclients\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"type\": \"module\",\n \"dependencies\": {\n \"@tetrate/agentrouter-sdk\": \"file:./third_party/agentrouter-typescript-0.1.1\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^20.0.0\",\n \"typescript\": \"^5.4.0\"\n }\n}\n"},{"name":"tsconfig.json","content":"{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"esModuleInterop\": true,\n \"skipLibCheck\": true\n }\n}\n"}]},"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
Changed in v0.5.0 (new features): You can now register and connect an MCP server whose OAuth provider issues public clients, which have no client secret.
Changed in v0.2.0 (bug fixes): The MCP OAuth clients API is now reachable. Every call to it (from the SDKs, the REST endpoints, or the API explorer) previously returned an empty success response and saved nothing, because the service was never routed on the management API. Creating, reading, updating and deleting MCP OAuth clients now works as documented.
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:
| Field | Required | Description |
|---|---|---|
customer_id | no | Defaults to the caller's session customer when empty. |
project_id | no | Defaults to the caller's session project when empty. |
id | yes | Required: uuid of the client to update (McpOAuthClient.id). |
provider_name | no | Mutable scalar fields. Empty string leaves the existing value untouched. |
client_id | no | undocumented |
client_secret | no | Optional: a non-empty value rotates the wrapped client secret in place. Empty leaves the stored secret untouched. WRITE-ONLY. |
authorization_url | no | undocumented |
token_url | no | undocumented |
status | no | undocumented |
scopes | no | Repeated / map fields: a non-nil value REPLACES the stored value; a nil/omitted value leaves it untouched (see the replace_* flags). |
redirect_uris | no | undocumented |
metadata | no | undocumented |
server_ids | no | undocumented |
replace_scopes | no | Because 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_uris | no | undocumented |
replace_metadata | no | undocumented |
replace_server_ids | no | undocumented |
Response fields:
| Field | Required | Description | ||
|---|---|---|---|---|
id | output-only | Server-assigned uuid row id. Output-only. | ||
customer_id | output-only | Owning customer scope. Defaults to the caller's session customer when empty on the request; immutable once set. | ||
project_id | output-only | Owning project scope. Defaults to the caller's session project when empty on the request; immutable once set. | ||
provider | yes | Stable provider key, e.g. "github", "google". Unique per (customer, project). Required on create. | ||
provider_name | yes | Human-friendly display name for the provider, e.g. "GitHub". | ||
client_id | yes | OAuth client id issued by the upstream provider. | ||
authorization_url | yes | OAuth authorization endpoint URL. | ||
token_url | yes | OAuth token endpoint URL. | ||
scopes | no | OAuth scopes requested during the authorization flow. | ||
redirect_uris | no | Allowed redirect URIs for the authorization-code flow. | ||
metadata | no | Free-form provider configuration (discovery_url, token_auth_method, ...). Mirrors the dashboard's jsonb metadata column. | ||
server_ids | no | MCP server ids this client serves. Empty means "all servers in the project". | ||
status | no | Lifecycle status: "active" | "inactive" | "revoked". |
created_at | output-only | Row creation time. Output-only. | ||
updated_at | output-only | Last mutation time. Output-only. |
{"signatures":{"go":"func (x *McpOAuthClientsClient) UpdateMcpOAuthClient(ctx context.Context, req *mcpv1.UpdateMcpOAuthClientRequest) (*mcpv1.McpOAuthClient, error)","python":"update_mcp_oauth_client(req: mcp_oauth_clients_pb2.UpdateMcpOAuthClientRequest) -\u003e McpOAuthClient","typescript":"updateMcpOAuthClient(req: MessageInitShape\u003ctypeof tars_mcp_v1_mcp_oauth_clients_pb.UpdateMcpOAuthClientRequestSchema\u003e): Promise\u003cMcpOAuthClient\u003e","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":{"files":[{"name":"main.go","content":"// Command example is a runnable example for the AgentRouter Go SDK.\n// Set AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then `go run .`.\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\tagentrouter \"github.com/tetrateio/agentrouter-go\"\n\tmcpv1 \"github.com/tetrateio/agentrouter-go/genapi/api/tars/mcp/v1\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\tclient, err := agentrouter.New(ctx,\n\t\tagentrouter.WithBaseURL(os.Getenv(\"AGENTROUTER_BASE_URL\")),\n\t\tagentrouter.WithAPIKey(os.Getenv(\"AGENTROUTER_API_KEY\")),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"client: %v\", err)\n\t}\n\n\t// Populate the request fields -- see the \"Request fields\" table above for\n\t// the available fields and which are required.\n\treq := \u0026mcpv1.UpdateMcpOAuthClientRequest{}\n\n\tresp, err := client.McpOAuthClients().UpdateMcpOAuthClient(ctx, req)\n\tif err != nil {\n\t\tlog.Fatalf(\"call: %v\", err)\n\t}\n\n\tfmt.Printf(\"%+v\\n\", resp)\n}\n"},{"name":"go.mod","content":"module github.com/tetrateio/agentrouter-go-examples/mcpoauthclients/updatemcpoauthclient\n\ngo 1.26\n\nrequire github.com/tetrateio/agentrouter-go v0.1.1\n\n// Point this at the directory you extracted the downloaded Go SDK tarball into.\n// The directory name matches the tarball stem on the Download SDK page.\nreplace github.com/tetrateio/agentrouter-go =\u003e ./third_party/agentrouter-go-0.1.1\n"}]},"python":{"files":[{"name":"main.py","content":"\"\"\"Runnable example for the AgentRouter Python SDK.\n\nSet AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then run `python main.py`.\n\"\"\"\nimport os\n\nfrom tars.mcp.v1 import mcp_oauth_clients_pb2\n\nfrom agentrouter_sdk import Client\n\nclient = Client(\n base_url=os.environ[\"AGENTROUTER_BASE_URL\"],\n api_key=os.environ[\"AGENTROUTER_API_KEY\"],\n)\n\n# Populate the request fields -- see the \"Request fields\" table above\n# for the available fields and which are required.\nreq = mcp_oauth_clients_pb2.UpdateMcpOAuthClientRequest()\ntry:\n result = client.mcp_oauth_clients.update_mcp_oauth_client(req)\n print(result)\nexcept Exception as err:\n print(\"Error:\", err)\n"},{"name":"requirements.txt","content":"# Point this at the directory you extracted the downloaded Python SDK tarball\n# into. The directory name matches the tarball stem on the Download SDK page.\n# To install instead from PyPI once published, replace the line below with:\n# agentrouter-sdk\u003e=0.1.0\nagentrouter-sdk @ file:./third_party/agentrouter-python-0.1.1\n"}]},"typescript":{"files":[{"name":"index.ts","content":"// Runnable example for the AgentRouter TypeScript SDK.\n// Set AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then run `npm install \u0026\u0026 npx tsx index.ts`.\nimport { Client } from '@tetrate/agentrouter-sdk'\n\nconst client = new Client({\n baseUrl: process.env.AGENTROUTER_BASE_URL,\n apiKey: process.env.AGENTROUTER_API_KEY,\n})\n\n// Populate the request fields -- see the \"Request fields\" table above\n// for the available fields and which are required.\nconst req = {}\ntry {\n const result = await client.mcpOauthClients.updateMcpOAuthClient(req)\n console.log(result)\n} catch (err) {\n console.error('Error:', err)\n}\n"},{"name":"package.json","content":"{\n \"name\": \"mcpoauthclients\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"type\": \"module\",\n \"dependencies\": {\n \"@tetrate/agentrouter-sdk\": \"file:./third_party/agentrouter-typescript-0.1.1\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^20.0.0\",\n \"typescript\": \"^5.4.0\"\n }\n}\n"},{"name":"tsconfig.json","content":"{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"esModuleInterop\": true,\n \"skipLibCheck\": true\n }\n}\n"}]},"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
Changed in v0.2.0 (bug fixes): The MCP OAuth clients API is now reachable. Every call to it (from the SDKs, the REST endpoints, or the API explorer) previously returned an empty success response and saved nothing, because the service was never routed on the management API. Creating, reading, updating and deleting MCP OAuth clients now works as documented.
What it does: Soft-deletes a client (deleted_at set).
Request fields:
| Field | Required | Description |
|---|---|---|
customer_id | no | Defaults to the caller's session customer when empty. |
project_id | no | Defaults to the caller's session project when empty. |
id | yes | Required: uuid of the client to soft-delete (McpOAuthClient.id). |
{"signatures":{"go":"func (x *McpOAuthClientsClient) DeleteMcpOAuthClient(ctx context.Context, req *mcpv1.DeleteMcpOAuthClientRequest) error","python":"delete_mcp_oauth_client(req: mcp_oauth_clients_pb2.DeleteMcpOAuthClientRequest) -\u003e None","typescript":"deleteMcpOAuthClient(req: MessageInitShape\u003ctypeof tars_mcp_v1_mcp_oauth_clients_pb.DeleteMcpOAuthClientRequestSchema\u003e): Promise\u003cvoid\u003e","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":{"files":[{"name":"main.go","content":"// Command example is a runnable example for the AgentRouter Go SDK.\n// Set AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then `go run .`.\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\tagentrouter \"github.com/tetrateio/agentrouter-go\"\n\tmcpv1 \"github.com/tetrateio/agentrouter-go/genapi/api/tars/mcp/v1\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\tclient, err := agentrouter.New(ctx,\n\t\tagentrouter.WithBaseURL(os.Getenv(\"AGENTROUTER_BASE_URL\")),\n\t\tagentrouter.WithAPIKey(os.Getenv(\"AGENTROUTER_API_KEY\")),\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"client: %v\", err)\n\t}\n\n\t// Populate the request fields -- see the \"Request fields\" table above for\n\t// the available fields and which are required.\n\treq := \u0026mcpv1.DeleteMcpOAuthClientRequest{}\n\n\tif err := client.McpOAuthClients().DeleteMcpOAuthClient(ctx, req); err != nil {\n\t\tlog.Fatalf(\"call: %v\", err)\n\t}\n\n\tfmt.Println(\"ok\")\n}\n"},{"name":"go.mod","content":"module github.com/tetrateio/agentrouter-go-examples/mcpoauthclients/deletemcpoauthclient\n\ngo 1.26\n\nrequire github.com/tetrateio/agentrouter-go v0.1.1\n\n// Point this at the directory you extracted the downloaded Go SDK tarball into.\n// The directory name matches the tarball stem on the Download SDK page.\nreplace github.com/tetrateio/agentrouter-go =\u003e ./third_party/agentrouter-go-0.1.1\n"}]},"python":{"files":[{"name":"main.py","content":"\"\"\"Runnable example for the AgentRouter Python SDK.\n\nSet AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then run `python main.py`.\n\"\"\"\nimport os\n\nfrom tars.mcp.v1 import mcp_oauth_clients_pb2\n\nfrom agentrouter_sdk import Client\n\nclient = Client(\n base_url=os.environ[\"AGENTROUTER_BASE_URL\"],\n api_key=os.environ[\"AGENTROUTER_API_KEY\"],\n)\n\n# Populate the request fields -- see the \"Request fields\" table above\n# for the available fields and which are required.\nreq = mcp_oauth_clients_pb2.DeleteMcpOAuthClientRequest()\ntry:\n result = client.mcp_oauth_clients.delete_mcp_oauth_client(req)\n print(result)\nexcept Exception as err:\n print(\"Error:\", err)\n"},{"name":"requirements.txt","content":"# Point this at the directory you extracted the downloaded Python SDK tarball\n# into. The directory name matches the tarball stem on the Download SDK page.\n# To install instead from PyPI once published, replace the line below with:\n# agentrouter-sdk\u003e=0.1.0\nagentrouter-sdk @ file:./third_party/agentrouter-python-0.1.1\n"}]},"typescript":{"files":[{"name":"index.ts","content":"// Runnable example for the AgentRouter TypeScript SDK.\n// Set AGENTROUTER_BASE_URL and AGENTROUTER_API_KEY in the environment, then run `npm install \u0026\u0026 npx tsx index.ts`.\nimport { Client } from '@tetrate/agentrouter-sdk'\n\nconst client = new Client({\n baseUrl: process.env.AGENTROUTER_BASE_URL,\n apiKey: process.env.AGENTROUTER_API_KEY,\n})\n\n// Populate the request fields -- see the \"Request fields\" table above\n// for the available fields and which are required.\nconst req = {}\ntry {\n const result = await client.mcpOauthClients.deleteMcpOAuthClient(req)\n console.log(result)\n} catch (err) {\n console.error('Error:', err)\n}\n"},{"name":"package.json","content":"{\n \"name\": \"mcpoauthclients\",\n \"version\": \"0.1.0\",\n \"private\": true,\n \"type\": \"module\",\n \"dependencies\": {\n \"@tetrate/agentrouter-sdk\": \"file:./third_party/agentrouter-typescript-0.1.1\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^20.0.0\",\n \"typescript\": \"^5.4.0\"\n }\n}\n"},{"name":"tsconfig.json","content":"{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"bundler\",\n \"strict\": true,\n \"esModuleInterop\": true,\n \"skipLibCheck\": true\n }\n}\n"}]},"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"}