Skip to content
Learning Outcomes
  • Understand what Personal Access Tokens (PATs) are and when to use them.
  • Choose the right token type (General vs MCP).
  • Generate and securely store a token.
  • Use a token with the SDK or scripts.

Personal Access Tokens (PATs)

Personal Access Tokens (PATs) provide secure, programmatic access to ViaFoundry APIs without using your password.


Personal Access Tokens Overview

PATs are long, random strings used to authenticate requests to ViaFoundry.

Common scenarios

  • Running pipelines from CI/CD
  • Downloading report files programmatically
  • Powering an AI assistant integration using MCP
Treat tokens like passwords
  • Do not commit tokens to Git
  • Do not paste tokens into screenshots or tickets
  • Prefer environment variables or a secrets manager

Token Types

ViaFoundry supports two types of Personal Access Tokens:

General Purpose Tokens

Attribute Description
Prefix None
Use Case API access, CLI, Python SDK, R SDK
Format <128-character-random-string>

Best for

  • Python scripts using ViaFoundry SDK
  • Command-line automation
  • CI/CD pipelines
  • Custom integrations

MCP Tokens

Attribute Description
Prefix via_mcp_
Use Case AI assistant integration
Format via_mcp_<128-character-random-string>

Best for

  • Cursor IDE integration
  • VS Code (Continue extension)
  • Claude Desktop
  • Any MCP-compatible AI tool

MCP prefix is required

MCP tokens must start with via_mcp_ prefix. The MCP server validates this prefix and rejects tokens without it.

Setting up MCP?

After creating an MCP token, see MCP Integration for client configuration.


How to Generate Tokens

Step 1: Navigate to Personal Access Tokens

  1. Log in to ViaFoundry
  2. Click your profile icon (top right)
  3. Select ProfilePersonal Access Tokens

Step 2: Create a new token

  1. Click Create Token
  2. Enter a descriptive Token Name (e.g., Automation Token or Cursor MCP Token)
  3. Set Expiration Date (default: 30 days, max: 1 year)

Step 3: Select token usage

Option When to Use
General Purpose Python SDK, CLI, API scripts
MCP (Model Context Protocol) AI assistants (Cursor, VS Code, Claude)

Token Type Selection

Step 4: Copy and save your token

After creation, you’ll see your token displayed only once.

Copy Token Once

Copy immediately

The token cannot be viewed again after closing the dialog. Store it securely (password manager, secrets manager, or an encrypted vault).


Using Tokens (SDK / Scripts)

Python SDK

from viafoundry import ViaFoundryClient

client = ViaFoundryClient()
client.configure_auth_token(
    hostname="https://your-viafoundry.com",
    token="your-token-here"
)
Use environment variables

Prefer loading tokens from env vars (e.g., VIAFOUNDRY_TOKEN) rather than hardcoding them in scripts.