McpOAuthTokens (auth/mcp_credentials.rs)

forgecode · crates/forge_infra/src/auth/mcp_credentials.rs · rust · Apache-2.0
auth, Auth / Identity

! MCP OAuth Credential Storage ! ! Stores OAuth tokens separately from LLM provider credentials. ! Credentials are bound to specific MCP server URLs.

// Source: https://github.com/tailcallhq/forgecode | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
//! MCP OAuth Credential Storage
//!
//! Stores OAuth tokens separately from LLM provider credentials.
//! Credentials are bound to specific MCP server URLs.

use std::collections::HashMap;

use anyhow::Result;
use forge_domain::Environment;
use serde::{Deserialize, Serialize};
use tokio::fs;

/// MCP OAuth tokens for a single server.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct McpOAuthTokens {
    pub access_token: String,
    pub refresh_token: Option<String>,
    pub expires_at: Option<u64>,
    pub scope: Option<String>,
}

/// Client registration info (fo

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key