@west10tech/constructionwire-mcp 2.0.0 → 2.1.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 +256 -142
- package/dist/clients/constructionwire-client.d.ts +78 -76
- package/dist/clients/constructionwire-client.d.ts.map +1 -1
- package/dist/clients/constructionwire-client.js +306 -8004
- package/dist/clients/constructionwire-client.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/index.js +77 -19
- package/dist/index.js.map +1 -1
- package/dist/services/log-batcher.js +1 -1
- package/dist/services/log-batcher.js.map +1 -1
- package/dist/services/log-shipper.d.ts.map +1 -1
- package/dist/services/log-shipper.js +0 -2
- package/dist/services/log-shipper.js.map +1 -1
- package/dist/services/logger.d.ts.map +1 -1
- package/dist/services/request-tracker.js +1 -1
- package/dist/services/request-tracker.js.map +1 -1
- package/dist/tools/constructionwire-tools.d.ts.map +1 -1
- package/dist/tools/constructionwire-tools.js.map +1 -1
- package/dist/types.d.ts +147 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,150 +1,262 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ConstructionWire MCP Server
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@west10tech/constructionwire-mcp)
|
|
4
4
|
[]()
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://modelcontextprotocol.io)
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- **constructionwire_reports_questions**: List Project Questions
|
|
24
|
-
- **constructionwire_reports_add_question**: Create a Project Question
|
|
25
|
-
- **constructionwire_reports_question**: Get a Project Question
|
|
26
|
-
- **constructionwire_reports_answers**: List Answers to a Question
|
|
27
|
-
- **constructionwire_reports_answer**: Get an Answer to a Question
|
|
28
|
-
- **constructionwire_reports_tasks**: List Project Tasks
|
|
29
|
-
- **constructionwire_reports_task**: Get a Project Task
|
|
30
|
-
- **constructionwire_reports_facets**: List Construction Project Facets
|
|
31
|
-
- **constructionwire_reports_file_terms**: Get Terms and Conditions for Project Files
|
|
32
|
-
- **constructionwire_reports_add_file_terms**: Set request body to "true" to indicate that you read and agree to BuildCentral's Terms and Conditions. Read terms at /2.0/reports/files/terms.
|
|
33
|
-
- **constructionwire_reports_follow**: Create a Project Following
|
|
34
|
-
- **constructionwire_reports_unfollow**: Delete a Project Following
|
|
35
|
-
- **constructionwire_reports_following**: List Project Followings
|
|
36
|
-
- **constructionwire_reports_all_questions**: List Project Questions
|
|
37
|
-
- **constructionwire_companies_list**: List Companies
|
|
38
|
-
- **constructionwire_companies_get**: Get a Company
|
|
39
|
-
- **constructionwire_companies_locations**: List Company Locations
|
|
40
|
-
- **constructionwire_companies_location**: Get a Company Location
|
|
41
|
-
- **constructionwire_companies_people**: List Company's People
|
|
42
|
-
- **constructionwire_companies_projects**: List Company's Project Activities
|
|
43
|
-
- **constructionwire_companies_relationships**: List Company's Relationships
|
|
44
|
-
- **constructionwire_companies_stats**: List Company's Stats
|
|
45
|
-
- **constructionwire_companies_facets**: List Company Facets
|
|
46
|
-
- **constructionwire_companies_following**: List Company Followings
|
|
47
|
-
- **constructionwire_companies_follow**: Create a Company Following
|
|
48
|
-
- **constructionwire_companies_unfollow**: Delete a Company Following
|
|
49
|
-
- **constructionwire_companies_all_locations**: List Locations of multiple Companies
|
|
50
|
-
- **constructionwire_people_list**: List People
|
|
51
|
-
- **constructionwire_people_get**: Get a Person
|
|
52
|
-
- **constructionwire_people_projects**: List Person's Project Activities
|
|
53
|
-
- **constructionwire_people_relationships**: List Person's Relationships
|
|
54
|
-
- **constructionwire_people_stats**: List Person's Stats
|
|
55
|
-
- **constructionwire_people_facets**: List People Facets
|
|
56
|
-
- **constructionwire_people_following**: List People Followings
|
|
57
|
-
- **constructionwire_people_follow**: Create a Person Following
|
|
58
|
-
- **constructionwire_people_unfollow**: Delete a Person Following
|
|
59
|
-
- **constructionwire_folders_list**: List Folders
|
|
60
|
-
- **constructionwire_folders_create**: Create a Folder
|
|
61
|
-
- **constructionwire_folders_get**: Get a Folder
|
|
62
|
-
- **constructionwire_folders_update**: Update a Folder
|
|
63
|
-
- **constructionwire_folders_delete**: Delete a Folder
|
|
64
|
-
- **constructionwire_folders_add_item**: Save Items to a Folder
|
|
65
|
-
- **constructionwire_notes_list**: List Notes
|
|
66
|
-
- **constructionwire_notes_create**: Create a Note
|
|
67
|
-
- **constructionwire_notes_get**: Get a Note
|
|
68
|
-
- **constructionwire_notes_update**: Update a Note
|
|
69
|
-
- **constructionwire_notes_delete**: Delete a Note
|
|
70
|
-
- **constructionwire_news_list**: List Product News
|
|
71
|
-
- **constructionwire_news_get**: Get a Product News
|
|
72
|
-
- **constructionwire_searches_list**: List Saved Searches
|
|
73
|
-
- **constructionwire_searches_create**: Create a Saved Search
|
|
74
|
-
- **constructionwire_searches_get**: Get a Saved Search
|
|
75
|
-
- **constructionwire_searches_update**: Update a Saved Search
|
|
76
|
-
- **constructionwire_subscriptions_create_free**: Create a Free Subscription
|
|
77
|
-
- **constructionwire_subscriptions_usage**: List Subscription Usage Reports
|
|
78
|
-
- **constructionwire_tasks_list**: List Tasks
|
|
79
|
-
- **constructionwire_tasks_create**: Create a Task
|
|
80
|
-
- **constructionwire_tasks_get**: Get a Task
|
|
81
|
-
- **constructionwire_tasks_update**: Update a Task
|
|
82
|
-
- **constructionwire_tasks_delete**: Delete a Task
|
|
83
|
-
- **constructionwire_auth_login**: Create an Access Token
|
|
84
|
-
- **constructionwire_auth_details**: List Authenticated Session Details
|
|
85
|
-
- **constructionwire_auth_logout**: Logout from Authenticated Session
|
|
86
|
-
- **constructionwire_auth_subscription**: Get Subscription Details for the Authenticated Session
|
|
87
|
-
- **constructionwire_common_get_list**: Get a Common List by ID
|
|
88
|
-
- **constructionwire_common_retail_chains**: List Retail Chains
|
|
89
|
-
- **constructionwire_common_states**: List US States
|
|
90
|
-
- **constructionwire_common_counties**: List Counties for a State
|
|
91
|
-
- **constructionwire_common_regions**: List US State Regions
|
|
92
|
-
|
|
93
|
-
## Installation
|
|
8
|
+
A production-ready [Model Context Protocol](https://modelcontextprotocol.io) server that provides full access to the [ConstructionWire API](https://www.constructionwire.com) — 75 tools covering construction project intelligence, company data, people tracking, and more.
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
| Feature | Details |
|
|
13
|
+
|---------|---------|
|
|
14
|
+
| **75 API Tools** | Complete coverage of ConstructionWire API v2.0 |
|
|
15
|
+
| **Typed Interfaces** | TypeScript parameter/response types for all endpoints |
|
|
16
|
+
| **Retry Logic** | Exponential backoff with jitter for transient failures |
|
|
17
|
+
| **Progress Notifications** | Real-time progress updates for long-running operations |
|
|
18
|
+
| **Request Cancellation** | Full MCP cancellation protocol support |
|
|
19
|
+
| **Structured Logging** | JSON logging with optional centralized log shipping |
|
|
20
|
+
| **Rate Limiting** | Configurable request throttling |
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
### Install
|
|
94
25
|
|
|
95
26
|
```bash
|
|
96
27
|
npm install @west10tech/constructionwire-mcp
|
|
97
28
|
```
|
|
98
29
|
|
|
99
|
-
|
|
30
|
+
### Configure
|
|
100
31
|
|
|
101
|
-
|
|
32
|
+
Set your ConstructionWire API credentials:
|
|
102
33
|
|
|
103
34
|
```env
|
|
104
|
-
|
|
105
|
-
|
|
35
|
+
CONSTRUCTIONWIRE_USERNAME=your_username
|
|
36
|
+
CONSTRUCTIONWIRE_PASSWORD=your_password
|
|
106
37
|
```
|
|
107
38
|
|
|
108
|
-
|
|
39
|
+
### Use with Claude Desktop
|
|
109
40
|
|
|
110
|
-
|
|
41
|
+
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
111
42
|
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"mcpServers": {
|
|
46
|
+
"constructionwire": {
|
|
47
|
+
"command": "npx",
|
|
48
|
+
"args": ["@west10tech/constructionwire-mcp"],
|
|
49
|
+
"env": {
|
|
50
|
+
"CONSTRUCTIONWIRE_USERNAME": "your_username",
|
|
51
|
+
"CONSTRUCTIONWIRE_PASSWORD": "your_password"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
118
56
|
```
|
|
119
57
|
|
|
120
|
-
###
|
|
58
|
+
### Use with Claude Code
|
|
121
59
|
|
|
122
|
-
Add
|
|
60
|
+
Add to your Claude Code settings:
|
|
123
61
|
|
|
124
62
|
```json
|
|
125
63
|
{
|
|
126
64
|
"mcpServers": {
|
|
127
|
-
"constructionwire
|
|
65
|
+
"constructionwire": {
|
|
128
66
|
"command": "npx",
|
|
129
67
|
"args": ["@west10tech/constructionwire-mcp"],
|
|
130
68
|
"env": {
|
|
131
|
-
"
|
|
132
|
-
"
|
|
69
|
+
"CONSTRUCTIONWIRE_USERNAME": "your_username",
|
|
70
|
+
"CONSTRUCTIONWIRE_PASSWORD": "your_password"
|
|
133
71
|
}
|
|
134
72
|
}
|
|
135
73
|
}
|
|
136
74
|
}
|
|
137
75
|
```
|
|
138
76
|
|
|
77
|
+
## Architecture
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
src/
|
|
81
|
+
├── index.ts # MCP server entry point & handler setup
|
|
82
|
+
├── config.ts # Environment configuration & validation
|
|
83
|
+
├── types.ts # TypeScript interfaces & type definitions
|
|
84
|
+
├── clients/
|
|
85
|
+
│ └── constructionwire-client.ts # HTTP client (75 endpoint methods)
|
|
86
|
+
├── tools/
|
|
87
|
+
│ └── constructionwire-tools.ts # MCP tool definitions & routing
|
|
88
|
+
└── services/
|
|
89
|
+
├── logger.ts # Structured JSON logging
|
|
90
|
+
├── log-batcher.ts # Log batching for shipping
|
|
91
|
+
├── log-shipper.ts # HTTP log shipping
|
|
92
|
+
├── request-tracker.ts # Request lifecycle & cancellation
|
|
93
|
+
└── progress-reporter.ts # MCP progress notifications
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```mermaid
|
|
97
|
+
flowchart LR
|
|
98
|
+
Client[MCP Client] -->|JSON-RPC/stdio| Server[MCP Server]
|
|
99
|
+
Server --> Tools[Tool Router]
|
|
100
|
+
Tools --> API[ConstructionWire Client]
|
|
101
|
+
API -->|HTTPS + Basic Auth| CW[ConstructionWire API v2.0]
|
|
102
|
+
Server --> Logger[Structured Logger]
|
|
103
|
+
Logger -->|optional| Ship[Log Shipper]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Available Tools (75)
|
|
107
|
+
|
|
108
|
+
### Reports (20 tools)
|
|
109
|
+
|
|
110
|
+
| Tool | Description |
|
|
111
|
+
|------|-------------|
|
|
112
|
+
| `constructionwire_reports_list` | List construction projects (search/filter) |
|
|
113
|
+
| `constructionwire_reports_get` | Get a project by ID |
|
|
114
|
+
| `constructionwire_reports_files` | List project files (plans/specs) |
|
|
115
|
+
| `constructionwire_reports_file` | Get a specific project file |
|
|
116
|
+
| `constructionwire_reports_notes` | List project notes |
|
|
117
|
+
| `constructionwire_reports_note` | Get a project note |
|
|
118
|
+
| `constructionwire_reports_questions` | List project questions |
|
|
119
|
+
| `constructionwire_reports_add_question` | Create a project question |
|
|
120
|
+
| `constructionwire_reports_question` | Get a project question |
|
|
121
|
+
| `constructionwire_reports_answers` | List answers to a question |
|
|
122
|
+
| `constructionwire_reports_answer` | Get an answer |
|
|
123
|
+
| `constructionwire_reports_tasks` | List project tasks |
|
|
124
|
+
| `constructionwire_reports_task` | Get a project task |
|
|
125
|
+
| `constructionwire_reports_facets` | List project facets |
|
|
126
|
+
| `constructionwire_reports_file_terms` | Get file terms & conditions |
|
|
127
|
+
| `constructionwire_reports_add_file_terms` | Accept file terms & conditions |
|
|
128
|
+
| `constructionwire_reports_follow` | Follow a project |
|
|
129
|
+
| `constructionwire_reports_unfollow` | Unfollow a project |
|
|
130
|
+
| `constructionwire_reports_following` | List followed projects |
|
|
131
|
+
| `constructionwire_reports_all_questions` | List all project questions |
|
|
132
|
+
|
|
133
|
+
### Companies (13 tools)
|
|
134
|
+
|
|
135
|
+
| Tool | Description |
|
|
136
|
+
|------|-------------|
|
|
137
|
+
| `constructionwire_companies_list` | List companies (search/filter) |
|
|
138
|
+
| `constructionwire_companies_get` | Get a company by ID |
|
|
139
|
+
| `constructionwire_companies_locations` | List company locations |
|
|
140
|
+
| `constructionwire_companies_location` | Get a company location |
|
|
141
|
+
| `constructionwire_companies_people` | List company's people |
|
|
142
|
+
| `constructionwire_companies_projects` | List company's project activities |
|
|
143
|
+
| `constructionwire_companies_relationships` | List company's relationships |
|
|
144
|
+
| `constructionwire_companies_stats` | Get company statistics |
|
|
145
|
+
| `constructionwire_companies_facets` | List company facets |
|
|
146
|
+
| `constructionwire_companies_following` | List followed companies |
|
|
147
|
+
| `constructionwire_companies_follow` | Follow a company |
|
|
148
|
+
| `constructionwire_companies_unfollow` | Unfollow a company |
|
|
149
|
+
| `constructionwire_companies_all_locations` | List locations across companies |
|
|
150
|
+
|
|
151
|
+
### People (9 tools)
|
|
152
|
+
|
|
153
|
+
| Tool | Description |
|
|
154
|
+
|------|-------------|
|
|
155
|
+
| `constructionwire_people_list` | List people (search/filter) |
|
|
156
|
+
| `constructionwire_people_get` | Get a person by ID |
|
|
157
|
+
| `constructionwire_people_projects` | List person's project activities |
|
|
158
|
+
| `constructionwire_people_relationships` | List person's relationships |
|
|
159
|
+
| `constructionwire_people_stats` | Get person statistics |
|
|
160
|
+
| `constructionwire_people_facets` | List people facets |
|
|
161
|
+
| `constructionwire_people_following` | List followed people |
|
|
162
|
+
| `constructionwire_people_follow` | Follow a person |
|
|
163
|
+
| `constructionwire_people_unfollow` | Unfollow a person |
|
|
164
|
+
|
|
165
|
+
### Folders (6 tools)
|
|
166
|
+
|
|
167
|
+
| Tool | Description |
|
|
168
|
+
|------|-------------|
|
|
169
|
+
| `constructionwire_folders_list` | List folders |
|
|
170
|
+
| `constructionwire_folders_create` | Create a folder |
|
|
171
|
+
| `constructionwire_folders_get` | Get a folder |
|
|
172
|
+
| `constructionwire_folders_update` | Update a folder |
|
|
173
|
+
| `constructionwire_folders_delete` | Delete a folder |
|
|
174
|
+
| `constructionwire_folders_add_item` | Add item to a folder |
|
|
175
|
+
|
|
176
|
+
### Notes (5 tools)
|
|
177
|
+
|
|
178
|
+
| Tool | Description |
|
|
179
|
+
|------|-------------|
|
|
180
|
+
| `constructionwire_notes_list` | List notes |
|
|
181
|
+
| `constructionwire_notes_create` | Create a note |
|
|
182
|
+
| `constructionwire_notes_get` | Get a note |
|
|
183
|
+
| `constructionwire_notes_update` | Update a note |
|
|
184
|
+
| `constructionwire_notes_delete` | Delete a note |
|
|
185
|
+
|
|
186
|
+
### Tasks (5 tools)
|
|
187
|
+
|
|
188
|
+
| Tool | Description |
|
|
189
|
+
|------|-------------|
|
|
190
|
+
| `constructionwire_tasks_list` | List tasks |
|
|
191
|
+
| `constructionwire_tasks_create` | Create a task |
|
|
192
|
+
| `constructionwire_tasks_get` | Get a task |
|
|
193
|
+
| `constructionwire_tasks_update` | Update a task |
|
|
194
|
+
| `constructionwire_tasks_delete` | Delete a task |
|
|
195
|
+
|
|
196
|
+
### Saved Searches (4 tools)
|
|
197
|
+
|
|
198
|
+
| Tool | Description |
|
|
199
|
+
|------|-------------|
|
|
200
|
+
| `constructionwire_searches_list` | List saved searches |
|
|
201
|
+
| `constructionwire_searches_create` | Create a saved search |
|
|
202
|
+
| `constructionwire_searches_get` | Get a saved search |
|
|
203
|
+
| `constructionwire_searches_update` | Update a saved search |
|
|
204
|
+
|
|
205
|
+
### Subscriptions (2 tools)
|
|
206
|
+
|
|
207
|
+
| Tool | Description |
|
|
208
|
+
|------|-------------|
|
|
209
|
+
| `constructionwire_subscriptions_create_free` | Create a free subscription |
|
|
210
|
+
| `constructionwire_subscriptions_usage` | Get subscription usage reports |
|
|
211
|
+
|
|
212
|
+
### News (2 tools)
|
|
213
|
+
|
|
214
|
+
| Tool | Description |
|
|
215
|
+
|------|-------------|
|
|
216
|
+
| `constructionwire_news_list` | List product news |
|
|
217
|
+
| `constructionwire_news_get` | Get a product news entry |
|
|
218
|
+
|
|
219
|
+
### Authentication (4 tools)
|
|
220
|
+
|
|
221
|
+
| Tool | Description |
|
|
222
|
+
|------|-------------|
|
|
223
|
+
| `constructionwire_auth_login` | Create an access token |
|
|
224
|
+
| `constructionwire_auth_details` | Get authenticated session details |
|
|
225
|
+
| `constructionwire_auth_logout` | Logout from session |
|
|
226
|
+
| `constructionwire_auth_subscription` | Get subscription for current session |
|
|
227
|
+
|
|
228
|
+
### Common/Reference Data (5 tools)
|
|
229
|
+
|
|
230
|
+
| Tool | Description |
|
|
231
|
+
|------|-------------|
|
|
232
|
+
| `constructionwire_common_get_list` | Get a common list by ID |
|
|
233
|
+
| `constructionwire_common_retail_chains` | List retail chains |
|
|
234
|
+
| `constructionwire_common_states` | List US states |
|
|
235
|
+
| `constructionwire_common_counties` | List counties for a state |
|
|
236
|
+
| `constructionwire_common_regions` | List US state regions |
|
|
237
|
+
|
|
238
|
+
## Environment Variables
|
|
239
|
+
|
|
240
|
+
| Variable | Required | Default | Description |
|
|
241
|
+
|----------|----------|---------|-------------|
|
|
242
|
+
| `CONSTRUCTIONWIRE_USERNAME` | Yes | — | API username |
|
|
243
|
+
| `CONSTRUCTIONWIRE_PASSWORD` | Yes | — | API password |
|
|
244
|
+
| `CONSTRUCTIONWIRE_MAX_RETRIES` | No | `3` | Max retry attempts for transient failures |
|
|
245
|
+
| `LOG_SHIPPING_ENABLED` | No | `false` | Enable centralized log shipping |
|
|
246
|
+
| `LOG_INGESTION_URL` | No | — | Log shipping endpoint (HTTPS required) |
|
|
247
|
+
| `LOG_INGESTION_API_KEY` | No | — | API key for log shipping |
|
|
248
|
+
| `LOG_LEVEL` | No | `ERROR` | Log level: DEBUG, INFO, WARN, ERROR, FATAL |
|
|
249
|
+
| `LOG_SHIPPING_BATCH_SIZE` | No | `500` | Logs per batch (1-1000) |
|
|
250
|
+
| `LOG_SHIPPING_INTERVAL` | No | `5000` | Batch flush interval in ms (min 1000) |
|
|
251
|
+
| `LOG_SHIPPING_MAX_RETRIES` | No | `3` | Log shipping retry attempts |
|
|
252
|
+
|
|
139
253
|
## Getting API Credentials
|
|
140
254
|
|
|
141
255
|
ConstructionWire API access is provided through their Data Services team — there is no self-serve developer portal.
|
|
142
256
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
1. **Phone (fastest):** Call **+1 (866) 316-5300** during business hours (Mon–Fri, 9am–5pm Central) and ask for API access / Data Services.
|
|
257
|
+
1. **Phone (fastest):** Call **+1 (866) 316-5300** (Mon-Fri, 9am-5pm Central) and ask for API access.
|
|
146
258
|
2. **Email:** Send a request to **success.us@hubexo.com** asking for API trial credentials for `api.constructionwire.com`.
|
|
147
|
-
3. **Free trial
|
|
259
|
+
3. **Free trial:** Submit at [constructionwire.com/free-trial](https://info.buildcentral.com/free-trial-constructionwire).
|
|
148
260
|
|
|
149
261
|
### References
|
|
150
262
|
|
|
@@ -152,52 +264,29 @@ ConstructionWire API access is provided through their Data Services team — the
|
|
|
152
264
|
- [API Brochure (PDF)](https://www.constructionwire.com/Content/pdf/buildcentral_api.pdf)
|
|
153
265
|
- [Data Services](https://www.constructionwire.com/DataServices)
|
|
154
266
|
|
|
155
|
-
|
|
267
|
+
## Advanced Features
|
|
156
268
|
|
|
157
|
-
|
|
269
|
+
### Retry Logic
|
|
158
270
|
|
|
159
|
-
|
|
160
|
-
CONSTRUCTIONWIRE_USERNAME=your_username
|
|
161
|
-
CONSTRUCTIONWIRE_PASSWORD=your_password
|
|
162
|
-
```
|
|
271
|
+
The client automatically retries on transient failures (HTTP 429, 500, 502, 503, 504) with exponential backoff:
|
|
163
272
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
273
|
+
- **Delay pattern:** 1s, 2s, 4s (with random jitter)
|
|
274
|
+
- **Retry-After:** Respected when present in the response
|
|
275
|
+
- **Configurable:** Set `CONSTRUCTIONWIRE_MAX_RETRIES=0` to disable
|
|
167
276
|
|
|
168
277
|
### Request Cancellation
|
|
169
278
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
When a request is cancelled:
|
|
173
|
-
- The server immediately stops processing the request
|
|
174
|
-
- Any ongoing API calls are aborted
|
|
175
|
-
- Resources are cleaned up
|
|
176
|
-
- No response is sent for the cancelled request
|
|
279
|
+
Supports the [MCP cancellation specification](https://modelcontextprotocol.io/specification/2025-06-18/basic/utilities/cancellation). Clients can cancel in-progress requests by sending `notifications/cancelled` with the request ID.
|
|
177
280
|
|
|
178
281
|
### Progress Notifications
|
|
179
282
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
To receive progress updates:
|
|
183
|
-
1. Include a `progressToken` in your request metadata
|
|
184
|
-
2. The server will send `notifications/progress` messages with:
|
|
185
|
-
- Current progress value
|
|
186
|
-
- Total value (when known)
|
|
187
|
-
- Human-readable status messages
|
|
188
|
-
|
|
189
|
-
Progress is reported for:
|
|
190
|
-
- Multi-step operations
|
|
191
|
-
- Batch processing
|
|
192
|
-
- Long-running API calls
|
|
193
|
-
- File uploads/downloads
|
|
283
|
+
Supports the [MCP progress specification](https://modelcontextprotocol.io/specification/2025-06-18/basic/utilities/progress). Include a `progressToken` in your request metadata to receive `notifications/progress` updates.
|
|
194
284
|
|
|
195
|
-
Example progress notification:
|
|
196
285
|
```json
|
|
197
286
|
{
|
|
198
287
|
"method": "notifications/progress",
|
|
199
288
|
"params": {
|
|
200
|
-
"progressToken": "
|
|
289
|
+
"progressToken": "op-123",
|
|
201
290
|
"progress": 45,
|
|
202
291
|
"total": 100,
|
|
203
292
|
"message": "Processing item 45 of 100..."
|
|
@@ -205,3 +294,28 @@ Example progress notification:
|
|
|
205
294
|
}
|
|
206
295
|
```
|
|
207
296
|
|
|
297
|
+
## Troubleshooting
|
|
298
|
+
|
|
299
|
+
| Problem | Solution |
|
|
300
|
+
|---------|----------|
|
|
301
|
+
| `CONSTRUCTIONWIRE_USERNAME is required` | Set `CONSTRUCTIONWIRE_USERNAME` environment variable |
|
|
302
|
+
| `401 Unauthorized` | Check credentials are correct; call CW support if locked out |
|
|
303
|
+
| `429 Too Many Requests` | Reduce request frequency; retry logic handles this automatically |
|
|
304
|
+
| `ECONNREFUSED` | Verify `api.constructionwire.com` is reachable from your network |
|
|
305
|
+
| `Request timeout` | Increase timeout or check network connectivity |
|
|
306
|
+
| Tools not appearing in Claude | Verify the MCP config JSON is valid and restart Claude |
|
|
307
|
+
|
|
308
|
+
## Development
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
npm run dev # Development mode with hot reload
|
|
312
|
+
npm run build # Compile TypeScript
|
|
313
|
+
npm test # Run unit tests (146 tests)
|
|
314
|
+
npm run test:e2e # Run E2E tests (26 tests)
|
|
315
|
+
npm run test:all # Run all tests
|
|
316
|
+
npm run lint # Run ESLint
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## License
|
|
320
|
+
|
|
321
|
+
MIT
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Logger } from '../services/logger.js';
|
|
2
|
-
import { RequestOptions } from '../types.js';
|
|
2
|
+
import { RequestOptions, ToolResult } from '../types.js';
|
|
3
3
|
export interface ConstructionwireClientConfig {
|
|
4
4
|
constructionwireUsername?: string;
|
|
5
5
|
constructionwirePassword?: string;
|
|
6
6
|
apiBaseUrl?: string;
|
|
7
7
|
timeout?: number;
|
|
8
8
|
rateLimit?: number;
|
|
9
|
+
maxRetries?: number;
|
|
9
10
|
logger?: Logger;
|
|
10
11
|
}
|
|
11
12
|
export declare class ConstructionwireClient {
|
|
@@ -15,6 +16,7 @@ export declare class ConstructionwireClient {
|
|
|
15
16
|
private logger;
|
|
16
17
|
constructor(config: ConstructionwireClientConfig);
|
|
17
18
|
private setupRateLimit;
|
|
19
|
+
private setupRetry;
|
|
18
20
|
private resolveBaseUrl;
|
|
19
21
|
private getAuthHeaders;
|
|
20
22
|
/**
|
|
@@ -30,80 +32,80 @@ export declare class ConstructionwireClient {
|
|
|
30
32
|
*/
|
|
31
33
|
private makeAuthenticatedRequest;
|
|
32
34
|
private buildPath;
|
|
33
|
-
reportsList(params: any, options?: RequestOptions): Promise<
|
|
34
|
-
reportsGet(params: any, options?: RequestOptions): Promise<
|
|
35
|
-
reportsFiles(params: any, options?: RequestOptions): Promise<
|
|
36
|
-
reportsFile(params: any, options?: RequestOptions): Promise<
|
|
37
|
-
reportsNotes(params: any, options?: RequestOptions): Promise<
|
|
38
|
-
reportsNote(params: any, options?: RequestOptions): Promise<
|
|
39
|
-
reportsQuestions(params: any, options?: RequestOptions): Promise<
|
|
40
|
-
reportsAddQuestion(params: any, options?: RequestOptions): Promise<
|
|
41
|
-
reportsQuestion(params: any, options?: RequestOptions): Promise<
|
|
42
|
-
reportsAnswers(params: any, options?: RequestOptions): Promise<
|
|
43
|
-
reportsAnswer(params: any, options?: RequestOptions): Promise<
|
|
44
|
-
reportsTasks(params: any, options?: RequestOptions): Promise<
|
|
45
|
-
reportsTask(params: any, options?: RequestOptions): Promise<
|
|
46
|
-
reportsFacets(params: any, options?: RequestOptions): Promise<
|
|
47
|
-
reportsFileTerms(params: any, options?: RequestOptions): Promise<
|
|
48
|
-
reportsAddFileTerms(params: any, options?: RequestOptions): Promise<
|
|
49
|
-
reportsFollow(params: any, options?: RequestOptions): Promise<
|
|
50
|
-
reportsUnfollow(params: any, options?: RequestOptions): Promise<
|
|
51
|
-
reportsFollowing(params: any, options?: RequestOptions): Promise<
|
|
52
|
-
reportsAllQuestions(params: any, options?: RequestOptions): Promise<
|
|
53
|
-
companiesList(params: any, options?: RequestOptions): Promise<
|
|
54
|
-
companiesGet(params: any, options?: RequestOptions): Promise<
|
|
55
|
-
companiesLocations(params: any, options?: RequestOptions): Promise<
|
|
56
|
-
companiesLocation(params: any, options?: RequestOptions): Promise<
|
|
57
|
-
companiesPeople(params: any, options?: RequestOptions): Promise<
|
|
58
|
-
companiesProjects(params: any, options?: RequestOptions): Promise<
|
|
59
|
-
companiesRelationships(params: any, options?: RequestOptions): Promise<
|
|
60
|
-
companiesStats(params: any, options?: RequestOptions): Promise<
|
|
61
|
-
companiesFacets(params: any, options?: RequestOptions): Promise<
|
|
62
|
-
companiesFollowing(params: any, options?: RequestOptions): Promise<
|
|
63
|
-
companiesFollow(params: any, options?: RequestOptions): Promise<
|
|
64
|
-
companiesUnfollow(params: any, options?: RequestOptions): Promise<
|
|
65
|
-
companiesAllLocations(params: any, options?: RequestOptions): Promise<
|
|
66
|
-
peopleList(params: any, options?: RequestOptions): Promise<
|
|
67
|
-
peopleGet(params: any, options?: RequestOptions): Promise<
|
|
68
|
-
peopleProjects(params: any, options?: RequestOptions): Promise<
|
|
69
|
-
peopleRelationships(params: any, options?: RequestOptions): Promise<
|
|
70
|
-
peopleStats(params: any, options?: RequestOptions): Promise<
|
|
71
|
-
peopleFacets(params: any, options?: RequestOptions): Promise<
|
|
72
|
-
peopleFollowing(params: any, options?: RequestOptions): Promise<
|
|
73
|
-
peopleFollow(params: any, options?: RequestOptions): Promise<
|
|
74
|
-
peopleUnfollow(params: any, options?: RequestOptions): Promise<
|
|
75
|
-
foldersList(params: any, options?: RequestOptions): Promise<
|
|
76
|
-
foldersCreate(params: any, options?: RequestOptions): Promise<
|
|
77
|
-
foldersGet(params: any, options?: RequestOptions): Promise<
|
|
78
|
-
foldersUpdate(params: any, options?: RequestOptions): Promise<
|
|
79
|
-
foldersDelete(params: any, options?: RequestOptions): Promise<
|
|
80
|
-
foldersAddItem(params: any, options?: RequestOptions): Promise<
|
|
81
|
-
notesList(params: any, options?: RequestOptions): Promise<
|
|
82
|
-
notesCreate(params: any, options?: RequestOptions): Promise<
|
|
83
|
-
notesGet(params: any, options?: RequestOptions): Promise<
|
|
84
|
-
notesUpdate(params: any, options?: RequestOptions): Promise<
|
|
85
|
-
notesDelete(params: any, options?: RequestOptions): Promise<
|
|
86
|
-
newsList(params: any, options?: RequestOptions): Promise<
|
|
87
|
-
newsGet(params: any, options?: RequestOptions): Promise<
|
|
88
|
-
searchesList(params: any, options?: RequestOptions): Promise<
|
|
89
|
-
searchesCreate(params: any, options?: RequestOptions): Promise<
|
|
90
|
-
searchesGet(params: any, options?: RequestOptions): Promise<
|
|
91
|
-
searchesUpdate(params: any, options?: RequestOptions): Promise<
|
|
92
|
-
subscriptionsCreateFree(params: any, options?: RequestOptions): Promise<
|
|
93
|
-
subscriptionsUsage(params: any, options?: RequestOptions): Promise<
|
|
94
|
-
tasksList(params: any, options?: RequestOptions): Promise<
|
|
95
|
-
tasksCreate(params: any, options?: RequestOptions): Promise<
|
|
96
|
-
tasksGet(params: any, options?: RequestOptions): Promise<
|
|
97
|
-
tasksUpdate(params: any, options?: RequestOptions): Promise<
|
|
98
|
-
tasksDelete(params: any, options?: RequestOptions): Promise<
|
|
99
|
-
authLogin(params: any, options?: RequestOptions): Promise<
|
|
100
|
-
authDetails(params: any, options?: RequestOptions): Promise<
|
|
101
|
-
authLogout(params: any, options?: RequestOptions): Promise<
|
|
102
|
-
authSubscription(params: any, options?: RequestOptions): Promise<
|
|
103
|
-
commonGetList(params: any, options?: RequestOptions): Promise<
|
|
104
|
-
commonRetailChains(params: any, options?: RequestOptions): Promise<
|
|
105
|
-
commonStates(params: any, options?: RequestOptions): Promise<
|
|
106
|
-
commonCounties(params: any, options?: RequestOptions): Promise<
|
|
107
|
-
commonRegions(params: any, options?: RequestOptions): Promise<
|
|
35
|
+
reportsList(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
36
|
+
reportsGet(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
37
|
+
reportsFiles(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
38
|
+
reportsFile(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
39
|
+
reportsNotes(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
40
|
+
reportsNote(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
41
|
+
reportsQuestions(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
42
|
+
reportsAddQuestion(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
43
|
+
reportsQuestion(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
44
|
+
reportsAnswers(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
45
|
+
reportsAnswer(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
46
|
+
reportsTasks(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
47
|
+
reportsTask(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
48
|
+
reportsFacets(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
49
|
+
reportsFileTerms(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
50
|
+
reportsAddFileTerms(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
51
|
+
reportsFollow(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
52
|
+
reportsUnfollow(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
53
|
+
reportsFollowing(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
54
|
+
reportsAllQuestions(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
55
|
+
companiesList(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
56
|
+
companiesGet(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
57
|
+
companiesLocations(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
58
|
+
companiesLocation(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
59
|
+
companiesPeople(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
60
|
+
companiesProjects(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
61
|
+
companiesRelationships(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
62
|
+
companiesStats(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
63
|
+
companiesFacets(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
64
|
+
companiesFollowing(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
65
|
+
companiesFollow(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
66
|
+
companiesUnfollow(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
67
|
+
companiesAllLocations(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
68
|
+
peopleList(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
69
|
+
peopleGet(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
70
|
+
peopleProjects(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
71
|
+
peopleRelationships(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
72
|
+
peopleStats(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
73
|
+
peopleFacets(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
74
|
+
peopleFollowing(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
75
|
+
peopleFollow(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
76
|
+
peopleUnfollow(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
77
|
+
foldersList(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
78
|
+
foldersCreate(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
79
|
+
foldersGet(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
80
|
+
foldersUpdate(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
81
|
+
foldersDelete(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
82
|
+
foldersAddItem(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
83
|
+
notesList(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
84
|
+
notesCreate(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
85
|
+
notesGet(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
86
|
+
notesUpdate(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
87
|
+
notesDelete(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
88
|
+
newsList(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
89
|
+
newsGet(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
90
|
+
searchesList(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
91
|
+
searchesCreate(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
92
|
+
searchesGet(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
93
|
+
searchesUpdate(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
94
|
+
subscriptionsCreateFree(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
95
|
+
subscriptionsUsage(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
96
|
+
tasksList(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
97
|
+
tasksCreate(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
98
|
+
tasksGet(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
99
|
+
tasksUpdate(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
100
|
+
tasksDelete(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
101
|
+
authLogin(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
102
|
+
authDetails(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
103
|
+
authLogout(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
104
|
+
authSubscription(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
105
|
+
commonGetList(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
106
|
+
commonRetailChains(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
107
|
+
commonStates(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
108
|
+
commonCounties(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
109
|
+
commonRegions(params: any, options?: RequestOptions): Promise<ToolResult>;
|
|
108
110
|
}
|
|
109
111
|
//# sourceMappingURL=constructionwire-client.d.ts.map
|