mcp-quickbase 2.1.0 → 2.2.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.
Files changed (38) hide show
  1. package/.sdd/tickets/RELS_relationship-management/README.md +98 -0
  2. package/.sdd/tickets/RELS_relationship-management/planning/analysis.md +190 -0
  3. package/.sdd/tickets/RELS_relationship-management/planning/architecture.md +413 -0
  4. package/.sdd/tickets/RELS_relationship-management/planning/plan.md +177 -0
  5. package/.sdd/tickets/RELS_relationship-management/planning/quality-strategy.md +335 -0
  6. package/.sdd/tickets/RELS_relationship-management/planning/review-updates.md +95 -0
  7. package/.sdd/tickets/RELS_relationship-management/planning/security-review.md +213 -0
  8. package/.sdd/tickets/RELS_relationship-management/planning/ticket-review.md +885 -0
  9. package/.sdd/tickets/RELS_relationship-management/tasks/RELS.1001_domain-setup.md +96 -0
  10. package/.sdd/tickets/RELS_relationship-management/tasks/RELS.1002_get-relationships-tool.md +142 -0
  11. package/.sdd/tickets/RELS_relationship-management/tasks/RELS.1003_register-phase1-tools.md +105 -0
  12. package/.sdd/tickets/RELS_relationship-management/tasks/RELS.2001_create-relationship-tool.md +151 -0
  13. package/.sdd/tickets/RELS_relationship-management/tasks/RELS.2002_update-relationship-tool.md +145 -0
  14. package/.sdd/tickets/RELS_relationship-management/tasks/RELS.3001_delete-relationship-tool.md +154 -0
  15. package/.sdd/tickets/RELS_relationship-management/tasks/RELS.4001_integration-testing.md +159 -0
  16. package/.sdd/tickets/RELS_relationship-management/tasks/RELS.4002_final-verification.md +182 -0
  17. package/.sdd/tickets/RELS_relationship-management/tasks/RELS_TASK_INDEX.md +179 -0
  18. package/dist/tools/apps/list_tables.d.ts +5 -5
  19. package/dist/tools/apps/list_tables.js +1 -1
  20. package/dist/tools/index.d.ts +1 -0
  21. package/dist/tools/index.js +4 -1
  22. package/dist/tools/index.js.map +1 -1
  23. package/dist/tools/relationships/create_relationship.d.ts +150 -0
  24. package/dist/tools/relationships/create_relationship.js +181 -0
  25. package/dist/tools/relationships/create_relationship.js.map +1 -0
  26. package/dist/tools/relationships/delete_relationship.d.ts +66 -0
  27. package/dist/tools/relationships/delete_relationship.js +85 -0
  28. package/dist/tools/relationships/delete_relationship.js.map +1 -0
  29. package/dist/tools/relationships/get_relationships.d.ts +126 -0
  30. package/dist/tools/relationships/get_relationships.js +126 -0
  31. package/dist/tools/relationships/get_relationships.js.map +1 -0
  32. package/dist/tools/relationships/index.d.ts +14 -0
  33. package/dist/tools/relationships/index.js +37 -0
  34. package/dist/tools/relationships/index.js.map +1 -0
  35. package/dist/tools/relationships/update_relationship.d.ts +139 -0
  36. package/dist/tools/relationships/update_relationship.js +168 -0
  37. package/dist/tools/relationships/update_relationship.js.map +1 -0
  38. package/package.json +1 -1
@@ -0,0 +1,213 @@
1
+ # Security Review: Relationship Management
2
+
3
+ ## Security Assessment
4
+
5
+ ### Authentication & Authorization
6
+
7
+ **How Auth is Handled:**
8
+
9
+ Authentication for all relationship operations flows through the existing `QuickbaseClient` which:
10
+
11
+ 1. Uses `QB-USER-TOKEN` header for authentication
12
+ 2. Uses `QB-Realm-Hostname` header to identify the target realm
13
+ 3. Token is provided via environment variable (`QUICKBASE_USER_TOKEN`)
14
+ 4. Token is never logged (redacted in all logging)
15
+
16
+ **Authorization Model:**
17
+
18
+ - Quickbase API enforces role-based permissions at the API level
19
+ - Users can only access/modify relationships in tables they have permission to
20
+ - The MCP server does not add additional authorization layers
21
+ - Permission errors (403) are passed through to the agent
22
+
23
+ **Security Considerations:**
24
+
25
+ - Token stored in environment variables (standard practice)
26
+ - No token validation performed client-side (delegated to Quickbase API)
27
+ - All authorization errors from API are surfaced clearly
28
+
29
+ ### Data Protection
30
+
31
+ **Sensitive Data Handling:**
32
+
33
+ | Data Type | Protection Method |
34
+ |-----------|-------------------|
35
+ | User Token | Redacted in logs, stored in env var |
36
+ | Realm Hostname | Partially redacted in logs |
37
+ | Table IDs | Not considered sensitive, logged for debugging |
38
+ | Relationship IDs | Not considered sensitive, logged for debugging |
39
+ | Field Labels | Not considered sensitive |
40
+
41
+ **Data in Transit:**
42
+
43
+ - All API calls use HTTPS (enforced by QuickbaseClient base URL)
44
+ - TLS/SSL certificate validation handled by Node.js fetch
45
+
46
+ **Data at Rest:**
47
+
48
+ - Response caching in memory only (CacheService)
49
+ - No persistent storage of relationship data
50
+ - Cache has configurable TTL (default 3600s)
51
+
52
+ ### Input Validation
53
+
54
+ **Validation Approach:**
55
+
56
+ All tools use the existing `BaseTool.validateParams()` method which:
57
+
58
+ 1. Validates against JSON Schema (`paramSchema`)
59
+ 2. Uses Zod for runtime type checking
60
+ 3. Provides descriptive error messages
61
+
62
+ **Parameter Validation Rules:**
63
+
64
+ | Parameter | Validation | Risk if Bypassed |
65
+ |-----------|------------|------------------|
66
+ | `table_id` | Required string | API error (400) |
67
+ | `relationship_id` | Required number for update/delete | API error (400) |
68
+ | `parent_table_id` | Required string for create | API error (400) |
69
+ | `lookup_field_ids` | Optional array of numbers | API error if invalid |
70
+ | `summary_accumulation_type` | Optional string | API error if invalid |
71
+
72
+ **Injection Prevention:**
73
+
74
+ - Parameters are passed as JSON body/query params
75
+ - No string interpolation in SQL/query contexts
76
+ - Quickbase API handles all query parsing
77
+
78
+ ### Known Gaps
79
+
80
+ | Gap | Risk Level | Mitigation | Status |
81
+ |-----|------------|------------|--------|
82
+ | No rate limiting beyond API defaults | Low | Quickbase API has its own rate limiting; client has 10 req/sec default | Accepted |
83
+ | Delete operation is irreversible | High | Tool description strongly warns agent; recommends user confirmation | Mitigated |
84
+ | No role-based access control in MCP server | Medium | Relies on Quickbase API permissions; MCP server is trusted middleware | Accepted |
85
+ | Cached relationship data may become stale | Low | Cache TTL limits staleness; operations can use `skipCache` | Accepted |
86
+ | No audit logging of destructive operations | Medium | Quickbase API maintains audit trail; consider future enhancement | Deferred |
87
+
88
+ ## Initial Release Security Scope
89
+
90
+ ### In Scope
91
+
92
+ - **Input Validation**: All parameters validated before API calls
93
+ - **Error Handling**: API errors returned without sensitive data leakage
94
+ - **Token Protection**: User token never exposed in logs or error messages
95
+ - **HTTPS Enforcement**: All API calls over TLS
96
+ - **Agent Safety**: Delete operation clearly marked as destructive
97
+
98
+ ### Out of Scope (Future Phases)
99
+
100
+ - **Audit Logging**: Detailed logging of who requested what operations
101
+ - **Additional Authorization**: Role-based restrictions beyond Quickbase API
102
+ - **Dry-Run Mode**: Preview what would be deleted before actual deletion
103
+ - **Undo/Recovery**: Ability to recover deleted relationships
104
+ - **Rate Limiting UI**: Visibility into remaining API quota
105
+
106
+ ## Destructive Operation Security
107
+
108
+ ### Delete Relationship Risk Assessment
109
+
110
+ **Risk:** Agents may delete relationships without understanding consequences, causing permanent data loss.
111
+
112
+ **Impact:**
113
+ - All lookup fields associated with relationship are deleted
114
+ - All summary fields associated with relationship are deleted
115
+ - Data in deleted fields is permanently lost
116
+ - Cannot be recovered without Quickbase backup restore
117
+
118
+ **Mitigations Implemented:**
119
+
120
+ 1. **Tool Description Warning**
121
+ ```
122
+ WARNING: DESTRUCTIVE OPERATION - Permanently deletes an entire
123
+ table-to-table relationship INCLUDING ALL LOOKUP AND SUMMARY FIELDS
124
+ associated with it. All data in those fields will be permanently
125
+ lost and CANNOT be recovered.
126
+ ```
127
+
128
+ 2. **Guidance for Safe Usage**
129
+ - Recommends using `get_relationships` first to review impact
130
+ - Recommends confirming with user before proceeding
131
+ - Suggests deleting individual fields instead if relationship should remain
132
+
133
+ 3. **No Automatic Execution**
134
+ - Agent must explicitly call the delete tool
135
+ - Human-in-the-loop confirmation recommended in description
136
+
137
+ ### Comparison with Other Delete Operations
138
+
139
+ | Operation | Destructiveness | Current Mitigation | Recommendation |
140
+ |-----------|-----------------|--------------------|--------------------|
141
+ | Delete Record | Medium | Standard tool description | None needed |
142
+ | Delete Field | High | Standard tool description | Consider adding warning |
143
+ | Delete Table | Very High | Standard tool description | Consider adding warning |
144
+ | Delete Relationship | High | WARNING in description | Implemented |
145
+ | Delete App | Critical | Standard tool description | Strongly recommend warning |
146
+
147
+ ## Security Checklist
148
+
149
+ ### Code Security
150
+
151
+ - [x] No hardcoded secrets (tokens from env vars)
152
+ - [x] Input validation on all external inputs (BaseTool handles)
153
+ - [x] Proper error handling without info leakage (existing pattern)
154
+ - [x] Dependencies reviewed (existing deps, no new ones)
155
+ - [x] No SQL injection vulnerabilities (N/A - JSON API)
156
+ - [x] No XSS vulnerabilities (N/A - not a web UI)
157
+
158
+ ### API Security
159
+
160
+ - [x] HTTPS enforced for all API calls
161
+ - [x] Auth token properly passed in headers
162
+ - [x] Auth token never logged
163
+ - [x] API errors handled without token exposure
164
+ - [x] Rate limiting in place (client default)
165
+
166
+ ### Agent Safety
167
+
168
+ - [x] Destructive operations clearly labeled
169
+ - [x] Delete tool warns about permanent data loss
170
+ - [x] Delete tool lists what will be deleted
171
+ - [x] Delete tool recommends confirmation workflow
172
+ - [x] Non-destructive tools indicate they are safe
173
+
174
+ ## Security Testing Requirements
175
+
176
+ ### Authentication Tests
177
+
178
+ - [ ] Verify token is not present in any log output
179
+ - [ ] Verify 401 errors are handled gracefully
180
+ - [ ] Verify 403 errors return permission-denied message
181
+
182
+ ### Input Validation Tests
183
+
184
+ - [ ] Test with malformed table IDs
185
+ - [ ] Test with injection attempts in string parameters
186
+ - [ ] Test with oversized payloads
187
+
188
+ ### Error Handling Tests
189
+
190
+ - [ ] Verify error messages don't contain token
191
+ - [ ] Verify error messages don't contain realm details beyond necessary
192
+ - [ ] Verify network errors don't leak internal details
193
+
194
+ ### Destructive Operation Tests
195
+
196
+ - [ ] Verify delete tool description contains required warnings
197
+ - [ ] Test delete returns clear confirmation of what was deleted
198
+ - [ ] Test delete errors don't suggest partial completion without clarity
199
+
200
+ ## Recommendations
201
+
202
+ ### Immediate (This Release)
203
+
204
+ 1. **Implement comprehensive tool descriptions** - Done in design
205
+ 2. **Follow existing security patterns** - Using BaseTool, QuickbaseClient
206
+ 3. **Test error handling** - Ensure no sensitive data in errors
207
+
208
+ ### Future Enhancements
209
+
210
+ 1. **Audit Logging**: Add structured logging for relationship operations with timestamp, user (if available), and action
211
+ 2. **Dry-Run Mode**: Consider `--dry-run` or preview parameter for delete
212
+ 3. **Confirmation Token**: For extra safety, require a confirmation parameter for delete operations
213
+ 4. **Rate Limit Visibility**: Expose remaining API quota in responses