@assetlab/mcp-server 1.1.0 → 1.3.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/README.md CHANGED
@@ -1,112 +1,174 @@
1
- # @assetlab/mcp-server
2
-
3
- Connect [Claude](https://claude.ai) to your [AssetLab](https://assetlab.ca) account via the [Model Context Protocol](https://modelcontextprotocol.io). Ask Claude questions about your assets, work orders, PM schedules, and more — in plain language.
4
-
5
- ## Prerequisites
6
-
7
- - [Node.js](https://nodejs.org) 18 or later
8
- - An AssetLab account with an API key (create one in **Settings → API Keys**)
9
- - [Claude Desktop](https://claude.ai/download) or [Claude Code](https://claude.ai/code)
10
-
11
- ## Setup
12
-
13
- ### Claude Desktop
14
-
15
- 1. Open your Claude Desktop config file:
16
- - **Mac:** `~/Library/Application Support/Claude/claude_desktop_config.json`
17
- - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
18
-
19
- 2. Add the following to the `mcpServers` object (replace `al_live_...` with your API key):
20
-
21
- ```json
22
- {
23
- "mcpServers": {
24
- "assetlab": {
25
- "command": "npx",
26
- "args": ["-y", "@assetlab/mcp-server"],
27
- "env": {
28
- "ASSETLAB_API_KEY": "al_live_...",
29
- "ASSETLAB_API_URL": "your-api-url"
30
- }
31
- }
32
- }
33
- }
34
- ```
35
-
36
- > **Tip:** The easiest way to get this config is to click **Copy Claude Config** directly on your API key in **AssetLab Settings → API Keys** — it pre-fills your key and API URL automatically.
37
-
38
- 3. Restart Claude Desktop. You should see the AssetLab tools available.
39
-
40
- ### Claude Code
41
-
42
- ```bash
43
- claude mcp add assetlab npx @assetlab/mcp-server \
44
- -e ASSETLAB_API_KEY=al_live_... \
45
- -e ASSETLAB_API_URL=your-api-url
46
- ```
47
-
48
- ## Example prompts
49
-
50
- Once connected, you can ask Claude things like:
51
-
52
- - *"Show me all overdue work orders"*
53
- - *"List critical assets at Site A"*
54
- - *"What PM schedules are due this month?"*
55
- - *"Summarize the current state of our facilities"*
56
- - *"Which projects are at risk or delayed?"*
57
- - *"Show me all assets linked to the HVAC system in Building 3"*
58
- - *"List open corrective work orders at all sites"*
59
-
60
- ## Available tools
61
-
62
- | Tool | Description |
63
- |------|-------------|
64
- | `list_assets` | List assets with filters for site, building, system, and search |
65
- | `get_asset` | Get full details for a specific asset |
66
- | `list_work_orders` | List work orders filtered by status, priority, type, or site |
67
- | `get_work_order` | Get full details for a specific work order |
68
- | `list_sites` | List all sites in your organization |
69
- | `get_site` | Get details for a specific site |
70
- | `list_buildings` | List buildings, optionally filtered by site |
71
- | `list_locations` | List rooms and areas, optionally filtered by building |
72
- | `list_systems` | List systems (HVAC, plumbing, electrical, etc.) |
73
- | `list_system_groups` | List system groups |
74
- | `list_system_classes` | List top-level system classifications |
75
- | `list_pm_schedules` | List PM schedules filtered by status, frequency, or site |
76
- | `get_pm_schedule` | Get a PM schedule including tasks and linked assets |
77
- | `list_pm_templates` | List reusable PM templates |
78
- | `list_projects` | List capital projects filtered by status or health |
79
- | `get_project` | Get project details including budget and progress |
80
- | `list_contracts` | List vendor contracts |
81
- | `list_compliance_items` | List compliance/regulatory items |
82
- | `get_compliance_item` | Get a compliance item with linked PM schedules |
83
- | `get_dashboard_summary` | Get aggregated stats across assets, work orders, and sites |
84
-
85
- ## Scopes
86
-
87
- API keys use scopes to control what Claude can access. Grant only the scopes you need:
88
-
89
- | Scope | Access |
90
- |-------|--------|
91
- | `assets:read` | Assets |
92
- | `work_orders:read` | Work orders |
93
- | `sites:read` | Sites and buildings |
94
- | `locations:read` | Locations |
95
- | `systems:read` | Systems, system groups, system classes |
96
- | `pm_schedules:read` | PM schedules and templates |
97
- | `projects:read` | Capital projects |
98
- | `contracts:read` | Vendor contracts |
99
- | `compliance:read` | Compliance items |
100
- | `dashboard:read` | Dashboard summary stats |
101
- | `*:*` | All resources |
102
-
103
- ## Security
104
-
105
- - The MCP server runs **locally** on your machine via stdio — no network server is exposed
106
- - Your API key is scoped to your organization only
107
- - All data access is read-only and logged in AssetLab's audit log
108
- - API keys can be revoked at any time in **Settings → API Keys**
109
-
110
- ## Support
111
-
112
- Questions or issues? Email [support@assetlab.ca](mailto:support@assetlab.ca).
1
+ # @assetlab/mcp-server
2
+
3
+ Connect [Claude](https://claude.ai) to your [AssetLab](https://assetlab.ca) account via the [Model Context Protocol](https://modelcontextprotocol.io). Ask Claude questions about your assets, work orders, PM schedules, and more — in plain language.
4
+
5
+ ## Prerequisites
6
+
7
+ - [Node.js](https://nodejs.org) 18 or later
8
+ - An AssetLab account with an API key (create one in **Settings → API Keys**)
9
+ - [Claude Desktop](https://claude.ai/download) or [Claude Code](https://claude.ai/code)
10
+
11
+ ## Setup
12
+
13
+ ### Claude Desktop
14
+
15
+ 1. Open your Claude Desktop config file:
16
+ - **Mac:** `~/Library/Application Support/Claude/claude_desktop_config.json`
17
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
18
+
19
+ 2. Add the following to the `mcpServers` object (replace `al_live_...` with your API key):
20
+
21
+ ```json
22
+ {
23
+ "mcpServers": {
24
+ "assetlab": {
25
+ "command": "npx",
26
+ "args": ["-y", "@assetlab/mcp-server"],
27
+ "env": {
28
+ "ASSETLAB_API_KEY": "al_live_...",
29
+ "ASSETLAB_API_URL": "your-api-url"
30
+ }
31
+ }
32
+ }
33
+ }
34
+ ```
35
+
36
+ > **Tip:** The easiest way to get this config is to click **Copy Claude Config** directly on your API key in **AssetLab Settings → API Keys** — it pre-fills your key and API URL automatically.
37
+
38
+ 3. Restart Claude Desktop. You should see the AssetLab tools available.
39
+
40
+ ### Claude Code
41
+
42
+ ```bash
43
+ claude mcp add assetlab npx @assetlab/mcp-server \
44
+ -e ASSETLAB_API_KEY=al_live_... \
45
+ -e ASSETLAB_API_URL=your-api-url
46
+ ```
47
+
48
+ ## Example prompts
49
+
50
+ Once connected, you can ask Claude things like:
51
+
52
+ - *"Show me all overdue work orders"*
53
+ - *"List critical assets at Site A"*
54
+ - *"What PM schedules are due this month?"*
55
+ - *"Summarize the current state of our facilities"*
56
+ - *"Which projects are at risk or delayed?"*
57
+ - *"Show me all assets linked to the HVAC system in Building 3"*
58
+ - *"List open corrective work orders at all sites"*
59
+ - *"What's the total cost history for Asset X?"*
60
+ - *"Show me all project milestones that are at risk"*
61
+ - *"What's the FCI trend for Site A over the past year?"*
62
+ - *"List all replacement plans due in 2027"*
63
+
64
+ ## Available tools
65
+
66
+ | Tool | Description |
67
+ |------|-------------|
68
+ | `list_assets` | List assets with filters for site, building, system, and search |
69
+ | `get_asset` | Get full details for a specific asset |
70
+ | `list_work_orders` | List work orders filtered by status, priority, type, or site |
71
+ | `get_work_order` | Get full details for a specific work order |
72
+ | `list_sites` | List all sites in your organization |
73
+ | `get_site` | Get details for a specific site |
74
+ | `list_buildings` | List buildings, optionally filtered by site |
75
+ | `list_locations` | List rooms and areas, optionally filtered by building |
76
+ | `list_systems` | List systems (HVAC, plumbing, electrical, etc.) |
77
+ | `list_system_groups` | List system groups |
78
+ | `list_system_classes` | List top-level system classifications |
79
+ | `list_pm_schedules` | List PM schedules filtered by status, frequency, or site |
80
+ | `get_pm_schedule` | Get a PM schedule including tasks and linked assets |
81
+ | `list_pm_templates` | List reusable PM templates |
82
+ | `list_projects` | List capital projects filtered by status or health |
83
+ | `get_project` | Get project details including budget and progress |
84
+ | `list_contracts` | List vendor contracts |
85
+ | `list_compliance_items` | List compliance/regulatory items |
86
+ | `get_compliance_item` | Get a compliance item with linked PM schedules |
87
+ | `get_dashboard_summary` | Get aggregated stats across assets, work orders, and sites |
88
+ | `list_budgets` | List annual funding budgets by year, site, building, or funding source |
89
+ | `get_budget` | Get a single annual funding budget |
90
+ | `list_asset_comments` | List comments on assets, filterable by asset |
91
+ | `get_asset_comment` | Get a single asset comment |
92
+ | `list_asset_costs` | List asset cost records (repairs, PM, operations, replacements) |
93
+ | `get_asset_cost` | Get a single asset cost record with related names |
94
+ | `list_asset_replacement_plans` | List asset replacement plans for lifecycle planning |
95
+ | `get_asset_replacement_plan` | Get a single replacement plan |
96
+ | `list_asset_risk_history` | List risk assessment history for assets |
97
+ | `get_asset_risk_history_entry` | Get a single risk history entry |
98
+ | `list_work_order_comments` | List comments on work orders |
99
+ | `get_work_order_comment` | Get a single work order comment |
100
+ | `list_project_tasks` | List project tasks with status, priority, cost tracking |
101
+ | `get_project_task` | Get a single project task |
102
+ | `list_project_milestones` | List project milestones |
103
+ | `get_project_milestone` | Get a single milestone |
104
+ | `list_project_phases` | List project phases |
105
+ | `get_project_phase` | Get a single phase |
106
+ | `list_project_budget_items` | List project budget line items by category |
107
+ | `get_project_budget_item` | Get a single budget item |
108
+ | `list_project_time_entries` | List time entries for project labor tracking |
109
+ | `get_project_time_entry` | Get a single time entry |
110
+ | `list_project_comments` | List comments on projects (threaded) |
111
+ | `get_project_comment` | Get a single project comment |
112
+ | `list_compliance_records` | List compliance check completion records |
113
+ | `get_compliance_record` | Get a single compliance record |
114
+ | `list_site_fci_history` | List Facility Condition Index history for sites |
115
+ | `get_site_fci_history_entry` | Get a single FCI history entry |
116
+ | `list_dashboard_snapshots` | List monthly aggregate dashboard snapshots |
117
+ | `get_dashboard_snapshot` | Get a single dashboard snapshot |
118
+ | `list_vendor_site_assignments` | List vendor-to-site service mappings |
119
+ | `get_vendor_site_assignment` | Get a single vendor site assignment |
120
+ | `list_contract_sites` | List contract-to-site coverage mappings |
121
+ | `list_custom_field_definitions` | List custom field schemas by entity type |
122
+ | `get_custom_field_definition` | Get a single custom field definition |
123
+ | `list_custom_field_values` | List custom field values by entity or field |
124
+ | `get_custom_field_value` | Get a single custom field value |
125
+ | `list_part_categories` | List part categories |
126
+ | `get_part_category` | Get a single part category |
127
+
128
+ ## Scopes
129
+
130
+ API keys use scopes to control what Claude can access. Grant only the scopes you need:
131
+
132
+ | Scope | Access |
133
+ |-------|--------|
134
+ | `assets:read` | Assets |
135
+ | `work_orders:read` | Work orders |
136
+ | `sites:read` | Sites and buildings |
137
+ | `locations:read` | Locations |
138
+ | `systems:read` | Systems, system groups, system classes |
139
+ | `pm_schedules:read` | PM schedules and templates |
140
+ | `projects:read` | Capital projects |
141
+ | `contracts:read` | Vendor contracts |
142
+ | `compliance:read` | Compliance items |
143
+ | `dashboard:read` | Dashboard summary stats |
144
+ | `budgets:read` | Annual funding budgets |
145
+ | `asset_comments:read` | Asset comments |
146
+ | `asset_costs:read` | Asset cost records |
147
+ | `asset_replacement_plans:read` | Asset replacement plans |
148
+ | `asset_risk_history:read` | Asset risk history |
149
+ | `work_order_comments:read` | Work order comments |
150
+ | `project_tasks:read` | Project tasks |
151
+ | `project_milestones:read` | Project milestones |
152
+ | `project_phases:read` | Project phases |
153
+ | `project_budget_items:read` | Project budget items |
154
+ | `project_time_entries:read` | Project time entries |
155
+ | `project_comments:read` | Project comments |
156
+ | `compliance_records:read` | Compliance records |
157
+ | `site_fci_history:read` | Site FCI history |
158
+ | `dashboard_snapshots:read` | Dashboard snapshots |
159
+ | `vendor_site_assignments:read` | Vendor site assignments |
160
+ | `contract_sites:read` | Contract site mappings |
161
+ | `custom_fields:read` | Custom field definitions and values |
162
+ | `part_categories:read` | Part categories |
163
+ | `*:*` | All resources |
164
+
165
+ ## Security
166
+
167
+ - The MCP server runs **locally** on your machine via stdio — no network server is exposed
168
+ - Your API key is scoped to your organization only
169
+ - All data access is read-only and logged in AssetLab's audit log
170
+ - API keys can be revoked at any time in **Settings → API Keys**
171
+
172
+ ## Support
173
+
174
+ Questions or issues? Email [support@assetlab.ca](mailto:support@assetlab.ca).
package/dist/client.d.ts CHANGED
@@ -40,5 +40,17 @@ export declare class AssetLabClient {
40
40
  total: number;
41
41
  }>;
42
42
  getOne<T = Record<string, unknown>>(resource: string, id: string): Promise<SingleResponse<T>>;
43
+ post<T = Record<string, unknown>>(path: string, body: Record<string, unknown>): Promise<T>;
44
+ create<T = Record<string, unknown>>(resource: string, body: Record<string, unknown>): Promise<SingleResponse<T>>;
45
+ patch<T = Record<string, unknown>>(path: string, body: Record<string, unknown>): Promise<T>;
46
+ update<T = Record<string, unknown>>(resource: string, id: string, body: Record<string, unknown>): Promise<SingleResponse<T>>;
47
+ del(path: string): Promise<{
48
+ success: boolean;
49
+ message: string;
50
+ }>;
51
+ remove(resource: string, id: string): Promise<{
52
+ success: boolean;
53
+ message: string;
54
+ }>;
43
55
  }
44
56
  export declare function loadConfig(): AssetLabConfig;
package/dist/client.js CHANGED
@@ -87,6 +87,112 @@ export class AssetLabClient {
87
87
  async getOne(resource, id) {
88
88
  return this.get(`/${resource}/${id}`);
89
89
  }
90
+ async post(path, body) {
91
+ const url = `${this.baseUrl}${path}`;
92
+ const res = await fetch(url, {
93
+ method: 'POST',
94
+ headers: {
95
+ 'Authorization': `Bearer ${this.apiKey}`,
96
+ 'Content-Type': 'application/json',
97
+ },
98
+ body: JSON.stringify(body),
99
+ });
100
+ if (!res.ok) {
101
+ const data = await res.json().catch(() => ({ error: `HTTP ${res.status}` }));
102
+ const message = data.error || `HTTP ${res.status}`;
103
+ switch (res.status) {
104
+ case 401:
105
+ throw new AssetLabClientError(401, 'Authentication failed. Check your ASSETLAB_API_KEY.');
106
+ case 403:
107
+ throw new AssetLabClientError(403, message.includes('scope')
108
+ ? message
109
+ : message.includes('expired')
110
+ ? 'API key has expired. Generate a new one in AssetLab Settings > API Keys.'
111
+ : message);
112
+ case 429:
113
+ throw new AssetLabClientError(429, 'Rate limit exceeded. Wait a moment and try again.');
114
+ case 400:
115
+ throw new AssetLabClientError(400, message);
116
+ default:
117
+ throw new AssetLabClientError(res.status, message);
118
+ }
119
+ }
120
+ return res.json();
121
+ }
122
+ async create(resource, body) {
123
+ return this.post(`/${resource}`, body);
124
+ }
125
+ async patch(path, body) {
126
+ const url = `${this.baseUrl}${path}`;
127
+ const res = await fetch(url, {
128
+ method: 'PATCH',
129
+ headers: {
130
+ 'Authorization': `Bearer ${this.apiKey}`,
131
+ 'Content-Type': 'application/json',
132
+ },
133
+ body: JSON.stringify(body),
134
+ });
135
+ if (!res.ok) {
136
+ const data = await res.json().catch(() => ({ error: `HTTP ${res.status}` }));
137
+ const message = data.error || `HTTP ${res.status}`;
138
+ switch (res.status) {
139
+ case 401:
140
+ throw new AssetLabClientError(401, 'Authentication failed. Check your ASSETLAB_API_KEY.');
141
+ case 403:
142
+ throw new AssetLabClientError(403, message.includes('scope')
143
+ ? message
144
+ : message.includes('expired')
145
+ ? 'API key has expired. Generate a new one in AssetLab Settings > API Keys.'
146
+ : message);
147
+ case 429:
148
+ throw new AssetLabClientError(429, 'Rate limit exceeded. Wait a moment and try again.');
149
+ case 400:
150
+ throw new AssetLabClientError(400, message);
151
+ case 404:
152
+ throw new AssetLabClientError(404, message);
153
+ default:
154
+ throw new AssetLabClientError(res.status, message);
155
+ }
156
+ }
157
+ return res.json();
158
+ }
159
+ async update(resource, id, body) {
160
+ return this.patch(`/${resource}/${id}`, body);
161
+ }
162
+ async del(path) {
163
+ const url = `${this.baseUrl}${path}`;
164
+ const res = await fetch(url, {
165
+ method: 'DELETE',
166
+ headers: {
167
+ 'Authorization': `Bearer ${this.apiKey}`,
168
+ 'Content-Type': 'application/json',
169
+ },
170
+ });
171
+ if (!res.ok) {
172
+ const data = await res.json().catch(() => ({ error: `HTTP ${res.status}` }));
173
+ const message = data.error || `HTTP ${res.status}`;
174
+ switch (res.status) {
175
+ case 401:
176
+ throw new AssetLabClientError(401, 'Authentication failed. Check your ASSETLAB_API_KEY.');
177
+ case 403:
178
+ throw new AssetLabClientError(403, message.includes('scope')
179
+ ? message
180
+ : message.includes('expired')
181
+ ? 'API key has expired. Generate a new one in AssetLab Settings > API Keys.'
182
+ : message);
183
+ case 429:
184
+ throw new AssetLabClientError(429, 'Rate limit exceeded. Wait a moment and try again.');
185
+ case 404:
186
+ throw new AssetLabClientError(404, message);
187
+ default:
188
+ throw new AssetLabClientError(res.status, message);
189
+ }
190
+ }
191
+ return res.json();
192
+ }
193
+ async remove(resource, id) {
194
+ return this.del(`/${resource}/${id}`);
195
+ }
90
196
  }
91
197
  export function loadConfig() {
92
198
  const apiKey = process.env.ASSETL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CAAC,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;wBAC1D,CAAC,CAAC,OAAO;wBACT,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;4BAC3B,CAAC,CAAC,0EAA0E;4BAC5E,CAAC,CAAC,OAAO,CAAC,CAAA;gBAChB,KAAK,GAAG;oBACN,MAAM,IAAI,mBAAmB,CAAC,GAAG,EAAE,mDAAmD,CAAC,CAAA;gBACzF,KAAK,GAAG;oBACN,MAAM,IAAI,mBAAmB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;gBAC7C;oBACE,MAAM,IAAI,mBAAmB,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;YACtD,CAAC;QACH,CAAC;QAED,OAAO,GAAG,CAAC,IAAI,EAAoD,CAAA;IACrE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,EAAU;QACvC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,IAAI,EAAE,EAAE,CAAC,CAAA;IACvC,CAAC;CACF;AAED,MAAM,UAAU,UAAU;IACxB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAA;IAC3C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,qDAAqD;YACrD,oDAAoD,CACrD,CAAA;IACH,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAA;IAC3C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,qDAAqD;YACrD,iEAAiE,CAClE,CAAA;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAC3B,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * MCP write-tool registrations for AssetLab.
3
+ *
4
+ * Registers create, update, and delete tools for every API resource.
5
+ * Each tool maps to POST / PATCH / DELETE on the AssetLab API Gateway.
6
+ * Write tools require API keys with the appropriate :write scope.
7
+ */
8
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
9
+ import type { AssetLabClient } from './client.js';
10
+ export declare function registerWriteTools(server: McpServer, client: AssetLabClient): void;