Agent-Ops Optimization: Smarter Deployments & Token Management
November 6, 2025
Type: DevOps Optimization Impact: Faster deployments, 10k tokens saved, simplified workflows
Whatβs New
π Optimized /deploy Command
Before: Complex shell scripts with unclear dependencies Now: Single, fast wrangler-native deployment
# Deploy to Cloudflare Pages (oneie project)
/deploy
# What happens:
# 1. Build production bundle (25-30s)
# 2. Deploy via wrangler (10-15s)
# 3. Live globally in <45s
Benefits:
- β Transparent: See exactly whatβs happening
- β Fast: 35-45 seconds total (build + deploy)
- β Direct: No shell script overhead
- β Reliable: Wrangler handles all edge cases
- β Observable: Clear status messages and URLs
ποΈ New mcp-on Script for Token Optimization
Managing MCP servers just got simple. Turn MCPs on/off with one command:
# Check current status
./.claude/hooks/mcp-on.sh status
# Turn MCPs ON (full tool access)
./.claude/hooks/mcp-on.sh on
# Turn MCPs OFF (save ~10k tokens)
./.claude/hooks/mcp-on.sh off
MCP Servers Available When Enabled:
- shadcn - UI component registry
- cloudflare-builds - Build logs & deployment status
- cloudflare-observability - Analytics & monitoring
- cloudflare-docs - Cloudflare API reference
- chrome-devtools - Performance profiling
- framelink-figma - Design integration
- astro-docs - Astro framework reference
- stripe - Payment processing API
Token Impact:
MCPs ON: ~15k context tokens (full tools)
MCPs OFF: ~10k tokens saved (recommended default)
π Performance Metrics
Deployment Speed:
| Phase | Time |
|---|---|
| Build | 25-30s |
| Deploy | 10-15s |
| Total | 35-45s |
Token Savings:
- MCPs OFF by default: 10k tokens saved
- Turn on only when needed: Deploy, design, build UI
- Turn off when done: Maximize token budget
π§ Agent-Ops Enhancements
Updated /agent-ops.md with:
- β Optimized deployment commands
- β MCP management best practices
- β Token optimization guidelines
- β When to enable/disable MCPs
- β Updated deployment workflows
π Command Documentation
New: .claude/commands/mcp-on.md
- Complete usage guide
- Configuration file explanations
- When to use each command
- Quick reference examples
Updated: .claude/commands/deploy.md
- Simplified to wrangler-native approach
- Clear deployment phases
- Troubleshooting guide
- Rollback procedures
Removed Deprecated References
Cleaned up the following non-functional commands:
- β
./scripts/cloudflare-deploy.shβ Now/deploy - β
./scripts/mcp-toggle.shβ Now/mcp-onscript - β Old
mcp-toggle.mdcommand β Replaced withmcp-on.md
Recommended Workflows
Daily Development
# Start: Keep MCPs off (save tokens)
./.claude/hooks/mcp-on.sh off
# Work on features, refactor, test
# ... commit & push ...
# End: Keep off or turn back on if needed
Deploying to Production
# Pre-deployment: Enable MCPs for full tool access
./.claude/hooks/mcp-on.sh on
# Deploy with full Cloudflare tools available
/deploy
# Post-deployment: Turn off to save tokens
./.claude/hooks/mcp-on.sh off
Building UI Components
# Enable: Get shadcn + chrome-devtools
./.claude/hooks/mcp-on.sh on
# Build & optimize components
# ... design, test, profile ...
# Done: Turn off
./.claude/hooks/mcp-on.sh off
Designing with Figma
# Enable: Get figma + chrome-devtools
./.claude/hooks/mcp-on.sh on
# Design & collaborate
# ... create, iterate, refine ...
# Done: Turn off
./.claude/hooks/mcp-on.sh off
Breaking Changes
None. This is a pure optimization release:
- All commands still work
- New ways are faster/better
- Old ways still available
- Fully backward compatible
Migration Guide
If Using Old Deploy Command
Before:
./scripts/cloudflare-deploy.sh deploy web dist production
After:
/deploy
Thatβs it! Same result, cleaner command.
If Managing MCPs Manually
Before:
# Manual .mcp.json editing or no control
After:
# Simple toggle script
./.claude/hooks/mcp-on.sh on
./.claude/hooks/mcp-on.sh off
Files Changed
Created:
.claude/hooks/mcp-on.sh- MCP toggle script.claude/commands/mcp-on.md- MCP documentation.mcp.json.on- Backup of last enabled config
Updated:
.claude/commands/deploy.md- Simplified deployment guide.claude/agents/agent-ops.md- Added MCP management & optimized deploy
Deleted:
.claude/commands/mcp-toggle.md- Replaced withmcp-on.md
Configuration Files
After running mcp-on.sh:
.mcp.json β Active config (MCPs enabled/disabled based on last toggle)
.mcp.json.off β Template with all servers disabled
.mcp.json.on β Backup of last enabled state
Key Insights
Why Disable MCPs by Default?
- Token Budget: MCPs = ~10k tokens even when idle
- Focused Tools: Core tools (Bash, Read, Edit, etc.) are primary
- Intentional Usage: Turn on only for specific tasks
- Performance: Smaller context = faster inference
When MCPs Are Essential
- Deploying (Cloudflare tools)
- Building UI (shadcn registry, profiling)
- Designing (Figma integration)
- Researching (documentation access)
The Optimization Philosophy
Token = Currency
Just like financial budgets, context tokens are precious:
- Use them intentionally
- Disable when not needed
- Allocate for high-value tasks
- Measure impact continuously
Deployment Speed Comparison
Before Optimization:
Build + Script + Deploy = ~60s
Via multiple shell scripts with overhead
After Optimization:
Build + Wrangler Deploy = ~45s
Direct wrangler CLI, no scripts
15-second improvement = Faster feedback loop
Whatβs Next
v3.5.0 (Next Minor)
- Multi-backend deployment support
- Automated MCP recommendations (context-aware)
- Advanced deployment analytics
v4.0.0 (Next Major)
- Complete MCP overhaul
- Context management dashboard
- Token usage tracking per session
Testing the New Features
Test Deployment
cd web
/deploy
# Should complete in ~45 seconds
# Live at: https://oneie.pages.dev
Test MCP Toggle
# Check status
./.claude/hooks/mcp-on.sh status
# Should show MCPs ON/OFF with server list
# Turn off
./.claude/hooks/mcp-on.sh off
# Restart Claude Code
# Turn on
./.claude/hooks/mcp-on.sh on
# Restart Claude Code
Live Updates
- Deploy Command: Ready now
- MCP-On Script: Ready now
- Documentation: Updated
- Agent-Ops: Fully integrated
Feedback & Issues
- Bug Reports: https://github.com/one-ie/one/issues
- Suggestions: Submit via GitHub discussions
- Email: [email protected]
Resources
Smart operations. Fast deployments. Optimized workflows.
π ONE Platform - Building Intelligent Systems