Credential Vault MCP
Enables secure credential storage for AI agents by encrypting secrets and providing agent-invisible references, ensuring sensitive data never leaks to the model.
README
π Credential Vault MCP
Secure credential storage for AI agents. Keep your passwords, API keys, and secrets encrypted and invisible to AI models. When agents need credentials, they get a secure referenceβnever the actual value.
Why Credential Vault?
AI agents are incredibly powerful, but they shouldn't have access to your sensitive credentials. Credential Vault solves this with a security-first architecture:
- π End-to-End Encryption: ChaCha20-Poly1305 encryption with Argon2i key derivation
- π» Agent-Invisible: Agents see only credential IDs, never actual values
- π‘οΈ Zero Trust: Credentials stored separately from AI context
- π Full Audit Trail: Track every credential access and modification
- π Conflict Detection: Automatically detect credential changes and duplicates
- π― Easy Setup: One-command initialization, MCP integration ready
Security Architecture
βββββββββββββββββββββββββββββββββββββββββββ
β AI Agent / Claude β
β (Cannot see credential values) β
ββββββββββββββ¬βββββββββββββββββββββββββββββ
β
β Requests: "Get stripe_api_key"
β Receives: {credential_id: "cred_xxx", name: "stripe_api_key"}
β
ββββββββββββββΌβββββββββββββββββββββββββββββ
β MCP Tool Interface β
β β’ store_credential β
β β’ get_credential_reference β
β β’ list_credentials β
ββββββββββββββ¬βββββββββββββββββββββββββββββ
β
ββββββββββββββΌβββββββββββββββββββββββββββββ
β Credential Storage (Encrypted) β
β ~/.credential-vault-mcp/vault.json β
β β
β ChaCha20-Poly1305 Encryption β
β Argon2i Key Derivation β
β 600 File Permissions (User Only) β
ββββββββββββββββββββββββββββββββββββββββββββ
Quick Start
1. Installation
npm install -g credential-vault-mcp
2. Initialize Vault
credential-vault init
You'll be prompted to set a master password. This password:
- Never leaves your machine
- Is never sent to any server
- Is used to derive an encryption key (not stored directly)
- Must be at least 8 characters
3. Add Your First Credential
credential-vault add stripe_api_key --type api_key
4. Configure MCP in Claude Code / Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"credential-vault": {
"command": "credential-vault-mcp",
"args": []
}
}
}
Or for development:
{
"mcpServers": {
"credential-vault": {
"command": "npx",
"args": ["credential-vault-mcp"]
}
}
}
5. Use in Claude
Tell Claude:
I have credentials stored in Credential Vault MCP. Can you initialize the vault with my master password, then retrieve my stripe_api_key?
Claude will:
- Call
initialize_vaulttool with your master password - Call
get_credential_referenceto get credential ID - Never see the actual API key value
CLI Commands
List all credentials
credential-vault list
Get a credential value
credential-vault get stripe_api_key
Delete a credential
credential-vault delete stripe_api_key
View audit log
credential-vault audit 100
Verify vault integrity
credential-vault verify
Available MCP Tools
initialize_vault
Initialize the vault with master password. Call this first.
{
"master_password": "your-secure-password-8+chars"
}
store_credential
Store a new credential (encrypted).
{
"name": "stripe_api_key",
"value": "sk_live_...",
"type": "api_key"
}
Types: api_key, password, token, connection_string, ssh_key, custom
get_credential_reference
Get a credential reference (safe for agents).
{
"credential_name": "stripe_api_key"
}
Returns: { credential_id: "cred_xxx", name: "...", type: "..." }
list_credentials
List all stored credentials (no values).
delete_credential
Permanently delete a credential.
get_audit_log
View access and modification history.
Security Best Practices
β DO
- β Use a strong, unique master password (20+ characters recommended)
- β Store your master password in a password manager
- β Review audit logs regularly
- β Rotate sensitive credentials periodically
- β
Run
credential-vault verifyto check vault integrity - β Keep your system and dependencies updated
β DON'T
- β Share your master password
- β Store master password in plaintext
- β Use the same master password as other services
- β Store credentials in public/shared environments without encryption
- β Ignore audit log warnings about conflicts
- β Commit
.credential-vault-mcp/to version control
File Structure
~/.credential-vault-mcp/
βββ vault.json # Encrypted credential storage (mode: 600)
βββ [secure directory] # Stored in user home, readable only by user
Permissions: Vault directory and file are created with 0700 / 0600 permissions (user read/write only).
Encryption Details
- Algorithm: ChaCha20-Poly1305 (AEAD)
- Key Derivation: Argon2i (OPSLIMIT_MODERATE, MEMLIMIT_MODERATE)
- Nonce: Random 24-byte nonce per credential
- Integrity: Poly1305 MAC prevents tampering
- Library: libsodium.js (audited crypto library)
Each credential is encrypted independently with a random nonce. Even if one credential is compromised, others remain secure.
Advanced Usage
Using with different Claude interfaces
Claude.ai Code
Add to MCP settings in Code interface
Claude Desktop App
Edit claude_desktop_config.json:
{
"mcpServers": {
"credential-vault": {
"command": "npx",
"args": ["credential-vault-mcp"]
}
}
}
VS Code Extension
Configure in extension settings for Claude extension
Backing up credentials
Important: Your master password is required to decrypt credentials.
# Backup encrypted vault (safe - encrypted)
cp ~/.credential-vault-mcp/vault.json ~/backup/vault.json.backup
# Never do this:
# β cp ~/.credential-vault-mcp/vault.json /public/location
# β git add vault.json
Handling master password changes
Currently: Delete old vault and create new one
rm ~/.credential-vault-mcp/vault.json
credential-vault init
Then re-add credentials with new master password.
Troubleshooting
"Vault not initialized" error
# Initialize first
credential-vault init
"Permission denied" error
Check file permissions:
ls -la ~/.credential-vault-mcp/vault.json
# Should show: -rw------- (600)
Fix permissions:
chmod 600 ~/.credential-vault-mcp/vault.json
Forgotten master password?
Unfortunately, there's no recovery. The password is required to decrypt credentials.
Prevention: Store master password in a password manager with recovery codes.
"Conflict detected" warning
This means a credential with the same value exists under a different name. This could indicate:
- Password reuse (audit the old credential)
- Accidental duplicate entry
- Shared secret across services
Check audit log:
credential-vault audit
Development
Clone & Install
git clone https://github.com/CipherSatoru/credential-vault-mcp.git
cd credential-vault-mcp
npm install
Build
npm run build
Run in development
npm run dev
Test CLI
npm run cli -- init
Contributing
Contributions welcome! This is security-sensitive software, so:
- Security first: Test all encryption paths
- No plaintext logging: Credentials must never be logged
- Audit trail: Track what happens
- Documentation: Update SECURITY.md for significant changes
License
MIT License - See LICENSE file for details
Support
- π Read SECURITY.md for security details
- π Report issues
- π¬ Discussions
Disclaimer
This tool encrypts credentials locally on your machine. However:
- The MCP interface is only as secure as its integration
- Running on a compromised machine still exposes credentials
- Master password security is your responsibility
- No encryption is perfect - use defense in depth
Always follow your organization's security policies when handling credentials.
Made with π for secure AI agent workflows
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.