MCP Secrets Vault
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Secrets Vault Use the github_api secret to fetch my latest GitHub notifications"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Secrets Vault
A secure Model Context Protocol (MCP) server that enables AI assistants to use secrets (API keys, tokens) without ever exposing them. Built with TypeScript, featuring policy-based access control, rate limiting, and comprehensive audit logging.

π Security First
Key Security Guarantee: AI assistants can use your secrets to perform actions but will NEVER see the actual secret values.
Secrets are stored only in environment variables
All outputs are sanitized before returning to the AI
Every action is logged for audit compliance
Deny-by-default policy enforcement
Rate limiting prevents abuse
Related MCP server: keywarden
π Quick Start
Installation
Option 1: Global Installation
npm install -g mcp-secrets-vault
mcp-secrets-vault doctor # Verify installationOption 2: Direct Usage with npx (Recommended)
npx mcp-secrets-vault doctor # Test without installingOption 3: Local Installation in Project
npm install mcp-secrets-vaultMCP Client Configuration
For use with Claude Desktop or other MCP clients:
{
"mcpServers": {
"secrets-vault": {
"command": "npx",
"args": ["mcp-secrets-vault"],
"env": {
"VAULT_CONFIG": "./vault.config.json"
}
}
}
}Basic Setup
Set your environment variables:
export GITHUB_TOKEN="ghp_example123fake456token"
export OPENAI_API_KEY="sk-fake789example012key"Create a configuration file (
vault.config.json):
{
"secrets": [
{
"secretId": "github_api",
"envVar": "GITHUB_TOKEN",
"description": "GitHub API access"
},
{
"secretId": "openai_key",
"envVar": "OPENAI_API_KEY",
"description": "OpenAI API access"
}
],
"policies": [
{
"secretId": "github_api",
"allowedActions": ["http_get", "http_post"],
"allowedDomains": ["api.github.com"],
"rateLimit": {
"requests": 100,
"windowSeconds": 3600
}
},
{
"secretId": "openai_key",
"allowedActions": ["http_post"],
"allowedDomains": ["api.openai.com"],
"rateLimit": {
"requests": 50,
"windowSeconds": 3600
}
}
]
}π Architecture
System Overview
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MCP Client (AI) β
β β
β βββββββββββ ββββββββββββ βββββββββββ ββββββββββββ β
β βDiscover β β Describe β β Use β β Query β β
β β Secrets β β Policy β β Secret β β Audit β β
β ββββββ¬βββββ ββββββ¬ββββββ ββββββ¬βββββ ββββββ¬ββββββ β
βββββββββΌββββββββββββΌβββββββββββββΌββββββββββββΌβββββββββ
β β β β
βΌ βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MCP Secrets Vault Server β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Policy Evaluation Engine β β
β β (Exact FQDN matching only) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Rate Limiter (Token Bucket) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Secret Provider (ENV mapping) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Action Executor (HTTP GET/POST) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Audit Logger (JSONL format) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β² β
β βΌ
βββββββββββββββββ βββββββββββββββββββ
β Environment β β Audit Files β
β Variables β β (JSONL) β
βββββββββββββββββ βββββββββββββββββββCore Components
Policy Engine: Validates every request against strict allowlists (no wildcards)
Rate Limiter: Token bucket algorithm with per-secret limits
Secret Provider: Maps secret IDs to environment variables (never exposes values)
Action Executor: Performs HTTP requests with injected secrets
Audit Logger: Comprehensive JSONL audit trail for compliance
π‘οΈ Security Model
Multi-Layer Protection
Input Boundary: All inputs validated with Zod schemas
Policy Layer: Explicit allowlists only (deny by default)
Execution Layer: Secrets injected only at execution time
Output Boundary: All responses sanitized before return
Security Guarantees
β Secret values NEVER appear in MCP responses
β Secret values NEVER appear in error messages
β Secret values NEVER appear in logs
β Secret values NEVER appear in audit records
β Every action attempt is audited (success or failure)
β Rate limiting prevents abuse
β Exact domain matching only (no wildcards)
π Policy Configuration
Policy Structure
{
"secretId": "api_key_identifier",
"allowedActions": ["http_get", "http_post"],
"allowedDomains": ["api.example.com"],
"rateLimit": {
"requests": 100,
"windowSeconds": 3600
},
"expiresAt": "2024-12-31T23:59:59Z"
}Supported Actions
http_get: HTTP GET requestshttp_post: HTTP POST requests
Important Notes
Domains must be exact FQDNs (no wildcards or patterns)
All policies are deny-by-default
Rate limits use token bucket algorithm
Policies are validated on startup
π Available MCP Tools
1. discover_secrets
Lists all available secrets (IDs only, never values).
Response Example:
{
"secrets": [
{
"secretId": "github_api",
"description": "GitHub API access",
"hasPolicy": true
}
]
}2. describe_policy
Returns the policy for a specific secret.
Request:
{
"secretId": "github_api"
}Response:
{
"secretId": "github_api",
"allowedActions": ["http_get", "http_post"],
"allowedDomains": ["api.github.com"],
"rateLimit": {
"requests": 100,
"windowSeconds": 3600
}
}3. use_secret
Execute an action using a secret (without exposing it).
Request:
{
"secretId": "github_api",
"action": "http_get",
"url": "https://api.github.com/user/repos",
"options": {
"headers": {
"Accept": "application/vnd.github.v3+json"
}
}
}Response (sanitized):
{
"success": true,
"statusCode": 200,
"summary": "Retrieved 15 repositories",
"headers": {
"content-type": "application/json"
}
}4. query_audit
Query the audit log for usage history.
Request:
{
"secretId": "github_api",
"startTime": "2024-01-01T00:00:00Z",
"limit": 10
}π Audit Logging
All actions are logged in JSONL format for compliance:
{"timestamp":"2024-01-15T10:30:00Z","secretId":"github_api","action":"http_get","domain":"api.github.com","outcome":"allowed","statusCode":200}
{"timestamp":"2024-01-15T10:31:00Z","secretId":"openai_key","action":"http_post","domain":"api.openai.com","outcome":"rate_limited","reason":"Exceeded 50 requests per hour"}π§ Configuration
Environment Variables
VAULT_CONFIG: Path to configuration file (default:./vault.config.json)VAULT_LOG_LEVEL: Logging level (ERROR, WARN, INFO, DEBUG)VAULT_AUDIT_DIR: Directory for audit logs (default:./audit)
Configuration Schema
See config.schema.json for the complete JSON schema.
π§ͺ Development
Prerequisites
Node.js 20+ (LTS)
npm or yarn
Setup
# Clone the repository
git clone https://github.com/RachidChabane/mcp-secrets-vault
cd mcp-secrets-vault
# Install dependencies
npm install
# Run tests
npm test
# Build the project
npm run build
# Run in development mode
npm run devTesting
# Run tests with coverage
npm run test:coverage
# Run specific test
npx vitest run src/services/rate-limiter.test.ts
# Type checking
npm run typecheckCI/CD
This project uses GitHub Actions for continuous integration. The CI pipeline:
Triggers: Runs on push to
develop,main, and feature branches (feat/**,fix/**,hotfix/**,release/**), and on pull requests targetingdevelopCoverage Requirement: Enforces β₯80% test coverage threshold - builds will fail if coverage drops below this level
Build Artifacts: Coverage reports are uploaded and retained for 7 days
Branch Protection: The
build-and-testcheck must pass before merging todevelopormain
The CI workflow ensures code quality and test coverage standards are maintained across all contributions.
π€ Contributing
We welcome contributions! Please follow these guidelines:
Fork the repository
Create a feature branch (
feat/your-feature)Write tests (maintain β₯80% coverage)
Use the provided text constants
Commit with emoji prefixes (
:sparkles: [task-XX] Add feature)Open a PR to
developbranch
Code Standards
TypeScript strict mode
80%+ test coverage
All strings in constants files
Comprehensive error handling
π License
MIT License - see LICENSE file for details.
π Links
π Roadmap (post-MVP, non-binding)
Init wizard + templates: scaffold a minimal
vault.config.json.Dry-run mode: simulate requests and show effective headers (secrets masked).
CLI audit viewer: list/filter/export JSONL by date/id/FQDN with simple pagination.
Refined rate limits: per-FQDN and per-secret; deterministic retry/backoff.
Consent gate & response guards: first-use confirmation per domain; max body size & per-domain timeouts.
β οΈ Disclaimer
This tool is designed for development and controlled environments. Always follow your organization's security policies when handling sensitive credentials.
Available Tools
4 toolsdescribe_policyC
Get policy details for a secret
Inputs: secretId (required).
discover_secretsB
List all available secret identifiers and their metadata
Inputs: no named parameters.
query_auditC
Query audit log entries with filtering and pagination
Inputs: page, endTime, outcome, pageSize, +2 more.
use_secretC
Use a secret to perform an action
Inputs: action (required), secretId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 4 tools
Each tool targets a distinct part of the vault workflow: listing identifiers, reading policy, using a secret, and querying audit logs. There is minor potential confusion between discover_secrets metadata and describe_policy policy details, but the descriptions make the boundary workable.
All tool names follow a consistent snake_case verb_noun pattern: discover_secrets, describe_policy, use_secret, query_audit. There are no mixed conventions or vague standalone verbs.
Four tools is a lean but reasonable surface for a consumption-focused secrets vault, and each tool has a clear role. It is slightly thin if the server is intended for full vault administration, but the count itself is not excessive or trivial.
The surface covers discovery, policy lookup, usage, and audit, but lacks secret creation/update/deletion, rotation/revocation, and policy management. These are notable gaps for a vault lifecycle, though basic consumption workflows are possible.
Maintenance
Related MCP Connectors
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Credential broker for AI agents: scoped, revocable API access with policy enforcement and audit.
Security gateway for AI agents: policy, approval, and audited execution, no secrets shared.
Secrets for developers and agentsβsecure context and workflows without exposing secret values.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to securely use API keys by storing them in an encrypted vault and injecting them on demand with user approval, without exposing the key values to the model.3MIT
- AlicenseAqualityDmaintenanceEnables AI agents to make authenticated API calls and run commands with secrets injected, while keeping credentials completely hidden from the model, with policy enforcement, grants, and audit logging.6MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to call external endpoints under per-endpoint policy enforcement, with credentials and personal data kept inside a hardware enclave and every allowed or denied attempt recorded to an immutable audit ledger.2ISC
- FlicenseAqualityFmaintenanceEnables AI agents to securely store and retrieve secrets and make authenticated API calls on their behalf, keeping API keys out of conversation context and supporting local file or GCP Secret Manager backends.4-