@amazon-devices/amazon-devices-buildertools-mcp 0.1.23

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.
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2025 Amazon.com, Inc. or its affiliates. All rights reserved.
2
+
3
+ These materials are licensed as "Program Materials" under the Program Materials License Agreement (the "Agreement"). The Agreement is available at https://developer.amazon.com/support/legal/pml. See the Agreement for the specific terms and conditions of the Agreement. Capitalized terms not defined in this file have the meanings given to them in the Agreement.
4
+
5
+ If you do not agree to the above terms and conditions, you may not use any file in this package.
6
+
7
+ YOUR USE OF THE PROGRAM MATERIALS IN OR ASSOCIATED WITH THIS PACKAGE IS AT YOUR SOLE RISK. IN NO EVENT WILL AMAZON BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, CONSEQUENTIAL, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES (INCLUDING FOR ANY LOSS OF GOODWILL, BUSINESS INTERRUPTION, LOST PROFITS OR DATA, OR COMPUTER FAILURE OR MALFUNCTION) ARISING FROM OR RELATING TO SUCH PROGRAM MATERIALS, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, EVEN IF AMAZON HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS AND DISCLAIMERS APPLY EXCEPT TO THE EXTENT PROHIBITED BY APPLICABLE LAW.
package/README.md ADDED
@@ -0,0 +1,277 @@
1
+ # Amazon Devices Builder Tools MCP Server
2
+
3
+ A Model Context Protocol (MCP) server that provides context and tools for AI agents to develop and debug apps for Amazon's [Vega OS](https://developer.amazon.com/apps-and-games/vega).
4
+
5
+ ## Migration Notice
6
+
7
+ > **Important**: This MCP server has been renamed from `@amazon-devices/vega-devtools-mcp` to `@amazon-devices/amazon-devices-buildertools-mcp`. If you have the previous version installed, please update the mcp config to remove `@amazon-devices/vega-devtools-mcp` and use `@amazon-devices/amazon-devices-buildertools-mcp` server to receive the latest updates and features.
8
+
9
+ ## Features
10
+
11
+ The Amazon Devices Builder Tools MCP is designed to help with:
12
+
13
+ 1. **Development Guidance**: Access comprehensive documentation about Vega app development patterns, best practices, and architecture
14
+ 2. **Performance Analysis**: Analyze trace files to identify performance bottlenecks and optimize app launch times
15
+ 3. **Debugging**: Get detailed information about CLI commands, configuration, and troubleshooting
16
+ 4. **Project Setup**: Learn about project structure, dependencies, and template usage
17
+ 5. **Feature Implementation**: Find guidance on implementing specific features like navigation, focus management, media playback, and authentication
18
+
19
+ ## One-Click Installation
20
+
21
+ Some of the popular AI Agents support installing MCP servers with a single click. Below are the one-click install options available.
22
+
23
+ ### Install MCP on Kiro
24
+
25
+ [![Add to Kiro](https://kiro.dev/images/add-to-kiro.svg)](https://kiro.dev/launch/mcp/add?name=amazon-devices-buildertools-mcp&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40amazon-devices%2Famazon-devices-buildertools-mcp%40latest%22%5D%2C%22disabled%22%3Afalse%7D)
26
+
27
+ ### Install MCP on Cursor
28
+
29
+ [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=amazon-devices-buildertools-mcp&config=eyJjb21tYW5kIjoibnB4IC15IEBhbWF6b24tZGV2aWNlcy9hbWF6b24tZGV2aWNlcy1idWlsZGVydG9vbHMtbWNwQGxhdGVzdCJ9)
30
+
31
+ ### Install MCP on VSCode
32
+
33
+ [Add to VSCode](vscode:mcp/install?%7B%22name%22%3A%22amazon-devices-buildertools-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40amazon-devices%2Famazon-devices-buildertools-mcp%40latest%22%5D%7D)
34
+
35
+
36
+ ## Installation with script
37
+
38
+ Run the following command to **automatically** install Amazon Devices Builder Tools MCP in your AI Agent and add Vega-specific context document to your project to guide AI agents:
39
+
40
+ > ℹ️ Important: It is important to run `npx -y @amazon-devices/amazon-devices-buildertools-mcp@latest --init-context` to install the Vega-context document for your preferred AI agent in the project directory. This step is required even after one-click install of mcp.
41
+
42
+ ```bash
43
+ npx -y @amazon-devices/amazon-devices-buildertools-mcp@latest --init-context
44
+ ```
45
+
46
+ This interactive command will:
47
+
48
+ 1. **Display available AI agents** and their context file requirements
49
+ 2. **Let you select your preferred AI agent** from the supported list
50
+ 3. **Update selected agent's MCP settings** to configure the Amazon Devices Builder Tools MCP server
51
+ 4. **Ask for context installation directory** (defaults to current working directory)
52
+ 5. **Handle existing context files** by offering to merge or update content
53
+ 6. **Create the appropriate context file** in the correct location for your chosen AI agent
54
+
55
+ ### Example Usage
56
+
57
+ ```bash
58
+ # Navigate to your project directory
59
+ cd my-vega-project
60
+
61
+ # Initialize context for your AI agent
62
+ npx -y @amazon-devices/amazon-devices-buildertools-mcp@latest --init-context
63
+
64
+ # Follow the interactive prompts:
65
+ # 1. Select your AI agent (e.g., "5" for Kiro, "7" for Other/Custom)
66
+ # 2. Enter y/n to automatically update Agent's MCP settings file
67
+ # 3. Choose default context document installation path or enter custom path
68
+ # 4. Choose action: merge, update or save file. Review the installed context document before proceeding.
69
+ ```
70
+
71
+ ### Using with Other AI Agents
72
+
73
+ If your AI agent isn't in the supported list, select **"Other/Custom Agent"** which provides:
74
+
75
+ - **View full content**: Display the complete context for manual copying
76
+ - **Manual setup**: Copy the content to your agent's configuration directory
77
+
78
+ > ℹ️ Important: Start the MCP Server from Agent's MCP config, if not already started - check your current running MCPs to ensure the amazon-devices-buildertools-mcp is listed as running/connected.
79
+
80
+ ## Configure Amazon Devices Builder Tools MCP manually
81
+
82
+ To manually configure the Amazon Devices Builder Tools MCP, add the MCP configuration in your AI Agent's MCP settings:
83
+
84
+ ```json
85
+ "amazon-devices-buildertools-mcp": {
86
+ "command": "npx",
87
+ "args": ["-y", "@amazon-devices/amazon-devices-buildertools-mcp@latest"],
88
+ "type": "stdio"
89
+ }
90
+ ```
91
+
92
+ Each Agent has slightly different instructions, but many involve using an "mcp.json" (or similar) file where you can add the specific configuration for this new MCP server.
93
+
94
+ Below we list some popular AI agents and the link to how to install MCP servers.
95
+
96
+ | # | AI Agent | MCP Setup Instructions Link |
97
+ | --- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
98
+ | 1 | Cursor | [Instructions](https://cursor.com/docs/context/mcp#using-mcpjson) |
99
+ | 2 | Github Copilot | [Instructions](https://docs.github.com/en/copilot/how-tos/provide-context/use-mcp/extend-copilot-chat-with-mcp) then choose "Configuring MCP Servers Manually" |
100
+ | 3 | Claude Code CLI | [Instructions](https://code.claude.com/docs/en/mcp#option-3%3A-add-a-local-stdio-server) |
101
+ | 4 | Amazon Q IDE Extension | [Instructions](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/mcp-ide.html) |
102
+ | 5 | Amazon Q CLI | [Instructions](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-mcp-config-CLI.html) |
103
+ | 6 | Kiro | [Instructions](https://kiro.dev/docs/mcp/) |
104
+ | 7 | Cline | [Instructions](https://docs.cline.bot/mcp/configuring-mcp-servers) |
105
+
106
+ _If your agent is not listed, please ensure it supports MCP before continuing._
107
+
108
+ > ℹ️ Important: Once configured, run `npx -y @amazon-devices/amazon-devices-buildertools-mcp@latest --init-context` to install the Vega-context document for your preferred AI agent in the project directory
109
+
110
+ ## Usage
111
+
112
+ ### Command Line Options
113
+
114
+ ```bash
115
+ npx -y @amazon-devices/amazon-devices-buildertools-mcp@latest --init-context # Install Amazon Devices Builder Tools MCP and initialize Vega context for AI agents
116
+ npx -y @amazon-devices/amazon-devices-buildertools-mcp@latest --version # Show version information
117
+ npx -y @amazon-devices/amazon-devices-buildertools-mcp@latest -v # Show version information (alias)
118
+ npx -y @amazon-devices/amazon-devices-buildertools-mcp@latest --help # Show help message
119
+ npx -y @amazon-devices/amazon-devices-buildertools-mcp@latest -h # Show help message (alias)
120
+ ```
121
+
122
+ ### Verify Amazon Devices Builder Tools MCP is installed in your AI Agent
123
+
124
+ In your AI Agent's chat interface, run the following prompt
125
+
126
+ ```
127
+ List the tools provided by Amazon Devices Builder Tools MCP
128
+ ```
129
+
130
+ You should see a response that includes the following tools:
131
+
132
+ - analyze_perfetto_traces
133
+ - read_document
134
+ - list_documents
135
+
136
+ ## MCP Tools
137
+
138
+ The Amazon Devices Builder Tools MCP provides the following tools to assist with Vega app development:
139
+
140
+ ### 1. `read_document`
141
+
142
+ Read documents related to App development for Amazon Vega OS. This tool provides access to comprehensive documentation about Vega app development and debugging topics.
143
+
144
+ **Parameters:**
145
+ - `document_name` (required): Name of the document to read (e.g., `react-native-for-vega-performance-best-practices.md`). Must be a markdown document with `.md` extension.
146
+
147
+ **Example usage:**
148
+ ```
149
+ Read the document react-native-for-vega-performance-best-practices.md
150
+ ```
151
+
152
+ ### 2. `list_documents`
153
+
154
+ List all available Vega documents related to App development for Amazon Vega OS. Returns name and description of available documents that can be retrieved using the `read_document` tool.
155
+
156
+ **Parameters:**
157
+ - `documentType` (optional): Filter documents by type. Valid values: `KB` (Knowledge Base), `PROMPT`, `STEERING`, `WORKFLOW`
158
+
159
+ **Example usage:**
160
+ ```
161
+ List all available Vega documents
162
+ ```
163
+ or
164
+ ```
165
+ List documents of type KB
166
+ ```
167
+
168
+ ### 3. `analyze_perfetto_traces`
169
+
170
+ Analyze Vega platform traces using Perfetto trace processor to extract KPI metrics and related performance data. This tool helps diagnose performance issues and analyze app launch times.
171
+
172
+ **Parameters:**
173
+ - `traceFilePath` (required): Path to the trace file to analyze. Usually found in Vega performance data output directories with names like `iter_*_vs_trace`
174
+ - `queryType` (optional): Type of query to execute. Default: `kpi_analysis`
175
+ - `kpiType` (optional): Specific KPI type to analyze. Options: `ttff` (Time to First Frame), `ttfd` (Time to First Display), `all`. Default: `all`
176
+ - `customQuery` (optional): Custom PerfettoSQL query to execute (overrides queryType and kpiType if provided)
177
+ - `processNames` (optional): Additional process names to filter by
178
+ - `appProcessName` (optional): Main application process name to analyze (will be auto-detected if not provided)
179
+
180
+ **Example usage:**
181
+ ```
182
+ Analyze the trace file at /path/to/iter_1_vs_trace
183
+ ```
184
+
185
+ ### 4. `get_app_hot_functions`
186
+
187
+ Reads and analyzes CPU trace files to identify hot functions (CPU-intensive operations) contributing to performance bottlenecks. This tool helps pinpoint which functions in your application are consuming the most CPU time, enabling targeted performance optimization.
188
+
189
+ **Parameters:**
190
+ - `traceDataFilePath` (required): Path to the trace data file from the Activity Monitor. Usually found in Vega performance data output directories with names like `iter_<iteration>_trace<epoch>-converted.json` (e.g., `iter_2_trace1766067380670018106-converted.json`)
191
+ - `limit` (optional): Maximum number of hot functions to return (default: 10)
192
+ - `useSelfTime` (optional): Flag to indicate whether to use self CPU time or total CPU time for sorting (default: false)
193
+ - `includeLibraryFunctions` (optional): Flag to indicate whether to include library functions (default: false)
194
+ - `startTimeOffset` (optional): Start time offset in seconds from trace beginning (e.g., 5.2 for analysis starting 5.2 seconds after trace start)
195
+ - `endOffsetSeconds` (optional): End time offset in seconds from trace beginning (e.g., 15.8 for analysis ending 15.8 seconds after trace start)
196
+
197
+ **Example usage:**
198
+ ```
199
+ Analyze hot functions in the trace file at /path/to/iter_2_trace1766067380670018106-converted.json
200
+ ```
201
+
202
+ or with time window filtering:
203
+ ```
204
+ Analyze hot functions in /path/to/trace.json from 5 to 15 seconds with a limit of 20 functions
205
+ ```
206
+
207
+ ## MCP Prompts
208
+
209
+ > Check if your AI Agents supports MCP Prompts (`/prompts`) in https://modelcontextprotocol.io/clients
210
+
211
+ Amazon Devices Builder Tools MCP provides the following pre-defined prompt templates for common workflows that can be 1-click executed in `/prompts` in your AI Agent:
212
+
213
+ **Important**: Always run `/prompts` in your AI Agent to see the full list of prompts provided by Amazon Devices Builder Tools MCP
214
+
215
+ ### 1. `diagnose_kpi_ttff`
216
+
217
+ **Description:** Diagnose Vega application's Time to First Frame (TTFF) KPI
218
+
219
+ **Parameters:**
220
+ - `kpi_report_file_path` (required, string): Absolute path to the KPI report file
221
+ - `kpi_to_diagnose` (required, string): Name of the KPI from KPI report to diagnose
222
+
223
+ **Example usage:**
224
+ ```
225
+ > @diagnose_kpi_ttff /path/to/report.json ttff
226
+ ```
227
+
228
+ ### 2. `diagnose_kpi_ttfd`
229
+
230
+ **Description:** Diagnose Vega application's Time to Fully Drawn (TTFD) KPI
231
+
232
+ **Parameters:**
233
+ - `kpi_report_file_path` (required, string): Absolute path to the KPI report file
234
+ - `kpi_to_diagnose` (required, string): Name of the KPI from KPI report to diagnose
235
+
236
+ **Example usage:**
237
+ ```
238
+ > @diagnose_kpi_ttfd /path/to/report.json ttfd
239
+ ```
240
+
241
+ ### 3. `apply_performance_best_practices`
242
+
243
+ **Description:** Diagnose and optimize React Native application performance issues including component rendering, memory management, navigation, network optimization, and state management.
244
+
245
+ **Parameters:**
246
+ - `app_source_path` (required, string): Path to the React Native application source code directory for analysis
247
+
248
+ **Example usage:**
249
+ ```
250
+ > @apply_performance_best_practices /path/to/my-vega-app/src
251
+ ```
252
+
253
+ ### 4. `detect_component_re-renders`
254
+
255
+ **Description:** Diagnose and optimize Vega application UI fluidity performance issues caused by component re-rendering using React Native tools.
256
+
257
+ **Parameters:**
258
+ - `vega_app_package_path` (required, string): Absolute path to the Vega app package root directory
259
+
260
+ **Example usage:**
261
+ ```
262
+ > @detect_component_re-renders /path/to/my-vega-app
263
+ ```
264
+
265
+ ### 5. `upgrade_carousel_component`
266
+
267
+ **Description:** Assists in migrating to newer versions of the Carousel component in the Vega SDK.
268
+
269
+ **Parameters:**
270
+ - `current_implementation_file_path` (required, string): Absolute path to the file containing the V1 implementation of Carousel
271
+ - `current_version` (required, string): The current version of Carousel, independent of package
272
+ - `target_version` (required, string): The target version of Carousel, independent of package
273
+
274
+ **Example usage:**
275
+ ```
276
+ > @upgrade_carousel_component /path/to/HomeScreen.tsx 1.0.6 2.0.0
277
+ ```