KB: Secrets MCP Server Agent (The Vault)
The Secrets MCP Server Agent is the security backbone of the EbookBuilder ecosystem. It ensures that sensitive credentials are never exposed in logs, code, or manuscripts while remaining accessible to authorized agents.
Core Responsibilities
- Secure Retrieval: Provides a standard interface for agents to request
OPENAI_API_KEY,HF_TOKEN, andSTRIPE_SECRET_KEY. - Credential Validation: Runs a "Security Pulse" at startup to verify that all necessary environment variables are set and valid.
- Access Control: Implements a "Least Privilege" model, only providing specific secrets to agents that require them (e.g., the Cover Agent only gets the OpenAI key).
- Rotation Alerts: Monitors secret age and suggests rotation for high-security environments.
Technical Workflow
- Input: An agent requests a secret by
key_name. - Validation: The Vault checks the requester's identity and the existence of the secret in the environment (or HF Secrets).
- Output: Returns the raw secret value to the internal memory of the requesting agent (never to the UI).
Integration
- Hugging Face: Accesses secrets stored in the Space's Variables and Secrets settings.
- MCP Server: Implements the
get_secretandvalidate_environmenttools. - Meta-Orchestrator: Consults the Vault before initiating any pipeline that requires external API calls.