Kiro IDE MCP Server - Quick Start Guide
What You'll Get
Ask questions in plain English directly in Kiro IDE:
- "Which model is consuming the most tokens?"
- "What's the average latency for Claude Haiku?"
- "Estimate my LLM costs for the last hour"
No need to switch to dashboards or write complex queries!
Step 1: Configure MCP Server in Kiro
Option A: Use Workspace Configuration (Recommended)
-
Create the MCP config directory:
mkdir -p .kiro/settings -
Copy the MCP configuration:
cp AI-OBS_DEMO/kiro-mcp-config.json .kiro/settings/mcp.json -
Update the path in the config (if needed): Open
.kiro/settings/mcp.jsonand verify the path tocloudwatch_mcp_server.pyis correct:{
"mcpServers": {
"ai-observability": {
"command": "python3",
"args": [
"/path/to/mcp-server/cloudwatch_mcp_server.py"
],
"env": {
"AWS_REGION": "your-aws-region"
},
"disabled": false,
"autoApprove": []
}
}
}
Option B: Use User-Level Configuration (Global)
-
Create the user config directory:
mkdir -p ~/.kiro/settings -
Copy the configuration:
cp AI-OBS_DEMO/kiro-mcp-config.json ~/.kiro/settings/mcp.json
Step 2: Verify AWS Credentials
The MCP server needs AWS credentials to query CloudWatch:
# Check your AWS credentials are configured
aws sts get-caller-identity
# Should show:
# {
# "UserId": "...",
# "Account": "<your-account-id>",
# "Arn": "arn:aws:iam::<your-account-id>:user/<your-username>"
# }
If not configured, set up AWS credentials:
aws configure
# Enter your AWS Access Key ID
# Enter your AWS Secret Access Key
# Default region: your-aws-region
# Default output format: json
Step 3: Test MCP Server (Optional)
Before using in Kiro, verify the MCP server works:
python3 AI-OBS_DEMO/test-mcp-server.py
You should see output like:
Testing CloudWatch MCP Server
==============================
1. Testing get_token_usage...
✅ Success: {
"token_type": "input",
"time_range_hours": 1,
"models": [...]
}
2. Testing get_model_latency...
✅ Success: {...}
Step 4: Restart Kiro IDE
For Kiro to load the MCP configuration:
- Save all your work
- Quit Kiro completely (Cmd+Q on Mac, or File → Exit)
- Reopen Kiro
- Open your workspace (the folder containing
.kiro/settings/mcp.json)
Step 5: Verify MCP Server is Connected
- Open the Kiro Feature Panel (left sidebar)
- Look for "MCP Servers" section
- You should see:
ai-observabilitywith a green status indicator - If you see a red indicator: Click on it to see error details
Troubleshooting Connection Issues
If the server shows as disconnected:
- Check the MCP Server view in Kiro's left panel
- Click "Reconnect" if available
- Check logs: Look for error messages in the MCP server output
- Verify the Python path: Make sure
python3is in your PATH - Check file permissions: Ensure
cloudwatch_mcp_server.pyis readable
Step 6: Use Natural Language Queries
In Kiro Chat
- Open Kiro Chat (Cmd+L or click chat icon)
- Type your question in plain English:
Which model is consuming the most tokens?
- Kiro will automatically:
- Recognize this as an observability query
- Call the MCP server's
get_token_usagetool - Return structured results
Example Queries to Try
1. Token Usage
Which model is consuming the most tokens?
Expected Response:
{
"token_type": "input",
"time_range_hours": 1,
"models": [
{
"model": "anthropic.claude-3-haiku-20240307-v1:0",
"total_tokens": 475
},
{
"model": "gpt-4o",
"total_tokens": 312
}
]
}
2. Latency Statistics
What's the average latency for all models?
Expected Response:
{
"time_range_hours": 1,
"models": [
{
"model": "anthropic.claude-3-sonnet-20240229-v1:0",
"avg_latency_ms": 2567.89
},
{
"model": "gpt-4o",
"avg_latency_ms": 2234.12
}
]
}
3. Cost Estimation
Estimate the cost of LLM usage for the last hour
Expected Response:
{
"time_range_hours": 1,
"total_estimated_cost_usd": 0.0142,
"cost_breakdown": [
{
"model": "anthropic.claude-3-haiku-20240307-v1:0",
"input_tokens": 475,
"output_tokens": 8084,
"estimated_cost_usd": 0.0102
}
]
}
4. Request Volume
How many requests have been made in the last hour?
5. Model Comparison
Compare all models by latency and token usage
Step 7: Advanced Usage
Custom Time Ranges
You can specify custom time ranges in your queries:
Show me token usage for the last 2 hours
What was the latency for Claude Haiku in the last 3 hours?
Specific Model Queries
Query specific models using their full IDs:
What's the latency for anthropic.claude-3-haiku-20240307-v1:0?
Multi-Metric Queries
Ask for comprehensive analysis:
Give me a complete overview of Claude Haiku performance
Troubleshooting
"No data" Responses
Problem: MCP server returns empty results
Solutions:
- Run the demo to generate metrics:
python3 AI-OBS_DEMO/multi-cloud-demo.py - Wait 1-2 minutes for CloudWatch to ingest metrics
- Try increasing time range: "Show me token usage for the last 2 hours"
MCP Server Not Responding
Problem: Queries timeout or fail
Solutions:
- Check MCP server status in Kiro's MCP panel
- Verify AWS credentials:
aws sts get-caller-identity - Check CloudWatch permissions
- Restart Kiro to reload MCP configuration
Permission Errors
Problem: "AccessDenied" errors in responses
Solutions:
- Verify IAM permissions include:
cloudwatch:GetMetricStatisticscloudwatch:ListMetrics
- Check AWS region is set correctly