Overview
Infisical provides end-to-end encrypted secrets management for your MCP Server. Store API keys, credentials, and configuration securely with automatic injection and rotation.Infisical is an open-source alternative to HashiCorp Vault with a focus on developer experience and end-to-end encryption.
Why Infisical?
Security
- End-to-end encryption
- Zero-knowledge architecture
- Audit logging
- Secret versioning
Developer Experience
- Simple API
- CLI tools
- SDK support
- Auto-injection
Operations
- Secret rotation
- Access controls
- Environment sync
- Compliance ready
Integration
- Kubernetes native
- CI/CD pipelines
- Cloud platforms
- Docker Compose
Quick Start
1
Sign Up
- Go to https://app.infisical.com
- Create account
- Create organization
- Create project: “mcp-server-langgraph”
2
Create Service Account
In Infisical Dashboard:
- Go to Project Settings → Service Accounts
- Click “Create Service Account”
- Name:
langgraph-production - Select environment:
production - Set permissions:
Read - Copy Client ID and Client Secret
3
Configure Application
4
Add Secrets to Infisical
In Infisical Dashboard:
- Go to Secrets
- Select
productionenvironment - Add secrets:
ANTHROPIC_API_KEYGOOGLE_API_KEYJWT_SECRET_KEYKEYCLOAK_CLIENT_SECRETREDIS_PASSWORD
5
Test Integration
Self-Hosted Deployment
- Docker Compose
- Kubernetes
Usage Patterns
Automatic Secret Loading
Secrets are automatically loaded on application startup:Manual Secret Retrieval
Environment-Specific Secrets
Kubernetes Integration
Infisical Operator
Service Account Credentials
Auto-Inject Secrets
Secret Organization
Folder Structure
Naming Conventions
Good:ANTHROPIC_API_KEY(service + type)DATABASE_PASSWORD(resource + type)JWT_SECRET_KEY(purpose + type)
KEY1(unclear)secret(not descriptive)temp_api_key(indicates temporary usage)
Access Control
Role-Based Access
Audit Logging
Enable audit logs to track secret access:Secret Rotation
Manual Rotation
Automatic Rotation
Zero-Downtime Rotation
Best Practices
Never Commit Secrets
Never Commit Secrets
Never commit secrets to Git:
Use Service Accounts
Use Service Accounts
Create dedicated service accounts per environment:
langgraph-dev(development)langgraph-staging(staging)langgraph-prod(production)cicd-deploy(CI/CD pipelines)
Principle of Least Privilege
Principle of Least Privilege
Grant minimal necessary permissions:
Rotate Regularly
Rotate Regularly
Establish rotation schedule:
- API Keys: Every 90 days
- Passwords: Every 60 days
- JWT Secrets: Every 30 days
- After Incidents: Immediately
Monitor Access
Monitor Access
Enable and review audit logs:
Migration from .env Files
1
Export Secrets
Import script
with open(‘secrets.txt’) as f: for line in f: key, value = line.strip().split(’=’, 1) client.create_secret( secret_name=key, secret_value=value, project_id=project_id, environment=“production” )2
Verify
Troubleshooting
Authentication failed
Authentication failed
Secret not found
Secret not found
Check:
- Secret name matches exactly (case-sensitive)
- Correct environment selected
- Service account has access
- Project ID correct
Slow secret loading
Slow secret loading
Solutions:
- Cache secrets locally
- Use Kubernetes operator for auto-sync
- Batch secret retrieval
Next Steps
Kubernetes Deployment
Deploy with Infisical operator
Security Overview
Learn security architecture
Production Checklist
Secrets management requirements
Configuration
Configure application
Secure by Default: Infisical ensures your secrets are encrypted and centrally managed!