Skip to main content
Version: 1.1.0 (latest)

Scalekit

Scalekit integration is available via rust-mcp-extra.

[dependencies]
rust-mcp-extra = "1.0"
use rust_mcp_extra::auth_provider::scalekit::{ScalekitAuthProvider, ScalekitAuthOptions};

let auth_provider = ScalekitAuthProvider::new(ScalekitAuthOptions {
// Scalekit environment URL (from the dashboard, Settings section).
// A missing https:// prefix is added automatically.
environment_url: "https://your-env.scalekit.com".to_string(),
// MCP server resource ID (from the dashboard, MCP Servers section)
resource_id: "sk_resource_...".to_string(),
// Public base URL of this MCP server (used for discovery endpoints)
mcp_server_url: "https://mcp.example.com".to_string(),
// Optional overrides; see docs for all fields
required_scopes: None,
resource_name: None,
resource_documentation: None,
token_verifier: None,
validate_audience: None, // defaults to mcp_server_url
disable_audience_validation: false,
})
.await?; // construction fetches the resource's discovery document

let server = create_axum_server(
server_info,
handler,
AxumServerOptions {
auth: Some(Arc::new(auth_provider)),
..Default::default()
},
);

ScalekitAuthProvider::new is async - it pulls the authorization-server metadata from {environment_url}/.well-known/oauth-authorization-server/resources/{resource_id} during construction. Tokens are verified with cached JWKS signature checks; the verifier is replaceable via token_verifier.

See rust_mcp_extra::auth_provider::scalekit for the full ScalekitAuthOptions reference.