Skip to content

Commit 3f57638

Browse files
authored
Merge pull request #212 from stackql/feature/web-content-updates
added claude desktop article
2 parents 994edb9 + 5407fc2 commit 3f57638

File tree

2 files changed

+245
-0
lines changed

2 files changed

+245
-0
lines changed
Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
---
2+
title: Using StackQL with Claude Desktop
3+
hide_title: false
4+
hide_table_of_contents: false
5+
keywords:
6+
- stackql
7+
- claude desktop
8+
- mcp
9+
- model context protocol
10+
- ai
11+
- infrastructure-as-code
12+
- multi-cloud
13+
description: Use StackQL with Claude Desktop to query and provision cloud resources using natural language
14+
image: "/img/stackql-featured-image.png"
15+
---
16+
17+
StackQL integrates with Claude Desktop via the Model Context Protocol (MCP), enabling you to query and provision cloud resources across multiple cloud providers using natural language. This powerful combination allows you to interact with your cloud infrastructure conversationally while leveraging StackQL's SQL-based interface under the hood.
18+
19+
## Prerequisites
20+
21+
Before setting up StackQL with Claude Desktop, ensure you have:
22+
23+
1. **StackQL installed** - Download and install StackQL from [stackql.io](https://stackql.io/downloads) or use a package manager
24+
2. **Claude Desktop** - Download from [Anthropic's website](https://claude.ai/desktop)
25+
3. **Cloud provider credentials** - API keys or credentials for the cloud providers you want to work with
26+
27+
Verify StackQL is in your system PATH by running:
28+
29+
```bash
30+
stackql --version
31+
```
32+
33+
## Configuration
34+
35+
### Setting Up the MCP Server
36+
37+
To enable Claude Desktop to communicate with StackQL, you need to configure the MCP server in your Claude Desktop configuration file.
38+
39+
#### Windows
40+
41+
Edit the configuration file located at:
42+
```
43+
%APPDATA%\Claude\claude_desktop_config.json
44+
```
45+
46+
#### macOS
47+
48+
Edit the configuration file located at:
49+
```
50+
~/Library/Application Support/Claude/claude_desktop_config.json
51+
```
52+
53+
#### Linux
54+
55+
Edit the configuration file located at:
56+
```
57+
~/.config/Claude/claude_desktop_config.json
58+
```
59+
60+
### Configuration Example
61+
62+
Add the following configuration to your `claude_desktop_config.json` file:
63+
64+
```json
65+
{
66+
"mcpServers": {
67+
"stackql": {
68+
"command": "stackql",
69+
"args": [
70+
"mcp",
71+
"--mcp.server.type=stdio",
72+
"--tls.allowInsecure"
73+
],
74+
"env": {
75+
"GOOGLE_CREDENTIALS": "/path/to/google-credentials.json",
76+
"AWS_ACCESS_KEY_ID": "your-aws-access-key-id",
77+
"AWS_SECRET_ACCESS_KEY": "your-aws-secret-access-key",
78+
"AZURE_CLIENT_ID": "your-azure-client-id",
79+
"AZURE_CLIENT_SECRET": "your-azure-client-secret",
80+
"AZURE_TENANT_ID": "your-azure-tenant-id",
81+
"DATABRICKS_CLIENT_ID": "your-databricks-client-id",
82+
"DATABRICKS_CLIENT_SECRET": "your-databricks-client-secret",
83+
"OPENAI_API_KEY": "your-openai-api-key"
84+
}
85+
}
86+
}
87+
}
88+
```
89+
90+
:::tip
91+
You only need to include environment variables for the cloud providers you plan to use. Remove any unused provider credentials from the configuration.
92+
:::
93+
94+
:::warning
95+
Never commit your `claude_desktop_config.json` file with actual credentials to version control. Use secure credential management practices.
96+
:::
97+
98+
### Provider-Specific Credentials
99+
100+
Different cloud providers require different authentication methods, see the provider docs ([https://stackql.io/docs/providers](https://stackql.io/docs/providers))for the environment variables required for your desired provider(s).
101+
102+
103+
## Restarting Claude Desktop
104+
105+
After updating the configuration file, restart Claude Desktop to load the new MCP server configuration. The StackQL MCP server will be automatically started when you begin a new conversation.
106+
107+
## What You Can Do
108+
109+
Once configured, you can use natural language in Claude Desktop to:
110+
111+
### Query Cloud Resources
112+
113+
Ask Claude to retrieve information about your cloud infrastructure:
114+
115+
- "Show me all my GCP compute instances in the us-central1 region"
116+
- "List all S3 buckets in my AWS account"
117+
- "What Azure virtual machines are running in my subscription?"
118+
- "Show me all Kubernetes pods in the default namespace"
119+
120+
### Provision Resources
121+
122+
Create and deploy cloud resources using conversational commands:
123+
124+
- "Create an S3 bucket named 'my-data-bucket' in us-west-2"
125+
- "Deploy a GCP Cloud Storage bucket with versioning enabled"
126+
- "Launch a small EC2 instance in us-east-1"
127+
- "Create an Azure resource group in westus2"
128+
129+
### Analyze and Audit
130+
131+
Perform security audits and compliance checks:
132+
133+
- "Show me all publicly accessible S3 buckets"
134+
- "List IAM users who haven't logged in for 90 days"
135+
- "Find all GCP instances without proper labels"
136+
- "Identify Azure VMs without backup enabled"
137+
138+
### Cross-Cloud Operations
139+
140+
Query and compare resources across multiple cloud providers:
141+
142+
- "Show me all compute instances across AWS, GCP, and Azure"
143+
- "Compare storage costs between AWS S3 and GCP Cloud Storage"
144+
- "List all databases across all cloud providers"
145+
146+
### Infrastructure as Code
147+
148+
Generate and execute infrastructure deployment queries:
149+
150+
- "Create a stack of resources including a VPC, subnet, and EC2 instance"
151+
- "Deploy a complete GKE cluster with node pools"
152+
- "Set up a multi-region deployment in AWS"
153+
154+
### Modify Resources
155+
156+
Update existing cloud resources:
157+
158+
- "Add tags to all untagged EC2 instances"
159+
- "Enable encryption for S3 bucket 'my-bucket'"
160+
- "Update the machine type of GCP instance 'web-server-1'"
161+
- "Change the ACL on my Cloud Storage bucket to private"
162+
163+
### Delete Resources
164+
165+
Remove cloud resources when no longer needed:
166+
167+
- "Delete the S3 bucket 'temp-bucket'"
168+
- "Remove all stopped EC2 instances"
169+
- "Clean up unused GCP disks"
170+
171+
## Example Conversation
172+
173+
Here's an example of how you might interact with Claude Desktop using StackQL:
174+
175+
**You:** "Can you show me all my GCP compute instances?"
176+
177+
**Claude:** *Executes a StackQL query and returns results in a formatted table showing instance names, zones, machine types, and status*
178+
179+
**You:** "Create a new Cloud Storage bucket named 'analytics-data-2025' in the us-central1 region with uniform bucket-level access"
180+
181+
**Claude:** *Executes a StackQL INSERT statement to create the bucket and confirms the creation*
182+
183+
**You:** "Now list all my Cloud Storage buckets"
184+
185+
**Claude:** *Executes a SELECT query and shows all buckets including the newly created one*
186+
187+
## Tips and Best Practices
188+
189+
1. **Be Specific**: The more specific your request, the better results you'll get. Include resource names, regions, and specific attributes when possible.
190+
191+
2. **Use Natural Language**: You don't need to know SQL syntax - Claude translates your natural language requests into StackQL queries.
192+
193+
3. **Review Before Executing**: For destructive operations (DELETE, UPDATE), Claude will typically show you what will be executed before proceeding.
194+
195+
4. **Multi-Step Operations**: You can chain operations together in a single conversation. Claude maintains context throughout the session.
196+
197+
5. **Error Handling**: If a query fails, Claude can help troubleshoot and suggest corrections based on the error message.
198+
199+
6. **Explore Capabilities**: Ask Claude "What can I do with StackQL?" to get suggestions specific to your configured providers.
200+
201+
## Troubleshooting
202+
203+
### MCP Server Not Starting
204+
205+
If Claude Desktop cannot connect to the StackQL MCP server:
206+
207+
1. Verify StackQL is in your PATH
208+
2. Check that your `claude_desktop_config.json` file is valid JSON
209+
3. Ensure the file path in the configuration is correct for your operating system
210+
4. Review the Claude Desktop logs for error messages
211+
212+
### Authentication Errors
213+
214+
If you receive authentication errors:
215+
216+
1. Verify your cloud provider credentials are correct
217+
2. Ensure credential files exist at the specified paths
218+
3. Check that environment variables are properly formatted in the configuration
219+
4. Confirm your credentials have the necessary permissions
220+
221+
### Permission Errors
222+
223+
If operations fail due to insufficient permissions:
224+
225+
1. Verify your service account or IAM user has the required permissions
226+
2. Check provider-specific IAM policies
227+
3. Ensure API services are enabled in your cloud projects
228+
229+
## Learn More
230+
231+
- [StackQL MCP Command Reference](/docs/command-line-usage/mcp)
232+
- [StackQL Provider Registry](/providers)
233+
- [Language Specification](/docs/language-spec/select)
234+
- [Model Context Protocol Documentation](https://modelcontextprotocol.io)
235+
236+
## Security Considerations
237+
238+
:::caution
239+
- Store credentials securely and never commit them to version control
240+
- Use least-privilege access principles for service accounts
241+
- Regularly rotate credentials and API keys
242+
- Monitor MCP server logs for unusual activity
243+
- Consider using cloud provider credential management tools (e.g., Secret Manager, Parameter Store)
244+
:::

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const sidebars = {
2424
'getting-started/resource-hierarchy',
2525
'getting-started/using-stackql',
2626
'getting-started/using-a-provider',
27+
'getting-started/claude-desktop',
2728
'getting-started/output-modes',
2829
'getting-started/variables',
2930
'getting-started/templating',

0 commit comments

Comments
 (0)