@layers/amba-mcp 0.1.1 → 1.0.0
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/dist/api-client.d.ts +66 -0
- package/dist/auth.d.ts +7 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.js +3230 -0
- package/dist/tools/achievements.d.ts +3 -0
- package/dist/tools/analytics.d.ts +3 -0
- package/dist/tools/auth.d.ts +37 -0
- package/dist/tools/challenges.d.ts +3 -0
- package/dist/tools/config.d.ts +3 -0
- package/dist/tools/content.d.ts +3 -0
- package/dist/tools/economy.d.ts +3 -0
- package/dist/tools/events.d.ts +3 -0
- package/dist/tools/integrations.d.ts +3 -0
- package/dist/tools/leaderboards.d.ts +3 -0
- package/dist/tools/platform.d.ts +3 -0
- package/dist/tools/projects.d.ts +3 -0
- package/dist/tools/push.d.ts +3 -0
- package/dist/tools/segments.d.ts +3 -0
- package/dist/tools/setup.d.ts +3 -0
- package/dist/tools/social.d.ts +3 -0
- package/dist/tools/streaks.d.ts +3 -0
- package/dist/tools/users.d.ts +3 -0
- package/dist/tools/xp.d.ts +3 -0
- package/package.json +7 -6
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Developer-account auth tools.
|
|
3
|
+
*
|
|
4
|
+
* Why these are special: every other MCP tool runs against `/admin/*` with
|
|
5
|
+
* the inbound developer Bearer forwarded verbatim (`ApiClient.request`).
|
|
6
|
+
* Signup/login/refresh hit the public `/auth/developer/*` endpoints which
|
|
7
|
+
* either don't require a Bearer (signup, login, refresh) or require the
|
|
8
|
+
* NEW token returned by an earlier tool (`me`, `rotate_pat`). So these
|
|
9
|
+
* handlers bypass the shared `ApiClient.request` flow and use plain
|
|
10
|
+
* `fetch` against `apiClient.getApiRoot()` (the API root with `/admin`
|
|
11
|
+
* stripped).
|
|
12
|
+
*
|
|
13
|
+
* Bootstrap flow for an agent that has zero credentials:
|
|
14
|
+
*
|
|
15
|
+
* 1. Call `amba_developer_signup` with NO Authorization header. The MCP
|
|
16
|
+
* server's public-tools allowlist lets signup/login/refresh through
|
|
17
|
+
* unauthenticated.
|
|
18
|
+
* 2. The signup response includes:
|
|
19
|
+
* - `pat` — a long-lived Personal Access Token. Use the
|
|
20
|
+
* PAT for agent flows: pass it as the inbound
|
|
21
|
+
* Bearer for every subsequent MCP call. Survives
|
|
22
|
+
* until rotated.
|
|
23
|
+
* - `project` — a real isolated Neon-backed project provisioning
|
|
24
|
+
* asynchronously. Includes project_id, client_key,
|
|
25
|
+
* server_key, provisioning_status, and verify_url.
|
|
26
|
+
* Poll `amba_get_provisioning_status` until the
|
|
27
|
+
* workflow completes (~10s) before issuing
|
|
28
|
+
* client-plane traffic.
|
|
29
|
+
* 3. Re-issue subsequent MCP calls with `Authorization: Bearer <pat>`.
|
|
30
|
+
* All downstream tools (`amba_create_project`, etc.) now work.
|
|
31
|
+
*
|
|
32
|
+
* The PAT can be rotated via `amba_developer_rotate_pat`. The old PAT
|
|
33
|
+
* stops working immediately on rotation (may take up to 30s to propagate).
|
|
34
|
+
*/
|
|
35
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
36
|
+
import type { ApiClient } from '../api-client.js';
|
|
37
|
+
export declare function registerTools(server: McpServer, apiClient: ApiClient): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layers/amba-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22"
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"LICENSE"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@layers/amba-shared": "^0.1.0",
|
|
24
23
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
25
|
-
"zod": "^3.25.0"
|
|
24
|
+
"zod": "^3.25.0",
|
|
25
|
+
"@layers/amba-shared": "1.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.10.2",
|
|
@@ -31,12 +31,13 @@
|
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/layers/amba
|
|
34
|
+
"url": "git+https://github.com/layers/amba.git",
|
|
35
|
+
"directory": "packages/mcp"
|
|
35
36
|
},
|
|
36
37
|
"bugs": {
|
|
37
|
-
"url": "https://github.com/layers/amba
|
|
38
|
+
"url": "https://github.com/layers/amba/issues"
|
|
38
39
|
},
|
|
39
|
-
"homepage": "https://
|
|
40
|
+
"homepage": "https://amba.dev",
|
|
40
41
|
"publishConfig": {
|
|
41
42
|
"access": "public"
|
|
42
43
|
},
|