What is MCP?
Model Context Protocol (MCP) is a standard for connecting AI assistants to data sources and tools. It provides a unified way for AI systems to access and interact with various data sources, including CloudQuery’s cloud asset inventory.
CloudQuery MCP Server
The CloudQuery MCP server exposes your cloud asset inventory through the MCP protocol, allowing AI assistants to:
- Query your cloud resources using natural language
- Get real-time information about your infrastructure
- Perform asset discovery and analysis
- Generate reports and insights
Setup
Prerequisites
- CloudQuery CLI installed and configured
- Active syncs with cloud providers
- MCP-compatible AI assistant or tool
Installation
- Install the CloudQuery MCP server:
cloudquery plugin install cloudquery/mcp-server
- Configure the MCP server in your CloudQuery configuration:
kind: destination
spec:
name: mcp-server
path: cloudquery/mcp-server
registry: cloudquery
version: "latest"
spec:
# MCP server configuration
port: 8080
# Add your sync data sources
sources: ["aws", "gcp", "azure"]
- Start the MCP server:
cloudquery sync --destination mcp-server
Usage
Once the MCP server is running, you can connect AI assistants to it using the MCP protocol. The server will expose your cloud asset inventory as queryable data.
Example Queries
- “Show me all EC2 instances in production”
- “What S3 buckets are publicly accessible?”
- “List all databases across all cloud providers”
- “Find resources with security vulnerabilities”
Configuration
The MCP server supports various configuration options:
- Port: Specify the port for the MCP server
- Sources: Define which sync sources to expose
- Authentication: Configure access controls
- Rate Limiting: Set query rate limits
Integration Examples
Claude Desktop
Add the CloudQuery MCP server to your Claude Desktop configuration:
{
"mcpServers": {
"cloudquery": {
"command": "cloudquery",
"args": ["mcp-server", "--port", "8080"]
}
}
}
Other AI Tools
The CloudQuery MCP server is compatible with any MCP client. Refer to your AI tool’s documentation for MCP integration instructions.
Security Considerations
- Ensure proper authentication and authorization
- Use HTTPS in production environments
- Implement rate limiting to prevent abuse
- Monitor access logs and usage patterns
Troubleshooting
Common Issues
- Connection Refused: Check that the MCP server is running and accessible
- Authentication Errors: Verify your CloudQuery credentials and permissions
- No Data Available: Ensure your syncs are running and have data
Debug Mode
Enable debug logging for troubleshooting:
cloudquery mcp-server --debug --port 8080
API Reference
The MCP server exposes the following capabilities:
query_assets
: Query cloud assets with filtersget_asset_details
: Get detailed information about specific assetslist_providers
: List available cloud providersget_schema
: Get the schema for asset tables
For detailed API documentation, see the MCP specification.