anirudhatalmale7-a11y/ai-agent-mcp-server
3.2
If you are the rightful owner of ai-agent-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The AI Agent MCP Server is a tool designed to facilitate the execution of commands and management of files and repositories on a GCP VM via SSH, using a Claude agent.
Tools
12
Resources
0
Prompts
0
AI Agent MCP Server
Desktop Commander-like tools for Claude agent, executed via SSH on a GCP VM.
Architecture
Claude API (brain)
↓
FastAPI MCP Server (Cloud Run)
↓
SSH → e2-micro VM (workspace)
↓
Git, files, bash, tests
Setup
1. Create GCP VM (Free Tier)
# Create e2-micro in free tier region
gcloud compute instances create claude-workspace \
--machine-type=e2-micro \
--zone=us-central1-a \
--image-family=debian-12 \
--image-project=debian-cloud \
--boot-disk-size=10GB
# Get external IP
gcloud compute instances describe claude-workspace \
--zone=us-central1-a \
--format='get(networkInterfaces[0].accessConfigs[0].natIP)'
2. Setup VM
# SSH into VM
gcloud compute ssh claude-workspace --zone=us-central1-a
# Run setup script
curl -sSL https://raw.githubusercontent.com/YOUR_REPO/vm-setup.sh | bash
3. Configure SSH Keys
# Generate key pair (local machine)
ssh-keygen -t rsa -b 4096 -f mcp_server_key -N ''
# Copy public key to VM
gcloud compute ssh claude-workspace --zone=us-central1-a --command="
echo '$(cat mcp_server_key.pub)' >> /home/claude-agent/.ssh/authorized_keys
chmod 600 /home/claude-agent/.ssh/authorized_keys
chown claude-agent:claude-agent /home/claude-agent/.ssh/authorized_keys
"
4. Store Secrets in GCP Secret Manager
# VM IP
echo -n "YOUR_VM_IP" | gcloud secrets create VM_HOST --data-file=-
# SSH private key
gcloud secrets create VM_SSH_KEY --data-file=mcp_server_key
# MCP API Key (optional)
echo -n "your-secure-api-key" | gcloud secrets create MCP_API_KEY --data-file=-
5. Deploy MCP Server
# Trigger Cloud Build
gcloud builds submit --config=cloudbuild.yaml
Usage
Direct API Calls
MCP_URL="https://ai-agent-mcp-server-xxx.run.app"
# Execute bash
curl -X POST "$MCP_URL/tools/bash" \
-H "Content-Type: application/json" \
-d '{"command": "ls -la"}'
# Read file
curl -X POST "$MCP_URL/tools/read_file" \
-H "Content-Type: application/json" \
-d '{"path": "README.md"}'
# Clone repo
curl -X POST "$MCP_URL/tools/git/clone" \
-H "Content-Type: application/json" \
-d '{"repo_url": "https://github.com/user/repo.git"}'
Python Agent
export MCP_SERVER_URL="https://ai-agent-mcp-server-xxx.run.app"
export ANTHROPIC_API_KEY="your-key"
python agent.py "Clone the repo, fix the bug in main.py, test it, and push"
Tools Available
| Tool | Description |
|---|---|
bash | Execute shell commands |
read_file | Read file contents |
write_file | Create/overwrite file |
edit_file | Surgical string replacement |
delete_file | Delete file |
list_directory | List directory |
create_directory | Create directory |
git_clone | Clone repository |
git_pull | Pull changes |
git_commit | Commit all changes |
git_push | Push to remote |
git_status | Get status |
Security
- Path validation: All paths must be within
/home/claude-agent/workspaces - Command filtering: Dangerous commands blocked (rm -rf /, fork bombs, etc.)
- API key auth: Optional X-API-Key header
- SSH key auth: Only MCP server can connect to VM
Cost
- e2-micro VM: $0 (free tier in us-central1)
- Cloud Run MCP Server: ~$0-1/month (min-instances=0, only charges during use)