
claude-safe-mcp
A secure MCP wrapper for Anthropic Claude Code that eliminates the need for permission flags while preserving full CLI functionality and working seamlessly with MCP-compatible IDEs.
README
🚀 Claude Proxy
A secure HTTP API proxy for Anthropic Claude with comprehensive safety controls, permission management, and seamless integration with VS Code AI assistants.
⚡ Quick Start (One Command)
git clone https://github.com/saxyguy81/claude-proxy.git && cd claude-proxy && ./install.sh && code .
That's it! The API proxy starts automatically when you open VS Code.
🎯 Features
🔒 Enterprise-Grade Safety
- Permission Management: Interactive approval for dangerous operations
- Dangerous Pattern Detection: Blocks
rm -rf
,format
,delete
, etc. - Tool Restrictions: Configurable allowlists for Claude tools
- Request Monitoring: Complete logging of all API interactions
🌐 Universal API Compatibility
- OpenAI API Format:
/v1/chat/completions
endpoint - Claude API Format:
/v1/messages
endpoint - Model Mapping: Automatic translation between API formats
- Standards Compliant: Works with any OpenAI-compatible tool
🛠️ VS Code Integration
- Automatic Startup: Server starts when you open workspace
- Pre-configured Extensions: Cline, Continue, Roo Code ready to use
- Background Tasks: Start/stop/restart through VS Code commands
- Real-time Monitoring: Permission prompts and request logs
🚀 Supported AI Assistants
✅ Cline - Pre-configured, zero setup
✅ Continue - Pre-configured, zero setup
✅ Roo Code - Environment variables set
✅ Cursor IDE - Manual configuration (5 minutes)
✅ Any OpenAI-compatible tool - Just point to http://localhost:8081/v1
🏗️ Architecture
┌─────────────────┐ HTTP API ┌─────────────────┐ Safety Layer ┌─────────────────┐
│ AI Assistant │ ──────────────→ │ API Proxy │ ─────────────────→ │ Claude CLI │
│ (Cline, etc.) │ ←────────────── │ (Port 8081) │ ←───────────────── │ (Anthropic) │
└─────────────────┘ JSON/HTTP └─────────────────┘ Permission Mgmt └─────────────────┘
📋 Manual Setup (5 Minutes)
1. Install and Start
git clone https://github.com/saxyguy81/claude-proxy.git
cd claude-proxy
npm install
npm start
2. Configure Your AI Assistant
For Cline Extension
{
"cline.apiProvider": "openai",
"cline.openaiApiKey": "dummy-key-not-needed",
"cline.openaiBaseUrl": "http://localhost:8081/v1",
"cline.openaiModelId": "gpt-4"
}
For Continue Extension
{
"continue.apiBase": "http://localhost:8081/v1",
"continue.apiKey": "dummy-key-not-needed",
"continue.modelName": "gpt-4"
}
For Roo Code
export OPENAI_API_BASE=http://localhost:8081/v1
export OPENAI_MODEL=gpt-4
For Cursor IDE
- Settings → Models → Custom API Base:
http://localhost:8081/v1
- Model:
gpt-4
- API Key:
dummy-key-not-needed
🔍 Verify It's Working
# Health check
curl http://localhost:8081/health
# List models
curl http://localhost:8081/v1/models
# Test chat completion
curl -X POST http://localhost:8081/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 50
}'
🛡️ Safety in Action
When an AI assistant tries to use dangerous tools, you'll see:
🔐 Permission Request
Tool: Bash
Command: rm -rf temp/
⚠️ DANGEROUS PATTERN DETECTED: rm -rf
Allow this operation? [y/N/always]:
⚙️ Configuration
Default Config (claude-proxy.json
)
{
"allowedTools": ["Read", "Edit", "Bash", "Write", "Glob", "Grep"],
"requirePermissionFor": ["Bash", "Edit", "Write"],
"dangerousPatterns": ["rm -rf", "format", "delete", "DROP TABLE", "sudo"],
"safety": {
"requireApproval": true,
"autoApprovePatterns": ["ls", "pwd", "cat"]
},
"maxConcurrentRequests": 5
}
VS Code Workspace Settings
The automated setup creates .vscode/settings.json
with:
- Extension configurations for Cline, Continue
- Environment variables for terminals
- Auto-start task configuration
🧪 Testing & Quality
- 60 comprehensive tests - All passing
- 78.62% code coverage - Production ready
- API Server: 76.51% coverage
- Safety Proxy: 98.22% coverage
- Zero lint errors - Clean codebase
📚 Documentation
- VSCODE_SETUP_GUIDE.md - Complete VS Code setup
- API_PROXY_GUIDE.md - API documentation
- TEST_COVERAGE_REPORT.md - Testing details
🔧 Commands
# Development
npm start # Start the API proxy
npm test # Run test suite
npm run lint # Check code quality
# VS Code Integration
npm run start # Start with auto-reload
code . # Open in VS Code (auto-starts proxy)
🚨 Troubleshooting
Port Already in Use
# Kill existing processes
pkill -f api-cli.js
# Or use different port
npm start -- --port 8082
VS Code Extensions Can't Connect
- Check server status:
curl http://localhost:8081/health
- Verify extension settings in VS Code
- Restart VS Code or reload window
🔄 Updates
git pull origin main
npm install
./install.sh
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Run
npm test
andnpm run lint
- Submit a pull request
📝 License
MIT - see LICENSE file for details.
🙏 Acknowledgments
- Anthropic for Claude and the Claude CLI
- VS Code extension developers for Cline, Continue, and other AI assistants
- Open source community for tools and libraries
🔗 Ready to get started?
Run the one-line setup: git clone https://github.com/saxyguy81/claude-proxy.git && cd claude-proxy && ./install.sh && code .
Your AI coding assistant will be running securely through the proxy in under 2 minutes! 🎉
推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。