Skip to content

Add schemas for OAuth entities - #6636

Open
apata wants to merge 1 commit into
mcp/oauth-tablesfrom
mcp/oauth-schemas
Open

Add schemas for OAuth entities#6636
apata wants to merge 1 commit into
mcp/oauth-tablesfrom
mcp/oauth-schemas

Conversation

@apata

@apata apata commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Changes

Adds schemas for OAuth entities. Based on the requirements in https://datatracker.ietf.org/doc/draft-ietf-oauth-v2-1/15/.

Definitions for Plausible MCP use case

  • Protected Resource: User's sites and stats via /mcp endpoint on Plausible app server
  • Resource Owner: user of Plausible
  • Client: browser launched by Claude Code
  • Authorization Server: Plausible app server
  • Resource Server: Plausible app server
        +--------+                               +---------------+
        |        |--(1)- Authorization Request ->|   Resource    |
        |        |                               |     Owner     |
        |        |<-(2)-- Authorization Grant ---|               |
        |        |                               +---------------+
        |        |
        |        |                               +---------------+
        |        |--(3)-- Authorization Grant -->| Authorization |
        | Client |                               |     Server    |
        |        |<-(4)----- Access Token -------|               |
        |        |                               +---------------+
        |        |
        |        |                               +---------------+
        |        |--(5)----- Access Token ------>|    Resource   |
        |        |                               |     Server    |
        |        |<-(6)--- Protected Resource ---|               |
        +--------+                               +---------------+

                      Figure 1: Abstract Protocol Flow
  +--------+                                           +---------------+
  |        |--(1)------- Authorization Grant --------->|               |
  |        |                                           |               |
  |        |<-(2)----------- Access Token -------------|               |
  |        |               & Refresh Token             |               |
  |        |                                           |               |
  |        |                            +----------+   |               |
  |        |--(3)---- Access Token ---->|          |   |               |
  |        |                            |          |   |               |
  |        |<-(4)- Protected Resource --| Resource |   | Authorization |
  | Client |                            |  Server  |   |     Server    |
  |        |--(5)---- Access Token ---->|          |   |               |
  |        |                            |          |   |               |
  |        |<-(6)- Invalid Token Error -|          |   |               |
  |        |                            +----------+   |               |
  |        |                                           |               |
  |        |--(7)----------- Refresh Token ----------->|               |
  |        |                                           |               |
  |        |<-(8)----------- Access Token -------------|               |
  +--------+           & Optional Refresh Token        +---------------+

               Figure 2: Refreshing an Expired Access Token

Tests

  • This PR does not require tests

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • This PR does not change the UI

@apata
apata requested a review from a team September 2, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant