agent-keys
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., "@agent-keys check my OpenAI API key"
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.
agent-keys
MCP server that lets AI agents autonomously acquire and manage API keys.
The Problem
AI agents frequently need API keys to accomplish tasks — sending emails, making calls, running models, storing data. Today this requires a human to manually create accounts, navigate dashboards, and paste keys into configs. agent-keys gives agents a structured, secure interface to discover services, get provisioning instructions, store retrieved keys, verify they work, and export them as environment variables — all without human intervention after initial setup.
Related MCP server: Agentic Vault
Quick Start
Via npx (no install required)
npx @gonzih/agent-keysMCP Configuration
Add to your MCP config file (e.g. ~/.claude/claude_desktop_config.json or ~/.config/claude-code/config.json):
{
"mcpServers": {
"agent-keys": {
"command": "npx",
"args": ["@gonzih/agent-keys"],
"env": {
"AGENT_KEYS_SECRET": "your-strong-encryption-secret"
}
}
}
}Claude Code Config
Add to your Claude Code settings:
{
"mcpServers": {
"agent-keys": {
"command": "npx",
"args": ["@gonzih/agent-keys"],
"env": {
"AGENT_KEYS_SECRET": "your-strong-encryption-secret"
}
}
}
}Tools
list_services
List all 26 supported services with their category, description, signup URL, and whether a key is stored.
Input: none
Output:
[
{
"name": "openai",
"displayName": "OpenAI",
"category": "ai",
"description": "AI research company providing GPT-4, DALL-E, Whisper, and embeddings APIs.",
"signupUrl": "https://platform.openai.com/signup",
"has_key": true,
"freetier": "$5 free credit for new accounts (limited time)",
"envVarName": "OPENAI_API_KEY"
}
]get_api_key
Retrieve a stored API key. Returns the key if found, or provisioning guidance if not.
Input:
{ "service": "openai" }Output (found):
{
"found": true,
"service": "openai",
"key": "sk-proj-...",
"stored_at": "2024-01-15T10:30:00.000Z",
"envVarName": "OPENAI_API_KEY"
}Output (not found):
{
"found": false,
"service": "openai",
"message": "No API key stored for OpenAI. Use provision_api_key to get instructions.",
"signupUrl": "https://platform.openai.com/signup"
}store_api_key
Store an API key in the encrypted vault.
Input:
{
"service": "openai",
"key": "sk-proj-...",
"metadata": { "org": "my-org", "created_by": "agent" }
}Output:
{
"success": true,
"service": "openai",
"displayName": "OpenAI",
"message": "API key for OpenAI stored successfully.",
"envVarName": "OPENAI_API_KEY"
}check_api_key
Verify a stored key is still valid by calling the service's test endpoint.
Input:
{ "service": "openai" }Output:
{
"valid": true,
"service": "openai",
"displayName": "OpenAI",
"status": 200,
"message": "API key for OpenAI is valid."
}Services with test endpoints: openai, sendgrid, stripe, github, groq, together-ai, elevenlabs, deepgram, replicate, brave-search, serper, tavily.
provision_api_key
Get step-by-step instructions and the direct signup URL for acquiring an API key.
Input:
{ "service": "groq" }Output:
{
"service": "groq",
"displayName": "Groq",
"signupUrl": "https://console.groq.com/login",
"steps": [
"Go to https://console.groq.com/login",
"Create a free account or sign in",
"Navigate to https://console.groq.com/keys",
"Click 'Create API Key'",
"Give it a name and click 'Submit'",
"Copy the generated API key immediately (shown only once)",
"Store it using store_api_key with service 'groq'"
],
"freetier": "Free tier with generous rate limits"
}remove_api_key
Delete a key from the vault.
Input:
{ "service": "openai" }Output:
{
"success": true,
"service": "openai",
"message": "API key for OpenAI removed from vault."
}export_env
Generate shell export statements for stored keys.
Input:
{ "services": ["openai", "anthropic"] }Or omit services to export all stored keys.
Output:
{
"exports": [
"export OPENAI_API_KEY=\"sk-proj-...\"",
"export ANTHROPIC_API_KEY=\"sk-ant-...\""
],
"shell": "export OPENAI_API_KEY=\"sk-proj-...\"\nexport ANTHROPIC_API_KEY=\"sk-ant-...\"",
"count": 2
}Supported Services
AI (5 services)
Name | Display Name | Free Tier | Env Var |
| OpenAI | $5 credit (new accounts) |
|
| Anthropic | Free tier with rate limits |
|
| Replicate | Pay-per-use, free community models |
|
| Together AI | $25 free credit |
|
| Groq | Free tier, generous limits |
|
Communication (6 services)
Name | Display Name | Free Tier | Env Var(s) |
| Twilio | $15 trial credit |
|
| SendGrid | 100 emails/day forever |
|
| Mailgun | 100 emails/day, 3 months |
|
| Postmark | 100 emails/month forever |
|
| Vonage (Nexmo) | $2 trial credit |
|
| Telnyx | $1 credit on signup |
|
Voice (3 services)
Name | Display Name | Free Tier | Env Var |
| ElevenLabs | 10,000 chars/month |
|
| Deepgram | $200 free credit |
|
| AssemblyAI | $50 free credit |
|
Infrastructure (8 services)
Name | Display Name | Free Tier | Env Var |
| Stripe | No monthly fee |
|
| GitHub | Free for personal use |
|
| Cloudflare | Free plan available |
|
| Vercel | Hobby plan free |
|
| Railway | $5 credit/month |
|
| Supabase | 2 free projects |
|
| PlanetScale | 5GB free storage |
|
| Upstash | 10,000 commands/day |
|
Data (4 services)
Name | Display Name | Free Tier | Env Var |
| Serper | 2,500 free searches |
|
| Brave Search | 2,000 queries/month |
|
| Tavily | 1,000 calls/month |
|
| Firecrawl | 500 credits on signup |
|
Adding a New Service
Edit src/registry.ts and add a new object to the registry array:
{
name: 'my-service', // slug used in tool calls
displayName: 'My Service', // human-readable name
category: 'ai', // 'communication' | 'ai' | 'voice' | 'infrastructure' | 'data'
description: 'What it does.',
signupUrl: 'https://myservice.com/signup',
docsUrl: 'https://docs.myservice.com/api',
envVarName: 'MY_SERVICE_API_KEY',
freetier: 'Description of free tier',
programmatic: false,
provisioningSteps: [
'Go to https://myservice.com/signup',
'Create an account',
'Navigate to API Keys',
'Click Create Key',
'Copy the key',
'Store it using store_api_key with service "my-service"',
],
testEndpoint: { // optional
url: 'https://api.myservice.com/v1/me',
method: 'GET',
headers: (key: string) => ({ Authorization: `Bearer ${key}` }),
successStatus: 200,
},
}Then run npm run build.
Security
Encryption: AES-256-GCM with scrypt key derivation (N=16384, r=8, p=1)
Per-write randomness: Each vault write uses a fresh 16-byte salt and 16-byte IV
Auth tag: GCM auth tag prevents undetected tampering
Plaintext fallback: If
AGENT_KEYS_SECRETis not set, keys are stored unencrypted with a warningVault location:
~/.agent-keys/vault.jsonby default; override withAGENT_KEYS_VAULTSecret management: Never commit
AGENT_KEYS_SECRETto source control; use env vars or a secrets manager
Development
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run directly with tsx (no build step)
npm run devLicense
MIT
Available Tools
7 toolscheck_api_keyA
Verify a stored API key still works by hitting the service's test endpoint.
Inputs: service (required).
export_envA
Export stored API keys as shell export statements (e.g. export OPENAI_API_KEY=...).
Inputs: services.
get_api_keyA
Get a stored API key for a service. Returns the key if stored, or provisioning guidance if not.
Inputs: service (required).
list_servicesA
List all supported services with their status (whether a key is stored), category, description, and signup URL.
Inputs: no named parameters.
provision_api_keyB
Get step-by-step instructions and direct signup URL for acquiring an API key for a service.
Inputs: service (required).
remove_api_keyB
Remove an API key from the vault.
Inputs: service (required).
store_api_keyB
Store an API key in the encrypted vault.
Inputs: key (required), service (required), metadata.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: listing services, getting/storing/checking/provisioning/removing keys, and exporting. No overlap.
All tool names follow a consistent verb_noun pattern (e.g., list_services, get_api_key, store_api_key). The use of 'env' in export_env is a different noun but still fits the pattern.
7 tools is well-scoped for managing API keys, covering all essential operations without being excessive or insufficient.
The tool surface covers the full lifecycle: discovery, storage, retrieval, verification, provisioning guidance, deletion, and export. No obvious gaps.
Related MCP Connectors
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
The vetted directory of paid APIs and MCP servers for AI agents.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
9 remote MCP servers on Cloudflare Workers for AI agents. Free tier + Pro API keys.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA personal MCP server for securely storing and accessing API keys across projects using the macOS Keychain, letting AI assistants and applications retrieve credentials through natural language.25ISC
- AlicenseNot gradedqualityDmaintenanceMCP server that lets AI agents call APIs without ever seeing the credentials, using a local encrypted vault and per-secret allowlist policies for HTTP requests and subprocess environment variables.1AGPL 3.0
- AlicenseNot gradedqualityDmaintenanceMCP server enabling AI agents to use secrets (API keys, tokens) via encrypted vault, executing HTTP/shell/SSH actions server-side while never exposing secret values to the AI.MIT
- AlicenseNot gradedqualityFmaintenanceMCP server for AI-native credential management, enabling agents to securely store, retrieve, and manage API keys with encryption, spending budgets, and audit logging.MIT