# Read a connection request

Source: https://docs.musicnerd.net/api-reference/oauth/get-consent

Read a connection request

## GET /api/oauth/consent

Full OpenAPI specification: https://docs.musicnerd.net/spec/oauth.json

## Authentication

This operation's specification permits a request without authentication.

[Authentication guide](https://docs.musicnerd.net/authentication)

## Operation and referenced schemas

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Music Nerd API: OAuth",
    "version": "1.0.0",
    "description": "How agents connect to the MCP server with OAuth: the discovery documents an MCP client reads, and the member's list of connected agents."
  },
  "servers": [
    {
      "url": "https://api.musicnerd.net",
      "description": "Production"
    },
    {
      "url": "https://musicnerd-api-staging.vercel.app",
      "description": "Staging (staging database)"
    }
  ],
  "paths": {
    "/api/oauth/consent": {
      "get": {
        "summary": "Read a connection request",
        "operationId": "getOAuthConsent",
        "security": [],
        "description": "Checks an authorization request and says which agent is asking, for the Music Nerd sign-in page to show before the user approves. Takes the same query as Start authorization.",
        "parameters": [
          {
            "name": "response_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "code"
              ]
            },
            "example": "code",
            "description": "Always `code`."
          },
          {
            "name": "client_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "2f6c1d0e-8a4b-4c47-9a51-3e0f7b9d2c18",
            "description": "The `client_id` from registration."
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "http://127.0.0.1:33418/callback",
            "description": "One of the client's registered redirect URIs, exactly."
          },
          {
            "name": "code_challenge",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM",
            "description": "The PKCE challenge: base64url SHA-256 of the code verifier."
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "S256"
              ]
            },
            "example": "S256",
            "description": "Always `S256`."
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "af0ifjsldkj",
            "description": "Returned unchanged to the client."
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "mcp:tools",
            "description": "`mcp:tools`, the only scope. Optional."
          },
          {
            "name": "resource",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "https://api.musicnerd.net/mcp",
            "description": "`https://api.musicnerd.net/mcp`, if sent."
          }
        ],
        "responses": {
          "200": {
            "description": "The request is valid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "agent",
                    "redirectHost"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "agent": {
                      "type": "string",
                      "description": "The name the agent gave when it registered. Not verified."
                    },
                    "redirectHost": {
                      "type": "string",
                      "description": "The host the user is sent back to, like `127.0.0.1:33418`."
                    }
                  }
                },
                "example": {
                  "status": "ok",
                  "agent": "Claude",
                  "redirectHost": "127.0.0.1:33418"
                }
              }
            }
          },
          "400": {
            "description": "The request is invalid: unknown client, unregistered redirect or missing PKCE.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "status": "error",
                  "error": "Invalid authorization request"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "InternalError": {
        "description": "The database could not be read or written.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "status": "error",
              "error": "Internal server error"
            }
          }
        }
      }
    }
  }
}
```
