OAuth for remote MCP and the Buildkite CLI
The remote Buildkite MCP server and Buildkite CLI support OAuth. OAuth lets you authorize an application to access Buildkite on your behalf without manually creating and copying an API access token. You log in to Buildkite, select an organization, and approve the requested permissions.
This page explains how authorization and token refresh work, the security testing that covers remote MCP, and what administrators can see in the audit log.
Token lifetime and refresh
OAuth uses a short-lived access token to authorize requests and a refresh token to obtain replacement credentials without another interactive login.
Remote MCP access tokens last up to one hour, and refresh tokens last up to 30 days. These are the MCP-facing token lifetimes, not the lifetimes for every Buildkite OAuth application or the CLI. The underlying Buildkite authorization can shorten their validity.
An access token expiring does not mean you must log in again. An MCP client that supports refresh can renew its credentials automatically. The CLI also supports automatic refresh. Refresh replaces credentials, so the client must save the replacements in a credential store it can write to.
You may need to authorize access again if a refresh token expires, access is revoked, organization membership changes, or the client cannot refresh or save replacement credentials. Refresh does not guarantee an unlimited session.
If an AI tool appears connected but Buildkite tool calls fail, its Buildkite authorization may still need renewal. When reporting authentication problems, include the client and version, authentication method, organization, error message, and approximate time. Do not include tokens, authorization codes, or secrets.
Revoke access
To revoke an OAuth application's access, open Connected Apps in your personal settings and revoke the connection. This invalidates the associated Buildkite access and refresh tokens.
Running bk auth logout removes locally stored CLI credentials but does not revoke the authorization in Buildkite. Use Connected Apps when you need to revoke access rather than only remove credentials from one machine.
API token authentication
The remote MCP API token pass-through endpoint, local MCP server, and CLI can also use an existing API access token instead of OAuth. These connections do not use OAuth refresh and do not create the OAuth authorization audit event described below. Manage their scopes, storage, expiry, and revocation separately. See Managing API access tokens.
Security testing
The remote Buildkite MCP server is included in the Buildkite SOC 2 Type II scope and undergoes external penetration testing every 12 months (or more frequently).
For security assurance documents, including SOC 2 and penetration-test reports, visit the Buildkite Trust Center. Access to reports may require approval or a non-disclosure agreement.
Audit visibility
Successful browser-based OAuth authorization for remote MCP and the CLI creates an organization-scoped OAUTH_APPLICATION_AUTHORIZED event. Buildkite records this event when the application successfully exchanges an authorization code for credentials, not whenever a client starts or reconnects.
Organization administrators on the Enterprise plan can view these events in the Audit Log. Select Settings > Audit > Audit Log, then search the Events tab for type:OAUTH_APPLICATION_AUTHORIZED.
The event identifies the authorizing user, application, organization, and granted scopes, and also includes the IP address and user agent captured during authorization.
This event records who granted access, not ongoing usage. Device login, token refresh, and API-token authentication do not create this event. It is not a record of every CLI command or MCP tool call, or a list of active sessions. The absence of an authorization event does not establish that nobody is using MCP or the CLI.