OAuth for MCP clients

OAuth 2.1 endpoints, scopes and metadata for building an MCP client that connects to WriteStack.

WriteStack's MCP server is an OAuth 2.1 protected resource. Clients discover everything from the metadata documents, register dynamically, and use the authorization code flow with PKCE. Most MCP clients do all of this for you.

FlowAuthorization code with PKCE (S256)
Authorizehttps://www.writestack.io/oauth/authorize
Tokenhttps://www.writestack.io/api/oauth/token
Dynamic client registrationhttps://www.writestack.io/api/oauth/register
Authorization server metadatahttps://www.writestack.io/.well-known/oauth-authorization-server
Protected resource metadatahttps://www.writestack.io/.well-known/oauth-protected-resource
Scopesmcp, offline_access
Grant typesauthorization_code, refresh_token
Client authenticationPublic clients, no secret (token_endpoint_auth_method: none)

Flow

  1. Call the MCP endpoint without a token. The server answers 401 and points to the protected resource metadata.
  2. Read the authorization server metadata and register your client at the registration endpoint.
  3. Send the writer to the authorize URL with a PKCE code_challenge. They sign in to WriteStack and approve.
  4. Exchange the code at the token endpoint. Request offline_access to get a refresh token.
  5. Call https://www.writestack.io/api/mcp/mcp with Authorization: Bearer <access_token>.

Tokens act as the writer who approved them. Plan access still applies: an account without MCP gets an error that points to Settings.

On this page