Agent Keyring
Provides an adapter for Discord, supporting channel messages and webhooks.
Provides an adapter for GitHub's REST API, enabling agents to interact with repositories, issues, and pull requests.
Provides a read-only adapter for Stripe, covering charges, customers, and subscriptions.
Provides an adapter for Supabase, enabling table queries via PostgREST and auth admin operations.
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 Keyring query GA4 for sessions over the last 7 days using my saved credentials"
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 Keyring
An MCP server that holds secrets and makes authenticated API calls on behalf of AI agents — so API keys never enter conversation context.
Agent → Keyring MCP → retrieve secret → make API call → return data onlyThe agent says what to do ("query GA4 for sessions"). The keyring handles how to authenticate. Keys stay on the keyring, never in the agent's mouth.
Quickstart
# 1. Clone
git clone https://github.com/MithrynMarious/agent-keyring.git
cd agent-keyring
# 2. Create a virtual environment and install
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install .
# 3. Copy the skeleton and fill in your keys
cp .secrets.skeleton.json .secrets.json
# Edit .secrets.json — replace placeholders with real values
# 4. Add to your MCP config (.mcp.json or Claude Desktop settings)Add to your MCP config file:
Claude Code — .mcp.json in your project root:
{
"mcpServers": {
"keyring": {
"command": "python",
"args": ["server.py"],
"cwd": "/path/to/agent-keyring"
}
}
}Claude Desktop — config file location varies by OS:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Same JSON format — add the keyring entry to your existing mcpServers block.
# 5. Verify
python -c "from secret_store import LocalFileStore; s = LocalFileStore('.secrets.json'); print(f'{len(s.list_names())} secrets loaded')"Related MCP server: AI Service Gateway MCP
What's Working
Component | Status | Notes |
Local file store | Active |
|
GCP Secret Manager store | Active | Multi-machine, 3 auth paths (SA key, ADC, GCE metadata) |
GA4 adapter | Active | OAuth + service account JWT, report formatting |
AgentMail adapter | Active | Bearer token auth, inbox/thread operations |
Stripe adapter | Active | Charges, customers, subscriptions (read-only) |
Supabase adapter | Active | Table queries via PostgREST, auth admin |
Anthropic adapter | Active | Messages API, model listing |
GitHub adapter | Active | Repos, issues, PRs via REST API |
Discord adapter | Active | Channel messages, webhooks |
Identity verification | Active | DID primary, AgentMail fallback |
Checkout ledger | Active | Append-only JSONL, agent affinity analysis |
Key health monitor | Active | Connectivity checks, rotation tracking, HTML dashboard |
Service taxonomy | Active | 6 archetypes, 60+ ecosystem entries |
Permissions | Active | Per-agent, per-secret access control |
MCP Tools
Tool | What It Does |
| List secrets the agent can access (names only, never values) |
| Make an API call using a managed secret |
| Query who accessed what, when, and why |
| Analyze agent-service usage patterns |
Security Model (DC-1)
Secret values never appear in:
MCP tool results
Conversation context
Log output
EAM entries or session records
The keyring makes the authenticated API call and returns only the response data. The checkout ledger logs every access (who, what, when, why) without recording the secret value.
Docs
SETUP.md — Full setup guide with GCP migration, troubleshooting, and embedded lessons from prior setups
FRICTION_JOURNAL.md — GCP console gotchas (training-data-vs-reality deltas)
AGENTS.md — Engineering posture and conventions
Populating Secrets
Bootstrap (recommended — one command)
Scan a machine for scattered credentials, collect them, and populate the keyring:
python consolidate.py bootstrap ~/projects ~/.config ~/keys
# Scans → migrates → ingests → validates. Values stay on disk, never in stdout.Add --dry-run to preview without changing anything. DC-1 safe: the bootstrap prints filenames and counts, never secret values.
Manual paths
# Interactive (value from stdin, never CLI args)
python add_secret.py my-api-key
# From files
mkdir -p .secrets
# Place key files in .secrets/
python consolidate.py ingest
# Bulk discovery
python consolidate.py scan ~/projects # find scattered creds
python consolidate.py migrate ~/projects --target .secrets/GCP Backend (Multi-Machine)
For shared secrets across machines, use GCP Secret Manager as the backend:
{
"mcpServers": {
"keyring": {
"command": "python",
"args": ["server.py"],
"env": { "KEYRING_GCP_PROJECT": "your-project-id" }
}
}
}See SETUP.md Option B for the full GCP walkthrough.
Registering Agents
New agents are denied access by default (DC-1). To grant an agent access to secrets, add an entry to permissions.json:
{
"agent-name@agentmail.to": ["secret-name-1", "secret-name-2"],
"admin-agent@agentmail.to": ["*"],
"_default": []
}Each key is an agent identifier (AgentMail address or DID)
Values list the secret names the agent can check out
"*"grants access to all secrets"_default": []means unregistered agents get nothing — this is the DC-1 structural default
When an unregistered agent calls keyring_list_available, it sees an empty list. The checkout ledger still records the attempt.
Environment Variables
See .env.example for the complete list. Key variables:
Variable | Required | Default | Purpose |
| For GCP backend | — | Selects GCP Secret Manager over local file |
| No |
| Local store file path |
| No | 3 dirs up | Root for |
| For GCP SA auth | — | GCP service account key file |
Logging
The server uses Python's logging module. Set the log level via environment:
# See all keyring activity
LOGLEVEL=DEBUG python server.py
# Quiet mode (errors only)
LOGLEVEL=ERROR python server.pyDefault level is WARNING. The keyring.store and keyring.ledger loggers are the most useful for debugging auth and access issues.
Troubleshooting
Symptom | Cause | Fix |
|
| Copy |
|
| Set it to the parent directory of your |
| Service name doesn't match a registered adapter | Check |
Agent sees empty list | Agent not in | Add the agent's identifier to |
GCP | Service account lacks Secret Manager access | Grant |
GCP | Wrong prefix or secret name | Check |
Stale secret value from GCP | Cache TTL hasn't expired | Set |
| Secret value is expired or invalid | Rotate the key in |
For GCP-specific setup issues, see SETUP.md and FRICTION_JOURNAL.md.
Docker
# Local file store
docker compose up keyring
# GCP backend
KEYRING_GCP_PROJECT=your-project docker compose --profile gcp up keyring-gcpMount your .secrets.json and permissions.json as volumes. See docker-compose.yml for the full configuration.
CI
Tests run on push and PR via GitHub Actions across Python 3.12–3.13 on Linux, Windows, and macOS. See .github/workflows/test.yml.
License
Proprietary — CoreForged LLC. See LICENSE for terms.
Available Tools
4 toolskeyring_agent_affinityA
Analyze agent-service affinity patterns from the checkout ledger.
Returns which agents use which services most — the raw data for workstation specialization analysis and context overload detection.
Args: days: How far back to analyze (default 30).
Inputs: days.
keyring_authenticated_requestA
Make an authenticated API call using a managed secret. The key never appears in the response.
The keyring retrieves the secret, makes the API call, and returns only the response data. Every call is logged to the checkout ledger.
Args: service: Service identifier (e.g. 'agentmail', 'stripe', 'ga4', 'firebase'). For unregistered services, pass any name — the generic adapter handles the request if base_url is in params. secret_name: Name of the secret to use (from keyring_list_available). method: HTTP method (GET, POST, PUT, DELETE). endpoint: API endpoint path (appended to service base URL). params: Query parameters for the request. For unregistered services, include: base_url (required), auth_type ('bearer'|'header'|'basic'|'query', default 'bearer'), auth_header (header name when auth_type='header'). body: JSON body for POST/PUT requests. scope: Optional scope for multi-value keys (e.g. 'fleet', 'mcp'). When set, tries secret_name:scope first, falls back to secret_name. purpose: Why this request is being made (logged to ledger). did: Agent's DID for identity verification. agentmail_token: AgentMail API key for identity fallback. agentmail_inbox: Agent's AgentMail address for identity fallback.
Inputs: service (required), secret_name (required), did, body, +7 more.
keyring_checkout_historyB
Query the checkout ledger — who accessed what, when, and why.
Args: agent_id: Filter by agent (DID or AM address). service: Filter by service name. secret_name: Filter by secret name. days: How far back to look (default 30).
Inputs: days, service, agent_id, secret_name.
keyring_list_availableA
List secrets the calling agent can access. Returns names and descriptions only — never values.
Args: did: Agent's DID (did:key:...) for identity verification. agentmail_inbox: Agent's AgentMail address (e.g. sofer@agentmail.to) as fallback identity.
Inputs: did, agentmail_inbox.
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 has a clearly distinct role: listing available secrets, making an authenticated request, querying the audit ledger, and analyzing ledger patterns. The closest pair, checkout_history and agent_affinity, are separated by raw logging versus aggregate analysis.
The shared keyring_ prefix provides some consistency, but the suffixes are grammatically mixed: list_available is verb-like, while authenticated_request, checkout_history, and agent_affinity are noun phrases. A consistent verb_noun pattern would make the tool names more predictable.
Four tools is well-scoped for an agent-facing keyring: discovery, usage, audit, and analytics. Each tool serves a distinct purpose without redundancy or unnecessary bloat.
The surface covers the full agent-facing workflow: see what secrets are available, use them without exposing values, review the audit trail, and analyze usage patterns. Secret lifecycle management tools are absent but appear intentionally reserved for administrators rather than agents.
Related MCP Connectors
Secrets for developers and agents—secure context and workflows without exposing secret values.
Encrypted secret store and rotation for autonomous agent credentials
A secret store for AI agents: the agent never sees the plaintext.
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables secure credential storage for AI agents by encrypting secrets and providing agent-invisible references, ensuring sensitive data never leaks to the model.MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to securely access authenticated services (HTTP, SSH, SMTP) without exposing secrets, by acting as a server-side proxy that injects authentication.MIT
- 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
- AlicenseAqualityCmaintenanceEnables 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