awslabs.cloudwatch-appsignals-mcp-server 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- awslabs/__init__.py +16 -0
- awslabs/cloudwatch_appsignals_mcp_server/__init__.py +17 -0
- awslabs/cloudwatch_appsignals_mcp_server/server.py +271 -0
- awslabs_cloudwatch_appsignals_mcp_server-0.1.1.dist-info/METADATA +250 -0
- awslabs_cloudwatch_appsignals_mcp_server-0.1.1.dist-info/RECORD +9 -0
- awslabs_cloudwatch_appsignals_mcp_server-0.1.1.dist-info/WHEEL +4 -0
- awslabs_cloudwatch_appsignals_mcp_server-0.1.1.dist-info/entry_points.txt +2 -0
- awslabs_cloudwatch_appsignals_mcp_server-0.1.1.dist-info/licenses/LICENSE +174 -0
- awslabs_cloudwatch_appsignals_mcp_server-0.1.1.dist-info/licenses/NOTICE +2 -0
awslabs/__init__.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
# This file is part of the awslabs namespace.
|
|
16
|
+
# It is intentionally minimal to support PEP 420 namespace packages.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""AWS Application Signals MCP Server."""
|
|
16
|
+
|
|
17
|
+
__version__ = '0.1.0'
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""CloudWatch Application Signals MCP Server - Core server implementation."""
|
|
16
|
+
|
|
17
|
+
import boto3
|
|
18
|
+
import os
|
|
19
|
+
import sys
|
|
20
|
+
from . import __version__
|
|
21
|
+
from botocore.config import Config
|
|
22
|
+
from botocore.exceptions import ClientError
|
|
23
|
+
from datetime import datetime, timedelta, timezone
|
|
24
|
+
from loguru import logger
|
|
25
|
+
from mcp.server.fastmcp import FastMCP
|
|
26
|
+
from pydantic import Field
|
|
27
|
+
from time import perf_counter as timer
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# Initialize FastMCP server
|
|
31
|
+
mcp = FastMCP('cloudwatch-appsignals')
|
|
32
|
+
|
|
33
|
+
# Configure logging
|
|
34
|
+
log_level = os.environ.get('MCP_CLOUDWATCH_APPSIGNALS_LOG_LEVEL', 'INFO').upper()
|
|
35
|
+
logger.remove() # Remove default handler
|
|
36
|
+
logger.add(sys.stderr, level=log_level)
|
|
37
|
+
logger.debug(f'CloudWatch AppSignals MCP Server initialized with log level: {log_level}')
|
|
38
|
+
|
|
39
|
+
# Get AWS region from environment variable or use default
|
|
40
|
+
AWS_REGION = os.environ.get('AWS_REGION', 'us-east-1')
|
|
41
|
+
logger.debug(f'Using AWS region: {AWS_REGION}')
|
|
42
|
+
|
|
43
|
+
# Initialize AWS clients with logging
|
|
44
|
+
try:
|
|
45
|
+
config = Config(user_agent_extra=f'awslabs.cloudwatch-appsignals-mcp-server/{__version__}')
|
|
46
|
+
logs_client = boto3.client('logs', region_name=AWS_REGION, config=config)
|
|
47
|
+
logger.debug('AWS CloudWatch Logs client initialized successfully')
|
|
48
|
+
except Exception as e:
|
|
49
|
+
logger.error(f'Failed to initialize AWS CloudWatch Logs client: {str(e)}')
|
|
50
|
+
raise
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def remove_null_values(data: dict) -> dict:
|
|
54
|
+
"""Remove keys with None values from a dictionary.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
data: Dictionary to clean
|
|
58
|
+
|
|
59
|
+
Returns:
|
|
60
|
+
Dictionary with None values removed
|
|
61
|
+
"""
|
|
62
|
+
return {k: v for k, v in data.items() if v is not None}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@mcp.tool()
|
|
66
|
+
async def list_monitored_services() -> str:
|
|
67
|
+
"""List all services monitored by AWS Application Signals.
|
|
68
|
+
|
|
69
|
+
Use this tool to:
|
|
70
|
+
- Get an overview of all monitored services
|
|
71
|
+
- See service names, types, and key attributes
|
|
72
|
+
- Identify which services are being tracked
|
|
73
|
+
- Count total number of services in your environment
|
|
74
|
+
|
|
75
|
+
Returns a formatted list showing:
|
|
76
|
+
- Service name and type
|
|
77
|
+
- Key attributes (Environment, Platform, etc.)
|
|
78
|
+
- Total count of services
|
|
79
|
+
|
|
80
|
+
This is typically the first tool to use when starting monitoring or investigation.
|
|
81
|
+
"""
|
|
82
|
+
start_time_perf = timer()
|
|
83
|
+
logger.debug('Starting list_application_signals_services request')
|
|
84
|
+
|
|
85
|
+
try:
|
|
86
|
+
appsignals = boto3.client('application-signals', region_name=AWS_REGION)
|
|
87
|
+
logger.debug('Application Signals client created')
|
|
88
|
+
|
|
89
|
+
# Calculate time range (last 24 hours)
|
|
90
|
+
end_time = datetime.now(timezone.utc)
|
|
91
|
+
start_time = end_time - timedelta(hours=24)
|
|
92
|
+
|
|
93
|
+
# Get all services
|
|
94
|
+
logger.debug(f'Querying services for time range: {start_time} to {end_time}')
|
|
95
|
+
response = appsignals.list_services(StartTime=start_time, EndTime=end_time, MaxResults=100)
|
|
96
|
+
services = response.get('ServiceSummaries', [])
|
|
97
|
+
logger.debug(f'Retrieved {len(services)} services from Application Signals')
|
|
98
|
+
|
|
99
|
+
if not services:
|
|
100
|
+
logger.warning('No services found in Application Signals')
|
|
101
|
+
return 'No services found in Application Signals.'
|
|
102
|
+
|
|
103
|
+
result = f'Application Signals Services ({len(services)} total):\n\n'
|
|
104
|
+
|
|
105
|
+
for service in services:
|
|
106
|
+
# Extract service name from KeyAttributes
|
|
107
|
+
key_attrs = service.get('KeyAttributes', {})
|
|
108
|
+
service_name = key_attrs.get('Name', 'Unknown')
|
|
109
|
+
service_type = key_attrs.get('Type', 'Unknown')
|
|
110
|
+
|
|
111
|
+
result += f'• Service: {service_name}\n'
|
|
112
|
+
result += f' Type: {service_type}\n'
|
|
113
|
+
|
|
114
|
+
# Add key attributes
|
|
115
|
+
if key_attrs:
|
|
116
|
+
result += ' Key Attributes:\n'
|
|
117
|
+
for key, value in key_attrs.items():
|
|
118
|
+
result += f' {key}: {value}\n'
|
|
119
|
+
|
|
120
|
+
result += '\n'
|
|
121
|
+
|
|
122
|
+
elapsed_time = timer() - start_time_perf
|
|
123
|
+
logger.debug(f'list_monitored_services completed in {elapsed_time:.3f}s')
|
|
124
|
+
return result
|
|
125
|
+
|
|
126
|
+
except ClientError as e:
|
|
127
|
+
error_code = e.response.get('Error', {}).get('Code', 'Unknown')
|
|
128
|
+
error_message = e.response.get('Error', {}).get('Message', 'Unknown error')
|
|
129
|
+
logger.error(f'AWS ClientError in list_monitored_services: {error_code} - {error_message}')
|
|
130
|
+
return f'AWS Error: {error_message}'
|
|
131
|
+
except Exception as e:
|
|
132
|
+
logger.error(f'Unexpected error in list_monitored_services: {str(e)}', exc_info=True)
|
|
133
|
+
return f'Error: {str(e)}'
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
@mcp.tool()
|
|
137
|
+
async def get_service_detail(
|
|
138
|
+
service_name: str = Field(
|
|
139
|
+
..., description='Name of the service to get details for (case-sensitive)'
|
|
140
|
+
),
|
|
141
|
+
) -> str:
|
|
142
|
+
"""Get detailed information about a specific Application Signals service.
|
|
143
|
+
|
|
144
|
+
Use this tool when you need to:
|
|
145
|
+
- Understand a service's configuration and setup
|
|
146
|
+
- Understand where this servive is deployed and where it is running such as EKS, Lambda, etc.
|
|
147
|
+
- See what metrics are available for a service
|
|
148
|
+
- Find log groups associated with the service
|
|
149
|
+
- Get service metadata and attributes
|
|
150
|
+
|
|
151
|
+
Returns comprehensive details including:
|
|
152
|
+
- Key attributes (Type, Environment, Platform)
|
|
153
|
+
- Available CloudWatch metrics with namespaces
|
|
154
|
+
- Metric dimensions and types
|
|
155
|
+
- Associated log groups for debugging
|
|
156
|
+
|
|
157
|
+
This tool is essential before querying specific metrics, as it shows
|
|
158
|
+
which metrics are available for the service.
|
|
159
|
+
"""
|
|
160
|
+
start_time_perf = timer()
|
|
161
|
+
logger.debug(f'Starting get_service_healthy_detail request for service: {service_name}')
|
|
162
|
+
|
|
163
|
+
try:
|
|
164
|
+
appsignals = boto3.client('application-signals', region_name=AWS_REGION)
|
|
165
|
+
logger.debug('Application Signals client created')
|
|
166
|
+
|
|
167
|
+
# Calculate time range (last 24 hours)
|
|
168
|
+
end_time = datetime.now(timezone.utc)
|
|
169
|
+
start_time = end_time - timedelta(hours=24)
|
|
170
|
+
|
|
171
|
+
# First, get all services to find the one we want
|
|
172
|
+
services_response = appsignals.list_services(
|
|
173
|
+
StartTime=start_time, EndTime=end_time, MaxResults=100
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
# Find the service with matching name
|
|
177
|
+
target_service = None
|
|
178
|
+
for service in services_response.get('ServiceSummaries', []):
|
|
179
|
+
key_attrs = service.get('KeyAttributes', {})
|
|
180
|
+
if key_attrs.get('Name') == service_name:
|
|
181
|
+
target_service = service
|
|
182
|
+
break
|
|
183
|
+
|
|
184
|
+
if not target_service:
|
|
185
|
+
logger.warning(f"Service '{service_name}' not found in Application Signals")
|
|
186
|
+
return f"Service '{service_name}' not found in Application Signals."
|
|
187
|
+
|
|
188
|
+
# Get detailed service information
|
|
189
|
+
logger.debug(f'Getting detailed information for service: {service_name}')
|
|
190
|
+
service_response = appsignals.get_service(
|
|
191
|
+
StartTime=start_time, EndTime=end_time, KeyAttributes=target_service['KeyAttributes']
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
service_details = service_response['Service']
|
|
195
|
+
|
|
196
|
+
# Build detailed response
|
|
197
|
+
result = f'Service Details: {service_name}\n\n'
|
|
198
|
+
|
|
199
|
+
# Key Attributes
|
|
200
|
+
key_attrs = service_details.get('KeyAttributes', {})
|
|
201
|
+
if key_attrs:
|
|
202
|
+
result += 'Key Attributes:\n'
|
|
203
|
+
for key, value in key_attrs.items():
|
|
204
|
+
result += f' {key}: {value}\n'
|
|
205
|
+
result += '\n'
|
|
206
|
+
|
|
207
|
+
# Attribute Maps (Platform, Application, Telemetry info)
|
|
208
|
+
attr_maps = service_details.get('AttributeMaps', [])
|
|
209
|
+
if attr_maps:
|
|
210
|
+
result += 'Additional Attributes:\n'
|
|
211
|
+
for attr_map in attr_maps:
|
|
212
|
+
for key, value in attr_map.items():
|
|
213
|
+
result += f' {key}: {value}\n'
|
|
214
|
+
result += '\n'
|
|
215
|
+
|
|
216
|
+
# Metric References
|
|
217
|
+
metric_refs = service_details.get('MetricReferences', [])
|
|
218
|
+
if metric_refs:
|
|
219
|
+
result += f'Metric References ({len(metric_refs)} total):\n'
|
|
220
|
+
for metric in metric_refs:
|
|
221
|
+
result += f' • {metric.get("Namespace", "")}/{metric.get("MetricName", "")}\n'
|
|
222
|
+
result += f' Type: {metric.get("MetricType", "")}\n'
|
|
223
|
+
dimensions = metric.get('Dimensions', [])
|
|
224
|
+
if dimensions:
|
|
225
|
+
result += ' Dimensions: '
|
|
226
|
+
dim_strs = [f'{d["Name"]}={d["Value"]}' for d in dimensions]
|
|
227
|
+
result += ', '.join(dim_strs) + '\n'
|
|
228
|
+
result += '\n'
|
|
229
|
+
|
|
230
|
+
# Log Group References
|
|
231
|
+
log_refs = service_details.get('LogGroupReferences', [])
|
|
232
|
+
if log_refs:
|
|
233
|
+
result += f'Log Group References ({len(log_refs)} total):\n'
|
|
234
|
+
for log_ref in log_refs:
|
|
235
|
+
log_group = log_ref.get('Identifier', 'Unknown')
|
|
236
|
+
result += f' • {log_group}\n'
|
|
237
|
+
result += '\n'
|
|
238
|
+
|
|
239
|
+
elapsed_time = timer() - start_time_perf
|
|
240
|
+
logger.debug(f"get_service_detail completed for '{service_name}' in {elapsed_time:.3f}s")
|
|
241
|
+
return result
|
|
242
|
+
|
|
243
|
+
except ClientError as e:
|
|
244
|
+
error_code = e.response.get('Error', {}).get('Code', 'Unknown')
|
|
245
|
+
error_message = e.response.get('Error', {}).get('Message', 'Unknown error')
|
|
246
|
+
logger.error(
|
|
247
|
+
f"AWS ClientError in get_service_healthy_detail for '{service_name}': {error_code} - {error_message}"
|
|
248
|
+
)
|
|
249
|
+
return f'AWS Error: {error_message}'
|
|
250
|
+
except Exception as e:
|
|
251
|
+
logger.error(
|
|
252
|
+
f"Unexpected error in get_service_healthy_detail for '{service_name}': {str(e)}",
|
|
253
|
+
exc_info=True,
|
|
254
|
+
)
|
|
255
|
+
return f'Error: {str(e)}'
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
def main():
|
|
259
|
+
"""Run the MCP server."""
|
|
260
|
+
logger.debug('Starting CloudWatch AppSignals MCP server')
|
|
261
|
+
try:
|
|
262
|
+
mcp.run(transport='stdio')
|
|
263
|
+
except KeyboardInterrupt:
|
|
264
|
+
logger.debug('Server shutdown by user')
|
|
265
|
+
except Exception as e:
|
|
266
|
+
logger.error(f'Server error: {e}', exc_info=True)
|
|
267
|
+
raise
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
if __name__ == '__main__':
|
|
271
|
+
main()
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: awslabs.cloudwatch-appsignals-mcp-server
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: An AWS Labs Model Context Protocol (MCP) server for AWS Application Signals
|
|
5
|
+
Project-URL: Homepage, https://awslabs.github.io/mcp/
|
|
6
|
+
Project-URL: Documentation, https://awslabs.github.io/mcp/servers/cloudwatch-appsignals-mcp-server/
|
|
7
|
+
Project-URL: Source, https://github.com/awslabs/mcp.git
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/awslabs/mcp/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/awslabs/mcp/blob/main/src/cloudwatch-appsignals-mcp-server/CHANGELOG.md
|
|
10
|
+
Author: Amazon Web Services
|
|
11
|
+
Author-email: AWSLabs MCP <203918161+awslabs-mcp@users.noreply.github.com>
|
|
12
|
+
License: Apache-2.0
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
License-File: NOTICE
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: boto3>=1.37.24
|
|
25
|
+
Requires-Dist: httpx>=0.24.0
|
|
26
|
+
Requires-Dist: loguru>=0.7.3
|
|
27
|
+
Requires-Dist: mcp[cli]>=1.6.0
|
|
28
|
+
Requires-Dist: pydantic>=2.11.1
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# CloudWatch Application Signals MCP Server
|
|
32
|
+
|
|
33
|
+
An MCP (Model Context Protocol) server that provides tools for monitoring and analyzing AWS services using [AWS Application Signals](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Signals.html).
|
|
34
|
+
|
|
35
|
+
This server enables AI assistants like Claude, GitHub Copilot, and Amazon Q to help you monitor service health, analyze performance metrics, track SLO compliance, and investigate issues using distributed tracing.
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
### Available Tools
|
|
40
|
+
|
|
41
|
+
1. **`list_monitored_services`** - List all services monitored by AWS Application Signals
|
|
42
|
+
- Get an overview of all monitored services
|
|
43
|
+
- See service names, types, and key attributes
|
|
44
|
+
- Identify which services are being tracked
|
|
45
|
+
|
|
46
|
+
2. **`get_service_detail`** - Get detailed information about a specific service
|
|
47
|
+
- Understand service configuration and deployment
|
|
48
|
+
- View available CloudWatch metrics
|
|
49
|
+
- Find associated log groups
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
### Installing via Smithery
|
|
54
|
+
|
|
55
|
+
To install CloudWatch Application Signals MCP Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/awslabs.cloudwatch-appsignals-mcp-server):
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx @smithery/cli install awslabs.cloudwatch-appsignals-mcp-server --client claude
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Installing via Cursor
|
|
62
|
+
|
|
63
|
+
To install CloudWatch Application Signals MCP Server for Cursor automatically:
|
|
64
|
+
|
|
65
|
+
[](https://cursor.com/settings/extensions/install?server=awslabs.cloudwatch-appsignals-mcp-server)
|
|
66
|
+
|
|
67
|
+
### Installing via `uv`
|
|
68
|
+
|
|
69
|
+
When using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will
|
|
70
|
+
use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *awslabs.cloudwatch-appsignals-mcp-server*.
|
|
71
|
+
|
|
72
|
+
### Installing via Claude Desktop
|
|
73
|
+
|
|
74
|
+
On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
|
|
75
|
+
On Windows: `%APPDATA%/Claude/claude_desktop_config.json`
|
|
76
|
+
|
|
77
|
+
<details>
|
|
78
|
+
<summary>Development/Unpublished Servers Configuration</summary>
|
|
79
|
+
When installing a development or unpublished server, add the `--directory` flag:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"mcpServers": {
|
|
84
|
+
"awslabs.cloudwatch-appsignals-mcp-server": {
|
|
85
|
+
"command": "uvx",
|
|
86
|
+
"args": ["--from", "/absolute/path/to/cloudwatch-appsignals-mcp-server", "awslabs.cloudwatch-appsignals-mcp-server"]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
</details>
|
|
92
|
+
|
|
93
|
+
<details>
|
|
94
|
+
<summary>Published Servers Configuration</summary>
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"mcpServers": {
|
|
99
|
+
"awslabs.cloudwatch-appsignals-mcp-server": {
|
|
100
|
+
"command": "uvx",
|
|
101
|
+
"args": ["awslabs.cloudwatch-appsignals-mcp-server"]
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
</details>
|
|
107
|
+
|
|
108
|
+
### Installing for Amazon Q (Preview)
|
|
109
|
+
|
|
110
|
+
- Start Q Developer from [here](https://q.aws/chat).
|
|
111
|
+
- Click on "Manage Connectors" and choose MCP Client.
|
|
112
|
+
- Click "Add New Context Connector," enter a name like "CloudWatch AppSignals," and enter the command in the format: `uvx awslabs.cloudwatch-appsignals-mcp-server`.
|
|
113
|
+
- Verify it shows "Connected" in green under the connector.
|
|
114
|
+
|
|
115
|
+
### Debugging
|
|
116
|
+
|
|
117
|
+
You can use the MCP inspector to debug the server. For `uvx` installations:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npx @modelcontextprotocol/inspector uvx awslabs.cloudwatch-appsignals-mcp-server
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Or if you've installed the package in a specific directory:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
cd /path/to/cloudwatch-appsignals-mcp-server
|
|
127
|
+
npx @modelcontextprotocol/inspector uv run awslabs.cloudwatch-appsignals-mcp-server
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Usage Examples
|
|
131
|
+
|
|
132
|
+
### Example 1: Getting Started with Service Monitoring
|
|
133
|
+
```
|
|
134
|
+
User: "What services are being monitored by Application Signals?"
|
|
135
|
+
Assistant: I'll check what services are currently being monitored by AWS Application Signals.
|
|
136
|
+
|
|
137
|
+
[Uses list_monitored_services tool]
|
|
138
|
+
|
|
139
|
+
I found 3 services being monitored:
|
|
140
|
+
|
|
141
|
+
• Service: api-gateway-service
|
|
142
|
+
Type: AWS::ApiGateway::RestApi
|
|
143
|
+
Key Attributes:
|
|
144
|
+
Name: api-gateway-service
|
|
145
|
+
Type: AWS::ApiGateway::RestApi
|
|
146
|
+
Environment: production
|
|
147
|
+
|
|
148
|
+
• Service: order-service
|
|
149
|
+
Type: AWS::ECS::Service
|
|
150
|
+
Key Attributes:
|
|
151
|
+
Name: order-service
|
|
152
|
+
Type: AWS::ECS::Service
|
|
153
|
+
Environment: production
|
|
154
|
+
Platform: ECS
|
|
155
|
+
|
|
156
|
+
• Service: payment-lambda
|
|
157
|
+
Type: AWS::Lambda::Function
|
|
158
|
+
Key Attributes:
|
|
159
|
+
Name: payment-lambda
|
|
160
|
+
Type: AWS::Lambda::Function
|
|
161
|
+
Environment: production
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Example 2: Investigating Service Details
|
|
165
|
+
```
|
|
166
|
+
User: "Tell me more about the order-service"
|
|
167
|
+
Assistant: I'll get detailed information about the order-service.
|
|
168
|
+
|
|
169
|
+
[Uses get_service_detail tool]
|
|
170
|
+
|
|
171
|
+
Here are the details for order-service:
|
|
172
|
+
|
|
173
|
+
Key Attributes:
|
|
174
|
+
Name: order-service
|
|
175
|
+
Type: AWS::ECS::Service
|
|
176
|
+
Environment: production
|
|
177
|
+
|
|
178
|
+
Additional Attributes:
|
|
179
|
+
Platform: ECS
|
|
180
|
+
Application: ecommerce-app
|
|
181
|
+
Telemetry.SDK: opentelemetry-1.9.0
|
|
182
|
+
|
|
183
|
+
Metric References (15 total):
|
|
184
|
+
• AWS/ApplicationSignals/Latency
|
|
185
|
+
Type: GAUGE
|
|
186
|
+
Dimensions: Service=order-service, Operation=GetOrder
|
|
187
|
+
|
|
188
|
+
• AWS/ApplicationSignals/ErrorRate
|
|
189
|
+
Type: GAUGE
|
|
190
|
+
Dimensions: Service=order-service, Operation=CreateOrder
|
|
191
|
+
|
|
192
|
+
Log Group References (2 total):
|
|
193
|
+
• /aws/ecs/order-service
|
|
194
|
+
• /aws/application-signals/order-service
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Configuration
|
|
198
|
+
|
|
199
|
+
### Required AWS Permissions
|
|
200
|
+
|
|
201
|
+
The server requires the following AWS IAM permissions:
|
|
202
|
+
|
|
203
|
+
```json
|
|
204
|
+
{
|
|
205
|
+
"Version": "2012-10-17",
|
|
206
|
+
"Statement": [
|
|
207
|
+
{
|
|
208
|
+
"Effect": "Allow",
|
|
209
|
+
"Action": [
|
|
210
|
+
"application-signals:ListServices",
|
|
211
|
+
"application-signals:GetService",
|
|
212
|
+
"application-signals:ListServiceLevelObjectives",
|
|
213
|
+
"application-signals:GetServiceLevelObjective",
|
|
214
|
+
"application-signals:BatchGetServiceLevelObjectiveBudgetReport",
|
|
215
|
+
"cloudwatch:GetMetricData",
|
|
216
|
+
"logs:GetQueryResults",
|
|
217
|
+
"logs:StartQuery",
|
|
218
|
+
"logs:StopQuery",
|
|
219
|
+
"xray:GetTraceSummaries",
|
|
220
|
+
"xray:BatchGetTraces"
|
|
221
|
+
],
|
|
222
|
+
"Resource": "*"
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Environment Variables
|
|
229
|
+
|
|
230
|
+
- `AWS_REGION` - AWS region (defaults to us-east-1)
|
|
231
|
+
- `MCP_CLOUDWATCH_APPSIGNALS_LOG_LEVEL` - Logging level (defaults to INFO)
|
|
232
|
+
|
|
233
|
+
### AWS Credentials
|
|
234
|
+
|
|
235
|
+
This server uses the standard AWS credential chain via boto3. It will automatically use credentials from:
|
|
236
|
+
- Environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, etc.)
|
|
237
|
+
- AWS credentials file (`~/.aws/credentials`)
|
|
238
|
+
- AWS config file (`~/.aws/config`)
|
|
239
|
+
- IAM roles (when running on EC2, ECS, Lambda, etc.)
|
|
240
|
+
- And other standard AWS credential providers
|
|
241
|
+
|
|
242
|
+
No additional credential configuration is needed beyond your standard AWS setup.
|
|
243
|
+
|
|
244
|
+
## Development
|
|
245
|
+
|
|
246
|
+
This server is part of the AWS Labs MCP collection. For development and contribution guidelines, please see the main repository documentation.
|
|
247
|
+
|
|
248
|
+
## License
|
|
249
|
+
|
|
250
|
+
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
awslabs/__init__.py,sha256=WuqxdDgUZylWNmVoPKiK7qGsTB_G4UmuXIrJ-VBwDew,731
|
|
2
|
+
awslabs/cloudwatch_appsignals_mcp_server/__init__.py,sha256=UDBzXsnaAPF0tJrYn7iFk3Kxcnpri-58PAoEZYjrNNE,681
|
|
3
|
+
awslabs/cloudwatch_appsignals_mcp_server/server.py,sha256=QsNhMYIEnSuP1rW6Czhx6GHwVRc6w-QIoBNHUggpBIc,10383
|
|
4
|
+
awslabs_cloudwatch_appsignals_mcp_server-0.1.1.dist-info/METADATA,sha256=Aom2dgzauVXBfLxlBDhATy8FF3J--i-l1c9saNdew3I,8069
|
|
5
|
+
awslabs_cloudwatch_appsignals_mcp_server-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
6
|
+
awslabs_cloudwatch_appsignals_mcp_server-0.1.1.dist-info/entry_points.txt,sha256=iGwIMLU6AsBawl2Fhqi9GoeWdMGIVtg86-McaaNQqAQ,114
|
|
7
|
+
awslabs_cloudwatch_appsignals_mcp_server-0.1.1.dist-info/licenses/LICENSE,sha256=zE1N4JILDTkSIDtdmqdnKKxKEQh_VdqeoAV2230eNOI,10141
|
|
8
|
+
awslabs_cloudwatch_appsignals_mcp_server-0.1.1.dist-info/licenses/NOTICE,sha256=Pfbul2Ga0IJU2RMZFHC8QwDvNk72WO2XMn9l3390VYs,108
|
|
9
|
+
awslabs_cloudwatch_appsignals_mcp_server-0.1.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|