keychainreader
Integrates with Linux Secret Service to discover credential metadata, copy secret values to the clipboard with auto-clear, and run CLI commands with secrets injected into the environment while redacting output.
Integrates with macOS Keychain to discover credential metadata, copy secret values to the clipboard with auto-clear, and run CLI commands with secrets injected into the environment while redacting output.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
keychainreader
A zero-leakage Model Context Protocol (MCP) server for macOS Keychain and Linux Secret Service.
keychainreader allows AI agents (such as OpenCode, Claude Code, Cursor, or Claude Desktop) to discover stored credentials, copy secrets directly to your clipboard, and execute CLI commands with injected environment variables—without ever exposing raw secret values to the LLM context.
Features
Zero-Exposure Architecture: Secret values are retrieved locally and never returned in MCP tool responses.
Direct Clipboard Transfer: Copies secrets straight to your OS clipboard with automatic TTL-based wiping (default: 30s).
Transparent CLI Proxy: Injects secrets into subprocess environment variables (
shell=False) and automatically redacts both raw and Base64-encoded secret occurrences fromstdoutandstderr.Metadata Auto-Discovery: Scans macOS Keychain (
security dump-keychain) and Linux Secret Service (secret-tool) for service/account metadata without triggering decryption prompts.SQLite Metadata Index: Stores searchable service names, usernames, and custom tags locally in
~/.cache/keycahainreader/index.sqlite3(never stores passwords).
Related MCP server: brokre
Requirements
Python: 3.12+
uv / uvx: Recommended for zero-setup execution.
macOS: Uses built-in
securityCLI andpbcopy(works out of the box).Linux: Requires
libsecret-tools(secret-tool) and a clipboard utility (wl-clipboardfor Wayland orxclip/xselfor X11).
Installation & Usage
Run directly from Git via uvx
uvx --python 3.12 --from git+https://github.com/Dedoque/keychainreader.git keychainreaderRun from a local clone
git clone https://github.com/Dedoque/keychainreader.git
cd keychainreader
uv run keychainreaderMCP Client Configuration
OpenCode (~/.config/opencode/opencode.json)
Add via CLI:
opencode mcp add keychainreader --global -- uvx --python 3.12 --from git+https://github.com/Dedoque/keychainreader.git keychainreaderOr add manually to ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"keychainreader": {
"type": "local",
"command": [
"uvx",
"--python",
"3.12",
"--from",
"git+https://github.com/Dedoque/keychainreader.git",
"keychainreader"
]
}
}
}
}Claude Desktop / Cursor (mcp.json)
{
"mcpServers": {
"keychainreader": {
"command": "uvx",
"args": [
"--python",
"3.12",
"--from",
"git+https://github.com/Dedoque/keychainreader.git",
"keychainreader"
]
}
}
}Available MCP Tools
Tool | Description |
| Scans OS Keychain / Secret Service metadata and updates the local SQLite index. |
| Searches indexed secrets by |
| Registers or updates tags for an existing Keychain entry in the search index. |
| Copies the secret value to the system clipboard and wipes it after |
| Runs a CLI command ( |
Security Model
No Secret Echoing: None of the MCP tools return plaintext credentials to the model.
Process Isolation: CLI commands execute via
subprocess.run(..., shell=False)with argument lists to prevent shell expansion attacks (e.g.,echo \$TOKEN).Output Sanitization: Both raw and Base64-encoded representations of the injected secret are scrubbed (
***REDACTED***) fromstdoutandstderrbefore returning to the client.Blocked Dump Binaries: Direct environment inspection commands (
env,printenv,set,export) are blocked by default.
Credits
This project was developed with the assistance of Google AI (Gemini).
License
This project is licensed under the GNU General Public License v3.0 — see the LICENSE file for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Encrypted secret store and rotation for autonomous agent credentials
Secrets for developers and agents—secure context and workflows without exposing secret values.
A secret store for AI agents: the agent never sees the plaintext.
Password vault for AI agents with scoped, user-approved access
Related MCP Servers
- AlicenseAqualityBmaintenanceA cross-platform secrets manager that stores named credential sets in the system keychain and injects them as environment variables, enabling secure secret management for AI coding assistants and CLI tools.13MIT
- AlicenseNot gradedqualityBmaintenanceLocal credential broker that enables AI agents to securely run CLI tools like SSH and MySQL without exposing passwords to the AI context, environment variables, or process listings.3MIT
- AlicenseCqualityCmaintenanceEnables AI agents to securely store and manage encrypted secrets locally while using them indirectly through environment-variable injection or file writes, so plaintext values never enter the agent's context.8MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to scan and audit environment files for leaked secrets, sanitize them, encrypt/decrypt vaults, and run processes with zero-disk secret injection.MIT