ta-studio-mcp 1.0.3 → 1.0.4

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.
Files changed (3) hide show
  1. package/README.md +71 -103
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,39 +1,59 @@
1
- # ta-studio-mcp
1
+ # ta-studio-mcp 🚀
2
2
 
3
- **Domain knowledge MCP server for AI agents working on mobile test automation.**
3
+ **The definitive domain knowledge layer for AI agents building mobile test automation at TA Studio.**
4
4
 
5
- One command gives your agent structured knowledge about OAVR navigation patterns, SoM screenshot annotation, coordinate scaling fixes, agent configuration, and 9+ documented bug fixes so it builds on proven solutions instead of rediscovering them.
5
+ AI agents often struggle with project-specific context, unique navigation patterns, and "tribal knowledge" about past bugs. `ta-studio-mcp` solves this by giving your agent (Claude, Cursor, Windsurf) structured, programmatic access to the team's methodologies, codebase maps, and verified bug fixes.
6
6
 
7
- ## Quick Start
7
+ ---
8
+
9
+ ## 📋 Prerequisites
10
+
11
+ - **Node.js**: `v18.0.0` or higher.
12
+ - **MCP Client**: An IDE or tool that supports the [Model Context Protocol](https://modelcontextprotocol.io) (e.g., Claude Desktop, Cursor, Windsurf, or VS Code with an MCP extension).
13
+
14
+ ---
15
+
16
+ ## ⚡ Quick Start
17
+
18
+ You don't even need to install it locally to test it. Run the following command to see the server in action:
8
19
 
9
20
  ```bash
10
21
  npx ta-studio-mcp
11
22
  ```
23
+ *(This will start the server in stdio mode, waiting for a client to connect.)*
24
+
25
+ ---
12
26
 
13
- ## What's Inside
27
+ ## 🛠 What's Inside?
14
28
 
15
- | Tool | What It Returns |
16
- |------|----------------|
17
- | `getMethodology` | 10+ topics: OAVR pattern, SoM annotation, coordinate scaling, agent config, vision click, mobile MCP, flicker detection, closed loop, device auto-select |
18
- | `getKnownIssues` | 9 documented bugs with symptoms, root causes, fixes, file paths, and commit SHAs |
19
- | `getCodebaseMap` | Full codebase structure — backend, frontend, agents, scripts, integrations, config |
20
- | `getWorkflow` | 7 step-by-step workflows: bug_fix, navigation_test, bbox_verify, agent_debug, feature, figma_analysis, flicker_test |
21
- | `getQuickCommands` | All dev commands for backend, frontend, E2E, device, and git |
22
- | `getConventions` | Code style guidelines, patterns, and 7 critical rules |
23
- | `getAgentConfig` | Agent configuration reference — models, parallel_tool_calls, reasoning, streaming |
29
+ Once connected, your agent gains access to these primary tools:
24
30
 
25
- ## Installation
31
+ | Tool | Purpose | Beginner Tip |
32
+ |------|---------|---------------|
33
+ | `getMethodology` | Deep dives into OAVR, SoM, Coordinate Scaling, and more. | Ask: *"How does the team handle screen navigation?"* |
34
+ | `getKnownIssues` | A database of 9+ verified bug fixes with root causes. | Ask: *"Are there any known issues with bounding boxes?"* |
35
+ | `getCodebaseMap` | Explains the purpose of every directory and key file. | Ask: *"Where is the device simulation logic located?"* |
36
+ | `getWorkflow` | Step-by-step guides for common tasks (testing, debugging). | Ask: *"Help me run a navigation test from scratch."* |
37
+ | `getConventions` | 7 critical rules and coding style guidelines. | Ask: *"What are the critical rules for backend development?"* |
38
+ | `getAgentConfig` | Reference for model types, reasoning levels, and streaming. | Ask: *"What model should the coordinator agent use?"* |
26
39
 
27
- ### Claude Code
40
+ ---
28
41
 
42
+ ## 📦 Installation Guide
43
+
44
+ ### [Claude Desktop](https://claude.ai/download)
45
+ Run this in your terminal to automatically add the server:
29
46
  ```bash
30
47
  claude mcp add ta-studio -- npx -y ta-studio-mcp
31
48
  ```
32
49
 
33
- ### Cursor
34
-
35
- Add to `.cursor/mcp.json`:
50
+ ### [Cursor](https://cursor.com)
51
+ 1. Open **Settings** -> **Features** -> **MCP**.
52
+ 2. Click **+ Add New MCP Server**.
53
+ 3. Name: `ta-studio` | Type: `command` | Command: `npx -y ta-studio-mcp`
36
54
 
55
+ ### [Windsurf](https://codeium.com/windsurf)
56
+ Add the following to your `~/.codeium/windsurf/mcp_config.json`:
37
57
  ```json
38
58
  {
39
59
  "mcpServers": {
@@ -45,96 +65,44 @@ Add to `.cursor/mcp.json`:
45
65
  }
46
66
  ```
47
67
 
48
- ### Windsurf
68
+ ---
49
69
 
50
- Add to `~/.codeium/windsurf/mcp_config.json`:
70
+ ## 🧠 Key Knowledge & Expert Implementation
51
71
 
52
- ```json
53
- {
54
- "mcpServers": {
55
- "ta-studio": {
56
- "command": "npx",
57
- "args": ["-y", "ta-studio-mcp"]
58
- }
59
- }
60
- }
61
- ```
72
+ ### 1. Coordinate Scaling (The common "Bbox Bug")
73
+ **The Problem**: Mobile screenshots are compressed to ~45% resolution (486×1080), but XML elements use native coordinates (1080×2400).
74
+ **The Fix**:
75
+ 1. Get native size via `adb shell wm size`.
76
+ 2. Parse with regex: `re.search(r'(\d+)\s*x\s*(\d+)', ...)`.
77
+ 3. Apply scale factors: `native_x * (screenshot_width / native_width)`.
62
78
 
63
- ### VS Code (Copilot / Continue / Augment)
79
+ ### 2. Set-of-Mark (SoM) Annotation
80
+ We use a high-performance labeling system:
81
+ - **PIL Threading**: Heavy drawing is offloaded to `asyncio.to_thread` to prevent IDE lag.
82
+ - **TOON Format**: We strip redundant XML metadata (package names, etc.) to reduce LLM token usage by **40%**.
83
+ - **Priority matching**: `radiobutton` is matched before `button` to avoid class collisions.
64
84
 
65
- Add to `.vscode/settings.json`:
85
+ ### 3. Flicker Detection (4-Layer Pipeline)
86
+ How we catch 16ms UI glitches:
87
+ 1. **Trigger**: High-speed `adb screenrecord`.
88
+ 2. **Extraction**: `ffmpeg` scene filtering (`gt(scene,0.003)`).
89
+ 3. **Analysis**: SSIM similarity checks between frames.
90
+ 4. **Verification**: GPT-5.2 Vision confirms the glitch.
66
91
 
67
- ```json
68
- {
69
- "mcp": {
70
- "servers": {
71
- "ta-studio": {
72
- "command": "npx",
73
- "args": ["-y", "ta-studio-mcp"]
74
- }
75
- }
76
- }
77
- }
78
- ```
79
-
80
- ## Example Usage
81
-
82
- Ask your AI agent:
83
-
84
- - *"How does the OAVR pattern work?"* → Agent calls `getMethodology({ topic: "oavr" })`
85
- - *"What's the bounding box coordinate bug?"* → Agent calls `getKnownIssues({ category: "bbox_alignment" })`
86
- - *"How do I debug a navigation test?"* → Agent calls `getWorkflow({ name: "agent_debug" })`
87
- - *"What model does the coordinator use?"* → Agent calls `getAgentConfig()`
88
-
89
- ## Key Knowledge Areas
90
-
91
- ### Coordinate Scaling (Critical Fix)
92
-
93
- Mobile MCP screenshots are JPEG-compressed at ~45% of native resolution (486×1080 vs 1080×2400), but element coordinates from `list_elements_on_screen` are in native space. The fix involves parsing the native resolution and applying scale factors:
94
-
95
- - **Regex**: `re.search(r'(\d+)\s*x\s*(\d+)', get_screen_size())`
96
- - **Scaling**: `target_x = raw_x * (img_width / screen_width)`
97
-
98
- ### Set-of-Mark (SoM) Annotation
99
-
100
- The server provides methodology for high-performance screenshot tagging:
101
- - **PIL Threading**: Uses `asyncio.to_thread` for CPU-intensive drawing to keep the event loop responsive.
102
- - **TOON Format**: Token Optimized Object Notation strips 40% of redundant metadata from screen hierarchies before LLM processing.
103
- - **Priority Logic**: Class matching for `radiobutton` is prioritized over `button` to prevent classification collisions.
92
+ ---
104
93
 
105
- ### Flicker Detection (4-Layer)
106
-
107
- 1. **Trigger**: `adb shell screenrecord`
108
- 2. **Extraction**: `ffmpeg -vf "select='gt(scene,0.003)'"`
109
- 3. **Analysis**: SSIM (Structural Similarity Index) pairs
110
- 4. **LLM**: GPT-5.2 Vision verification
111
-
112
- ### Agent Configuration
113
-
114
- | Agent | Model | parallel_tool_calls | Reasoning | Why? |
115
- |-------|-------|-------------------|-----------|------|
116
- | Coordinator | gpt-5.2 | `true` | high | Orchestration tasks can run in parallel. |
117
- | Device Testing | gpt-5-mini | `false` | medium | Navigation is sequential; parallel calls cause session race conditions. |
118
-
119
-
120
- ## Tech Stack
121
-
122
- - **Runtime**: Node.js ≥ 18
123
- - **Protocol**: Model Context Protocol (MCP) via `@modelcontextprotocol/sdk`
124
- - **Transport**: stdio (local process)
125
- - **Schema**: Zod validation
126
-
127
- ## Development
128
-
129
- ```bash
130
- cd packages/ta-studio-mcp
131
- npm install
132
- npm run build # Compile TypeScript
133
- npm run dev # Watch mode
134
- npm start # Run server
135
- ```
94
+ ## 👩‍💻 For Developers: Contributing Knowledge
136
95
 
137
- ## License
96
+ If you find a new bug or develop a new pattern, update the local knowledge base:
138
97
 
139
- MIT see [LICENSE](./LICENSE)
98
+ 1. **Add a methodology topic**: Edit `src/knowledge/methodology.ts`.
99
+ 2. **Log a bug**: Add to `src/knowledge/known-issues.ts` with the symptom and fix.
100
+ 3. **Build & Test**:
101
+ ```bash
102
+ npm run build
103
+ # Test locally with a tool like mcp-inspector
104
+ npx @modelcontextprotocol/inspector dist/index.js
105
+ ```
140
106
 
107
+ ## 📜 License
108
+ MIT © 2026 TA Studios. Build on it. Improve it. 🚀
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
14
14
  import { registerAllTools } from './tools/register-all.js';
15
15
  const server = new McpServer({
16
16
  name: 'ta-studio-mcp',
17
- version: '1.0.3',
17
+ version: '1.0.4',
18
18
  }, {
19
19
  capabilities: {
20
20
  logging: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ta-studio-mcp",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "TA Studio MCP — Domain knowledge, patterns, bug fixes, and workflows for AI agents working on the TA Studio mobile test automation platform.",
5
5
  "type": "module",
6
6
  "bin": {