Credentials
Copy page
The credentials are a mechanism for securely storing and retrieving credentials for mcp servers.
Securely store and retrieve authentication credentials for MCP servers.
How Credential Storage Works
Key concepts:
- Credential stores handle the actual storage and retrieval of credential data
- Credential references define how to find and use stored credentials
- TypeScript SDK vs Visual Builder offer different creation methods depending on the credential type
The framework uses a system that stores references to credentials and retrieves the actual credential values at runtime. When you define a credential, you're creating a reference that tells the system where and how to find the credential data. The actual credential is fetched at runtime and injected into the authorization headers for MCP tools.
Key limitations: The TypeScript SDK can only directly create Memory store credentials. Nango and Keychain stores require OAuth authorization flows with user interaction, which are handled through the Visual Builder interface.
Credential Store Types
The framework supports three credential store types, each suited for different authentication patterns.
Memory Store
Common use case: Simple API keys and bearer tokens stored in environment variables. Configured directly through the TypeScript SDK.
- Credentials retrieved from environment variables at runtime
- Suitable for both development and production environments
- Direct configuration via
credential()
function in TypeScript SDK
Nango Store
Common use case: OAuth tokens from OAuth2.1/PKCE flows, complex OAuth flows, integrating with external services (Slack, GitHub, Google, etc.), when extra headers are needed, etc. Credentials configured through Visual Builder.
- Managed through Nango (self-hosted or cloud)
- Supports various authentication methods: OAuth2.0, API keys, basic auth, and more
- Can provide additional metadata headers passed to MCP servers
- Requires OAuth setup through Visual Builder
Keychain Store
Common use case: Locally stored OAuth tokens from OAuth2.1/PKCE flows. Credentials configured through Visual Builder.
- Credentials stored in native OS keychain (macOS Keychain Access, Windows Credential Manager, Linux Secret Service)
- Mainly used locally for development with OAuth services
- Requires OAuth setup through Visual Builder
Creating and Using Credentials
Basic Setup Example
Configuration Options
Credential Configuration
Parameter | Type | Required | Description |
---|---|---|---|
id | string | Yes | Unique identifier for the credential |
type | CredentialStoreType | Yes | Type of credential store (memory, nango, or keychain) |
credentialStoreId | string | Yes | Identifier for the specific credential store instance |
retrievalParams | object | Yes | Parameters for retrieving the credential from the store. See below for more details. |
Retrieval Parameters by Store Type
Memory store credentials:
Nango store credentials (created through the Visual Builder - OAuth2.1/PKCE flow or Bearer authentication flow):
Keychain store credentials (created through the Visual Builder - OAuth2.1/PKCE flow):
Environment-aware Credentials
You can also define credentials in your environment files:
Then reference them in your tools:
This pattern is useful if you want to keep track of different credentials for different environments. When you push your project using the Inkeep CLI inkeep push
command with the --env
flag, the credentials will be loaded from the appropriate environment file. For example, if you run inkeep push --env development
, the credentials will be loaded from the environments/development.env.ts
file.