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
- Log in to ViaFoundry
- Click your profile icon (top right)
- Select Profile → Personal Access Tokens
Step 2: Create a new token
- Click Create Token
- Enter a descriptive Token Name (e.g.,
Automation TokenorCursor MCP Token) - 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) |

Step 4: Copy and save your token
After creation, you’ll see your token displayed only 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.