You now have a fully integrated Copilot CLI + Local Agent system!
Your Request
↓
Copilot CLI (me)
↓
MCP Server Bridge
↓
Local Agent API (REST)
↓
Backend: DeepSeek + Ollama + Ansible
↓
Result back to Copilot CLI
copilot > Execute this command on the agent: "ls -la /opt/local-agent"
I will use the local_execute tool to run it.
copilot > Ask the local agent's DeepSeek: "Analyze what's consuming the most CPU"
I will use the local_deepseek tool.
copilot > Deploy using Ansible playbook at /opt/local-agent/config/playbook.yml
I will use the local_ansible tool.
copilot > Plan a system backup, then execute it via the local agent
I will:
copilot
From within Copilot CLI, use:
/mcp
Then select or configure the local-agent MCP server.
Tell me what services are running on the local agent
This will fetch status via the API.
Execute shell commands on the local agent
{
"command": "df -h",
"timeout": 300,
"safe_mode": true
}
Query the local DeepSeek model
{
"query": "What is causing high memory usage?",
"model": "deepseek-chat",
"reasoning": false
}
Run Ansible playbooks
{
"playbook_path": "/opt/local-agent/config/playbook.yml",
"extra_vars": {"action": "backup"},
"check": false
}
Get service status (ollama, ssh, local-agent)
Get recent agent logs (last 50 lines)
You: "The server is slow, diagnose and fix it"
↓
Me: Create plan for diagnosis
↓
Me: Use local_execute to check processes
↓
Me: Query local_deepseek for analysis
↓
Me: Generate fix (kill service, scale resources, etc)
↓
Me: Execute via local_ansible
↓
You: See results
You: "Deploy the new API version"
↓
Me: Pull latest code
↓
Me: Create deployment plan
↓
Me: Use local_ansible to deploy
↓
Me: Use local_execute to health check
↓
Me: Report status
You: "Backup database and verify"
↓
Me: Create backup playbook
↓
Me: Run via local_ansible
↓
Me: Query DeepSeek for verification steps
↓
Me: Execute verification
↓
You: See backup status and location
✅ Safety Mode - Dangerous commands blocked by default ✅ Timeout Protection - Commands abort if taking too long ✅ Audit Trail - All actions logged to /opt/local-agent/logs/ ✅ SSH Keys Only - No password authentication ✅ Sudo Restrictions - Dangerous ops require confirmation
If you want to use the API directly:
# Health check
curl http://localhost:8888/health
# Execute command
curl -X POST http://localhost:8888/execute \
-H "Content-Type: application/json" \
-d '{"command":"whoami"}'
# Ask DeepSeek
curl -X POST http://localhost:8888/deepseek \
-H "Content-Type: application/json" \
-d '{"query":"What is this error?","model":"deepseek-chat"}'
# Run Ansible
curl -X POST http://localhost:8888/ansible \
-H "Content-Type: application/json" \
-d '{"playbook_path":"/opt/local-agent/config/playbook.yml"}'
# Get service status
curl http://localhost:8888/services
# Get logs
curl http://localhost:8888/logs?lines=50
# Simple execution Execute: "uname -a" # With analysis Check the CPU and memory usage, then ask DeepSeek if it's normal # Full workflow Create a plan to monitor the system for 5 minutes, then diagnose any issues # Deployment Deploy the application using Ansible, then verify it's working # Emergency fix Something is wrong with the SSH service. Use the agent to diagnose and restart if needed.
/opt/local-agent/config/agent.conf
/opt/local-agent/config/playbook.yml
/opt/local-agent/logs/
systemctl status local-agent-api systemctl restart local-agent-api
# Check MCP config cat ~/.copilot/mcp-config.json # Restart Copilot CLI with debug copilot --debug
/opt/local-agent/logs/agent.log for why/plan in Copilot CLI before complex operations--check on Ansible playbooks first/context to see token usage and what's being sentcopilot/mcp to enable local agent integrationYou now have a Copilot CLI+ setup with NO LIMITS and NO QUOTAS! 🚀