Skip to main content
Logo
November 6, 2025 By ONE Platform feature

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:

  1. shadcn - UI component registry
  2. cloudflare-builds - Build logs & deployment status
  3. cloudflare-observability - Analytics & monitoring
  4. cloudflare-docs - Cloudflare API reference
  5. chrome-devtools - Performance profiling
  6. framelink-figma - Design integration
  7. astro-docs - Astro framework reference
  8. stripe - Payment processing API

Token Impact:

MCPs ON:  ~15k context tokens (full tools)
MCPs OFF: ~10k tokens saved (recommended default)

πŸ“Š Performance Metrics

Deployment Speed:

PhaseTime
Build25-30s
Deploy10-15s
Total35-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-on script
  • ❌ Old mcp-toggle.md command β†’ Replaced with mcp-on.md

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 with mcp-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?

  1. Token Budget: MCPs = ~10k tokens even when idle
  2. Focused Tools: Core tools (Bash, Read, Edit, etc.) are primary
  3. Intentional Usage: Turn on only for specific tasks
  4. 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

Resources


Smart operations. Fast deployments. Optimized workflows.

πŸš€ ONE Platform - Building Intelligent Systems