API Manager
Enables secure management of API keys through an encrypted environment file with automatic categorization, search functionality, and backup operations. Provides comprehensive API key organization with value masking, audit trails, and export capabilities for safe credential management.
README
🔐 API Manager MCP Server
An enhanced MCP (Model Context Protocol) server for securely managing API keys that works seamlessly with Claude Desktop and Claude Code.
✨ Features
🔒 Security First
- Secure file permissions (600) for environment files
- Atomic file operations to prevent corruption
- Automatic backups before deletions
- Value masking for safe display
- Input validation for all operations
📊 Smart Organization
- Automatic categorization of API keys based on service providers
- Advanced search across key names and categories
- Statistics and analytics for your API key usage
- Export functionality in multiple formats
🛠️ Enhanced Functionality
- Comprehensive logging for audit trails
- Command-line interface with flexible options
- Error handling with detailed feedback
- Backup management with timestamped backups
🎯 Supported Categories
- AI/LLM Services: Anthropic, OpenAI, Google AI, Groq, Mistral, DeepSeek, etc.
- Database & Storage: Supabase, Neo4j, Qdrant, Pinecone, Airtable, etc.
- Communication: Discord, Slack, Twilio, Telegram, etc.
- Development Tools: GitHub, Firebase, Vercel, Netlify, etc.
- Cloud & Hosting: AWS, Azure, GCP, Railway, Heroku, etc.
- And many more...
🚀 Quick Start
Prerequisites
- Python 3.8 or higher
- Claude Desktop or Claude Code
Installation
- Clone the repository:
git clone https://github.com/yourusername/API_Manager_MCPServer.git
cd API_Manager_MCPServer
- Install dependencies:
pip install -r requirements.txt
- Configure for Claude Desktop:
Add to your Claude Desktop configuration file (claude_desktop_config.json):
{
"mcpServers": {
"api-manager": {
"command": "python",
"args": ["/path/to/API_Manager_MCPServer/api_manager.py"],
"env": {}
}
}
}
- Configure for Claude Code:
Add to your Claude Code MCP settings:
{
"mcp": {
"servers": {
"api-manager": {
"command": "python",
"args": ["/path/to/API_Manager_MCPServer/api_manager.py"]
}
}
}
}
Basic Usage
Once configured, you can use the API Manager through Claude with natural language:
"List my API keys"
"Add a new OpenAI API key"
"Search for Discord keys"
"Show statistics about my API keys"
"Create a backup of my environment file"
📖 Detailed Usage
Available Commands
🔍 Query Commands
list_api_keys - List all API keys with categories
show_values: Show actual values (default: false)category: Filter by specific category
get_api_key - Get a specific API key by name
key_name: Name of the key to retrieve
search_api_keys - Search for API keys by name or category
query: Search termshow_values: Show actual values (default: false)
list_categories - List all categories with counts
📝 Management Commands
add_api_key - Add or update an API key
key_name: Name of the API keyvalue: The API key value
delete_api_key - Delete an API key
key_name: Name of the key to delete
🛠️ Utility Commands
backup_env_file - Create timestamped backup
get_stats - Show detailed statistics
export_keys - Export keys in JSON or ENV format
format: "json" or "env" (default: json)include_values: Include actual values (default: false)
help - Show comprehensive help
Command Line Options
python api_manager.py --help
python api_manager.py --version
python api_manager.py --env-file /custom/path/.env
python api_manager.py --log-level DEBUG
Environment File Location
By default, API keys are stored in:
~/.config/api_manager/.env
You can specify a custom location using:
- Command line:
--env-file /path/to/.env - Environment variable:
API_MANAGER_ENV_FILE
🔧 Configuration
Environment File Format
# API Manager Environment File
# Created on 2024-01-01 12:00:00
# AI Services
ANTHROPIC_API_KEY=sk-ant-1234567890abcdef
OPENAI_API_KEY=sk-1234567890abcdef
# Database Services
SUPABASE_API_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
# Communication
DISCORD_BOT_TOKEN=ODcyNzM0NjI5NjU2MjE3NjAw
Security Best Practices
- File Permissions: The environment file is automatically created with secure permissions (600)
- Backups: Always create backups before making changes
- Value Masking: Use
show_values=falsewhen listing keys - Logging: Monitor the log file for any suspicious activity
- Access Control: Limit access to the environment file location
🧪 Testing
Run the test suite:
# Install test dependencies
pip install pytest pytest-asyncio pytest-cov
# Run tests
pytest tests/
# Run with coverage
pytest tests/ --cov=api_manager --cov-report=html
📊 Monitoring and Logs
The API Manager creates detailed logs in api_manager.log:
# View recent activity
tail -f api_manager.log
# Search for specific operations
grep "Tool called" api_manager.log
🔧 Development
Project Structure
API_Manager_MCPServer/
├── api_manager.py # Main MCP server
├── requirements.txt # Dependencies
├── setup.py # Package configuration
├── README.md # This file
├── LICENSE # License file
├── tests/ # Test suite
│ ├── __init__.py
│ ├── test_api_manager.py
│ └── test_integration.py
├── docs/ # Documentation
│ ├── configuration.md
│ ├── security.md
│ └── troubleshooting.md
└── examples/ # Usage examples
├── claude_desktop_config.json
└── usage_examples.md
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Full Documentation
🚧 Roadmap
- [ ] Web UI for API key management
- [ ] Integration with popular password managers
- [ ] Multi-environment support (dev, staging, prod)
- [ ] API key rotation notifications
- [ ] Advanced audit logging
- [ ] Team collaboration features
🙏 Acknowledgments
- Built on the Model Context Protocol (MCP) by Anthropic
- Inspired by the need for secure API key management in AI workflows
- Community feedback and contributions
⚠️ Security Notice: API keys are sensitive credentials. Always follow security best practices and never commit API keys to version control systems.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。