Setup an Agent
Deploy WeaveMCP agents to production environments using various platforms and deployment methods.Deployment Options
Choose from multiple deployment platforms based on your infrastructure needs:Kubernetes
Container orchestration platform for scalable deployments
Docker Compose
Multi-container applications for development and testing
AWS EC2
Amazon cloud instances for reliable hosting
Google Cloud Run
Serverless containers with automatic scaling
Why Deploy Agents?
While the WeaveMCP CLI (weave
) works great for local development, deploying agents provides several benefits for production use:
Self-Hosted MCP Servers
- Security: Keep sensitive data and processing within your infrastructure
- Performance: Reduce latency by running servers closer to your data sources
- Compliance: Meet regulatory requirements for data residency
- Custom Logic: Run proprietary or custom MCP server implementations
Team Collaboration
- Shared Resources: Make MCP servers available to your entire organization
- Centralized Management: Configure and monitor all servers from one place
- Access Control: Fine-grained permissions for different team members
- Usage Monitoring: Track and optimize MCP server usage across your team
Production Reliability
- High Availability: Automatic failover and redundancy
- Scaling: Handle increased load automatically
- Monitoring: Built-in observability and alerting
- Backup & Recovery: Automated backup strategies
Architecture Overview
WeaveMCP agents act as bridges between your virtual MCP servers and actual MCP server implementations:Components
- Virtual MCP Server: A cloud-hosted endpoint that receives MCP requests
- Agent: Self-hosted component that connects to virtual servers and manages local MCP servers
- MCP Servers: Your actual tool implementations (filesystem, database, APIs, etc.)
Communication Flow
- Claude Desktop makes an MCP request through the WeaveMCP proxy
- Request is routed to your virtual server endpoint
- Virtual server forwards the request to your deployed agent
- Agent executes the request on the appropriate MCP server
- Response flows back through the same chain
Getting Started
Prerequisites
Before deploying an agent, ensure you have:- WeaveMCP Account: Sign up at console.weavemcp.com
- Virtual MCP Server: Created through the web console
- Agent Token: Generated for your virtual server
- Target Platform: Access to one of the supported deployment platforms
Basic Setup Steps
- Create Virtual Server: Use the web console to create a new virtual MCP server
- Generate Agent Token: Create an authentication token for your agent
- Choose Deployment Method: Select from Kubernetes, Docker Compose, AWS EC2, or Google Cloud Run
- Configure Agent: Set up environment variables and configuration files
- Deploy: Follow platform-specific deployment instructions
- Test Connection: Verify the agent connects to your virtual server
Environment Configuration
All deployment methods require these essential environment variables:Security Considerations
Network Security
- TLS Encryption: All communication uses TLS 1.3
- Token Authentication: Agents authenticate using secure tokens
- Network Isolation: Deploy agents in private networks when possible
- Firewall Rules: Only allow outbound HTTPS connections to WeaveMCP
Secrets Management
- Token Storage: Use platform-specific secret management (Kubernetes secrets, AWS Secrets Manager, etc.)
- Environment Variables: Avoid hardcoding tokens in configuration files
- Rotation: Regularly rotate agent tokens through the web console
Access Control
- Least Privilege: Grant minimal required permissions to agent containers
- Service Accounts: Use dedicated service accounts with limited scopes
- Network Policies: Implement network policies to restrict agent communication
Monitoring and Observability
Health Checks
Agents expose health check endpoints:Metrics
Prometheus metrics are available at/metrics
:
weavemcp_agent_requests_total
: Total MCP requests processedweavemcp_agent_request_duration_seconds
: Request processing timeweavemcp_agent_connection_status
: Connection status to virtual serverweavemcp_mcp_server_status
: Status of individual MCP servers
Logging
Agents log in JSON format with configurable levels:Troubleshooting
Common Issues
Agent won't connect to virtual server
Agent won't connect to virtual server
- Verify the
WEAVEMCP_SERVER_URL
is correct - Check the agent token is valid and not expired
- Ensure outbound HTTPS (port 443) is allowed
- Check agent logs for specific connection errors
MCP server not responding
MCP server not responding
- Verify MCP server is running and healthy
- Check MCP server configuration in agent config
- Review MCP server logs for errors
- Test MCP server directly if possible
High latency or timeouts
High latency or timeouts
- Check network connectivity between components
- Review resource limits (CPU, memory) on agent
- Monitor MCP server performance
- Consider deploying agents closer to MCP servers
Authentication failures
Authentication failures
- Regenerate agent token from web console
- Verify token is correctly set in environment
- Check token hasn’t expired
- Ensure virtual server is active
Debug Mode
Enable debug logging for detailed troubleshooting:- Detailed request/response logging
- Connection status information
- MCP server communication details
- Performance metrics
Next Steps
Choose your deployment platform to get started:Start with Docker Compose
Quickest way to test agent deployment locally
Production with Kubernetes
Scalable production deployment
Cloud with AWS EC2
Simple cloud deployment
Serverless with Cloud Run
Automatic scaling and managed infrastructure
Advanced Topics
Once you have basic agent deployment working:- Load Balancing: Deploy multiple agents for high availability
- Auto Scaling: Scale agents based on demand
- Multi-Region: Deploy agents across multiple regions
- Custom MCP Servers: Integrate your own MCP server implementations
- CI/CD Integration: Automate agent deployment and updates