@browserstack/mcp-server 2.2.0 → 2.2.1-beta.1

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 (31) hide show
  1. package/capability/tm.capability-index.json +2 -1
  2. package/capability/tra.capability-index.json +31709 -0
  3. package/dist/lib/apiClient.d.ts +2 -1
  4. package/dist/lib/apiClient.js +8 -1
  5. package/dist/lib/central-oauth.d.ts +133 -0
  6. package/dist/lib/central-oauth.js +246 -0
  7. package/dist/tools/ask-browserstack/central-oauth.d.ts +25 -46
  8. package/dist/tools/ask-browserstack/central-oauth.js +55 -177
  9. package/dist/tools/capability-registry/bind.js +43 -7
  10. package/dist/tools/capability-registry/discovery.js +3 -1
  11. package/dist/tools/capability-registry/egress.d.ts +12 -5
  12. package/dist/tools/capability-registry/egress.js +24 -1
  13. package/dist/tools/capability-registry/oauth.d.ts +63 -0
  14. package/dist/tools/capability-registry/oauth.js +176 -0
  15. package/dist/tools/capability-registry/register.js +289 -41
  16. package/dist/tools/capability-registry/resolve.d.ts +1 -1
  17. package/dist/tools/capability-registry/resolve.js +24 -3
  18. package/dist/tools/capability-registry/routing-token.d.ts +25 -0
  19. package/dist/tools/capability-registry/routing-token.js +87 -0
  20. package/dist/tools/capability-registry/search.d.ts +28 -1
  21. package/dist/tools/capability-registry/search.js +202 -4
  22. package/dist/tools/capability-registry/types.d.ts +42 -3
  23. package/dist/tools/failurelogs-utils/app-automate.js +4 -1
  24. package/dist/tools/failurelogs-utils/automate.js +5 -2
  25. package/dist/tools/failurelogs-utils/utils.d.ts +1 -0
  26. package/dist/tools/failurelogs-utils/utils.js +7 -0
  27. package/dist/tools/testmanagement-utils/TCG-utils/helpers.js +1 -1
  28. package/dist/tools/testmanagement.js +5 -5
  29. package/dist/tools/tool-handoff.d.ts +15 -12
  30. package/dist/tools/tool-handoff.js +21 -18
  31. package/package.json +2 -1
@@ -8,7 +8,10 @@
8
8
  * where the missing identifier comes from.
9
9
  *
10
10
  * Point at a sibling tool whenever one can produce the id — it is faster and more
11
- * predictable than an agent. Point at `askBrowserStackAI` only when NO tool here can.
11
+ * predictable than anything that has to reason its way there. When no tool here can, point
12
+ * at the CAPABILITY FUNCTIONS: they reach the product's own API surface, so they answer the
13
+ * id question directly. Name them as a group, never individually — which function to call
14
+ * is their own business, and a name written here goes stale the moment one is renamed.
12
15
  *
13
16
  * The one that matters most: 15 of the 17 Test Management tools require a project
14
17
  * identifier and NONE of them accepts its absence, yet no tool in this server lists
@@ -35,21 +38,21 @@ export declare const NEEDS_TEST_PLAN_ID: string;
35
38
  /**
36
39
  * The ONLY capability handoff here: every other constant points at a tool that produces a
37
40
  * missing *id*, but plan WRITES have no tool at all — the surface is `listTestPlans`,
38
- * `getTestPlan`, `listSubTestPlans`, `getSubTestPlan` and nothing else. Atlas can do them
39
- * (the tm harness allows POST /api/v1/projects/{id}/test-plans plus /update, /delete,
40
- * /clone, /test-runs and /test-runs/unlink), so without this line the model reads the four
41
- * read tools, finds no create, and reports the capability as absent — which is exactly what
42
- * a QA eval concluded.
41
+ * `getTestPlan`, `listSubTestPlans`, `getSubTestPlan` and nothing else. The capability functions can do them
42
+ * (Test Management's own API covers creating, updating, cloning and deleting a plan, and
43
+ * linking or unlinking its runs), so without this line the model reads the four read tools,
44
+ * finds no create, and reports the capability as absent — which is exactly what a QA eval
45
+ * concluded.
43
46
  *
44
47
  * Deliberately narrow: it names the specific operations that are missing rather than
45
- * inviting the model to route plan work to the agent generally, because the tool
46
- * descriptions otherwise say to prefer a specific tool whenever one fits.
48
+ * inviting the model to route plan work elsewhere generally, because the tool descriptions
49
+ * otherwise say to prefer a specific tool whenever one fits.
47
50
  *
48
- * Caveat worth knowing: askBrowserStackAI pins every write to human approval, so this path
49
- * only completes on a client that can show a prompt. On one that cannot, the intended write
50
- * comes back in `needs_approval` instead of happening.
51
+ * Caveat worth knowing: a capability write is pinned to human approval, so this path only
52
+ * completes on a client that can show a prompt. On one that cannot, the intended write is
53
+ * refused rather than performed.
51
54
  */
52
- export declare const PLAN_WRITES_VIA_AGENT: string;
55
+ export declare const PLAN_WRITES_VIA_CAPABILITIES: string;
53
56
  /** A build id comes from either build-lookup tool. */
54
57
  export declare const NEEDS_BUILD_ID: string;
55
58
  /**
@@ -8,7 +8,10 @@
8
8
  * where the missing identifier comes from.
9
9
  *
10
10
  * Point at a sibling tool whenever one can produce the id — it is faster and more
11
- * predictable than an agent. Point at `askBrowserStackAI` only when NO tool here can.
11
+ * predictable than anything that has to reason its way there. When no tool here can, point
12
+ * at the CAPABILITY FUNCTIONS: they reach the product's own API surface, so they answer the
13
+ * id question directly. Name them as a group, never individually — which function to call
14
+ * is their own business, and a name written here goes stale the moment one is renamed.
12
15
  *
13
16
  * The one that matters most: 15 of the 17 Test Management tools require a project
14
17
  * identifier and NONE of them accepts its absence, yet no tool in this server lists
@@ -21,8 +24,8 @@
21
24
  */
22
25
  /** No tool lists projects, so this genuinely has to go to the agent. */
23
26
  export const NEEDS_PROJECT_ID = " Requires a project identifier (PR-*). No tool here lists projects, so if you do not " +
24
- 'have one, call askBrowserStackAI with product "tm" and ask which projects exist, then ' +
25
- "retry this tool with the identifier it returns.";
27
+ "have one, use the capability functions to list the Test Management projects, then " +
28
+ "retry this tool with the identifier they return.";
26
29
  /** A sibling tool can produce the id — prefer it over the agent. */
27
30
  export function needsIdFrom(idLabel, sourceTool) {
28
31
  return ` Requires ${idLabel}. Call ${sourceTool} first if you do not have it.`;
@@ -34,30 +37,30 @@ export function needsIdFrom(idLabel, sourceTool) {
34
37
  * "create me a project" through the agent before letting the tool run.
35
38
  */
36
39
  export const PROJECT_ID_ONLY_FOR_FOLDER = " Creating a project needs no identifier. Creating a folder inside an EXISTING project " +
37
- "needs that project's identifier (PR-*); no tool here lists projects, so ask " +
38
- 'askBrowserStackAI with product "tm" for it.';
40
+ "needs that project's identifier (PR-*); no tool here lists projects, so use the " +
41
+ "capability functions to look it up.";
39
42
  /** A test plan id (TP-*) comes from listTestPlans. */
40
43
  export const NEEDS_TEST_PLAN_ID = needsIdFrom("a test plan identifier (TP-*)", "listTestPlans");
41
44
  /**
42
45
  * The ONLY capability handoff here: every other constant points at a tool that produces a
43
46
  * missing *id*, but plan WRITES have no tool at all — the surface is `listTestPlans`,
44
- * `getTestPlan`, `listSubTestPlans`, `getSubTestPlan` and nothing else. Atlas can do them
45
- * (the tm harness allows POST /api/v1/projects/{id}/test-plans plus /update, /delete,
46
- * /clone, /test-runs and /test-runs/unlink), so without this line the model reads the four
47
- * read tools, finds no create, and reports the capability as absent — which is exactly what
48
- * a QA eval concluded.
47
+ * `getTestPlan`, `listSubTestPlans`, `getSubTestPlan` and nothing else. The capability functions can do them
48
+ * (Test Management's own API covers creating, updating, cloning and deleting a plan, and
49
+ * linking or unlinking its runs), so without this line the model reads the four read tools,
50
+ * finds no create, and reports the capability as absent — which is exactly what a QA eval
51
+ * concluded.
49
52
  *
50
53
  * Deliberately narrow: it names the specific operations that are missing rather than
51
- * inviting the model to route plan work to the agent generally, because the tool
52
- * descriptions otherwise say to prefer a specific tool whenever one fits.
54
+ * inviting the model to route plan work elsewhere generally, because the tool descriptions
55
+ * otherwise say to prefer a specific tool whenever one fits.
53
56
  *
54
- * Caveat worth knowing: askBrowserStackAI pins every write to human approval, so this path
55
- * only completes on a client that can show a prompt. On one that cannot, the intended write
56
- * comes back in `needs_approval` instead of happening.
57
+ * Caveat worth knowing: a capability write is pinned to human approval, so this path only
58
+ * completes on a client that can show a prompt. On one that cannot, the intended write is
59
+ * refused rather than performed.
57
60
  */
58
- export const PLAN_WRITES_VIA_AGENT = " Creating a test plan or sub-plan, and linking or unlinking test runs on one, are not " +
59
- 'available as tools here: call askBrowserStackAI with product "tm" and describe what you ' +
60
- "want. It asks you to confirm before changing anything.";
61
+ export const PLAN_WRITES_VIA_CAPABILITIES = " Creating a test plan or sub-plan, and linking or unlinking test runs on one, are not " +
62
+ "available as tools here: use the capability functions, which reach Test Management's " +
63
+ "own API for these operations. They ask you to confirm before changing anything.";
61
64
  /** A build id comes from either build-lookup tool. */
62
65
  export const NEEDS_BUILD_ID = needsIdFrom("a BrowserStack build id", "getBuildId or listBuildId");
63
66
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browserstack/mcp-server",
3
- "version": "2.2.0",
3
+ "version": "2.2.1-beta.1",
4
4
  "description": "BrowserStack's Official MCP Server",
5
5
  "mcpName": "io.github.browserstack/mcp-server",
6
6
  "main": "dist/index.js",
@@ -19,6 +19,7 @@
19
19
  "check:contract": "python3 scripts/check-contract.py capability/tm.capability-index.json --baseline scripts/contract-baseline/tm.json --quiet && python3 scripts/check-contract.py capability/loadtesting.capability-index.json --baseline scripts/contract-baseline/loadtesting.json --quiet",
20
20
  "eval:index": "tsx scripts/eval-index.mts",
21
21
  "seed:live": "tsx scripts/seed-live.mts",
22
+ "seed:live:tra": "tsx scripts/seed-live-tra.mts",
22
23
  "plan:tests": "tsx scripts/plan-capability-tests.mts",
23
24
  "replay:live": "tsx scripts/replay-live.mts"
24
25
  },