class RubyLLM::ActiveRecord::MCPCredential

The OAuth state RubyLLM::MCP keeps for a server, in RubyLLM’s ruby_llm_mcp_credentials table. data is encrypted with Active Record encryption, so the application needs encryption keys.

RubyLLM::ActiveRecord::MCPCredential.where(owner: current_user).pluck(:updated_at)

Each row has an optional polymorphic owner, the record the credentials were authorized for. Its columns:

key

The key RubyLLM stores the state under, unique across the table.

data

Tokens, client registrations, and signing keys, as a Hash. Treat it as a secret.

RubyLLM writes these rows. Read and query them, and add scopes or columns of your own, but do not create, update, or delete them: call deauthorize on the server to forget a user’s credentials.