Overview
A production-ready framework for building LLM agents with the Model Context Protocol (MCP). This framework provides the foundation for building powerful, tool-enabled agents with persistent memory, OAuth integration, and extensible architecture—all battle-tested in production environments.
Security Architecture
OAuth 2.0 Integration
Comprehensive OAuth implementation for secure AI agent authentication:
- PKCE Support: Proof Key for Code Exchange protects authorization codes from interception
- Dynamic Client Registration: Automatic OAuth client credential generation
- Token Management: Encrypted token storage with automatic refresh
- Auto-reauthentication: Seamless retry on 401/403 errors
MCP Security Patterns
Secure Model Context Protocol implementation:
- Local MCP Client: Stdio-based tool servers with process isolation
- Remote MCP Client: HTTPS-based servers with full OAuth protection
- Tool Validation: JSON schema validation for all tool inputs
- Structured Error Handling: Secure error responses preventing information disclosure
Core Capabilities
Agent System
- Agentic conversation loop with CLI interface
- Token usage tracking for cost management
- Automatic file logging to
~/.agents/logs/ - Extensible base class for domain-specific agents
Built-in Security Tools
- Web Search: Claude’s native web search with domain filtering
- Web Content Reader: HTML to markdown conversion with sanitization
- Memory Management: Persistent storage with categories, tags, and search
- Slack Integration: Webhook-based notifications for security alerts
Storage & Memory
- Persistent memory with encrypted token storage
- Category-based organization with tag support
- Full-text search across stored memories
- File-based with easy database migration path
AI Security Applications
Secure Agent Development
The framework addresses key AI security concerns:
- Authentication Boundaries: Proper OAuth separation between agents and resources
- Audit Capabilities: Comprehensive logging of agent decisions and tool usage
- Input Validation: Pydantic-based validation prevents injection attacks
- Extensible Security: Clean abstractions for adding domain-specific security controls
Production Deployment
Battle-tested patterns for deploying secure AI agents:
- Type Safety: Full typing prevents common runtime vulnerabilities
- Error Handling: Graceful degradation without information disclosure
- Configuration Security: Secure handling of API keys and credentials
- Monitoring: Built-in token tracking and logging for security auditing
Technical Innovation
This framework represents extracted wisdom from production agent implementations, providing a secure foundation for building AI agents that integrate with external services while maintaining proper security boundaries. The MCP-native architecture ensures clean separation of concerns between agent logic and tool implementations.