# List connected agents

Source: https://docs.musicnerd.net/api-reference/oauth/list-connections

List connected agents

## GET /api/oauth/connections

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

## Authentication

This operation requires one of the security alternatives in the specification below. Security scheme definitions are included where present in the published specification.

[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/connections": {
      "get": {
        "summary": "List connected agents",
        "operationId": "listOAuthConnections",
        "security": [
          {
            "privyBearer": []
          }
        ],
        "description": "The agents the signed-in user has connected to the MCP server, newest first. A connection lasts until the user disconnects it, and its refresh tokens rotate on every use. Reusing a refresh token that was already used disconnects the agent, if it is the last one used or was used in the past 30 days.",
        "responses": {
          "200": {
            "description": "The connections.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "connections"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok"
                      ]
                    },
                    "connections": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Connection"
                      }
                    }
                  }
                },
                "example": {
                  "status": "ok",
                  "connections": [
                    {
                      "id": "conn_7f3a2c",
                      "agent": "Claude",
                      "scopes": [
                        "mcp:tools"
                      ],
                      "connectedAt": "2026-11-20T18:02:11.000Z",
                      "lastUsedAt": "2026-11-20T19:40:05.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/NotSignedIn"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Connection": {
        "type": "object",
        "required": [
          "id",
          "agent",
          "scopes",
          "connectedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "The connection's ID."
          },
          "agent": {
            "type": "string",
            "description": "The name the agent gave when it registered, like `Claude`. Not verified."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What the member approved, like `mcp:tools`."
          },
          "connectedAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastUsedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the agent last refreshed its token, or null."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ]
          },
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "NotSignedIn": {
        "description": "No token, or an invalid or expired one.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "status": "error",
              "error": "Not signed in"
            }
          }
        }
      },
      "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"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "privyBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Access token",
        "description": "A Privy access token for a signed-in Music Nerd user, as musicnerd.net holds it."
      }
    }
  }
}
```
