itglue-mcp 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.
Files changed (79) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +382 -0
  3. package/dist/index.d.ts +7 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +513 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/lib/api-client.d.ts +76 -0
  8. package/dist/lib/api-client.d.ts.map +1 -0
  9. package/dist/lib/api-client.js +189 -0
  10. package/dist/lib/api-client.js.map +1 -0
  11. package/dist/lib/audit-logger.d.ts +51 -0
  12. package/dist/lib/audit-logger.d.ts.map +1 -0
  13. package/dist/lib/audit-logger.js +119 -0
  14. package/dist/lib/audit-logger.js.map +1 -0
  15. package/dist/lib/cache.d.ts +52 -0
  16. package/dist/lib/cache.d.ts.map +1 -0
  17. package/dist/lib/cache.js +115 -0
  18. package/dist/lib/cache.js.map +1 -0
  19. package/dist/lib/error-handler.d.ts +25 -0
  20. package/dist/lib/error-handler.d.ts.map +1 -0
  21. package/dist/lib/error-handler.js +99 -0
  22. package/dist/lib/error-handler.js.map +1 -0
  23. package/dist/lib/rate-limiter.d.ts +45 -0
  24. package/dist/lib/rate-limiter.d.ts.map +1 -0
  25. package/dist/lib/rate-limiter.js +124 -0
  26. package/dist/lib/rate-limiter.js.map +1 -0
  27. package/dist/tools/auxiliary/audit/compliance-check.d.ts +54 -0
  28. package/dist/tools/auxiliary/audit/compliance-check.d.ts.map +1 -0
  29. package/dist/tools/auxiliary/audit/compliance-check.js +303 -0
  30. package/dist/tools/auxiliary/audit/compliance-check.js.map +1 -0
  31. package/dist/tools/auxiliary/health/health-check.d.ts +36 -0
  32. package/dist/tools/auxiliary/health/health-check.d.ts.map +1 -0
  33. package/dist/tools/auxiliary/health/health-check.js +287 -0
  34. package/dist/tools/auxiliary/health/health-check.js.map +1 -0
  35. package/dist/tools/auxiliary/reporting/organization-report.d.ts +41 -0
  36. package/dist/tools/auxiliary/reporting/organization-report.d.ts.map +1 -0
  37. package/dist/tools/auxiliary/reporting/organization-report.js +297 -0
  38. package/dist/tools/auxiliary/reporting/organization-report.js.map +1 -0
  39. package/dist/tools/auxiliary/staleness/staleness-detector.d.ts +82 -0
  40. package/dist/tools/auxiliary/staleness/staleness-detector.d.ts.map +1 -0
  41. package/dist/tools/auxiliary/staleness/staleness-detector.js +238 -0
  42. package/dist/tools/auxiliary/staleness/staleness-detector.js.map +1 -0
  43. package/dist/tools/auxiliary/validation/data-validator.d.ts +46 -0
  44. package/dist/tools/auxiliary/validation/data-validator.d.ts.map +1 -0
  45. package/dist/tools/auxiliary/validation/data-validator.js +296 -0
  46. package/dist/tools/auxiliary/validation/data-validator.js.map +1 -0
  47. package/dist/tools/configurations.d.ts +48 -0
  48. package/dist/tools/configurations.d.ts.map +1 -0
  49. package/dist/tools/configurations.js +89 -0
  50. package/dist/tools/configurations.js.map +1 -0
  51. package/dist/tools/documents.d.ts +42 -0
  52. package/dist/tools/documents.d.ts.map +1 -0
  53. package/dist/tools/documents.js +79 -0
  54. package/dist/tools/documents.js.map +1 -0
  55. package/dist/tools/flexible-assets.d.ts +79 -0
  56. package/dist/tools/flexible-assets.d.ts.map +1 -0
  57. package/dist/tools/flexible-assets.js +136 -0
  58. package/dist/tools/flexible-assets.js.map +1 -0
  59. package/dist/tools/organizations.d.ts +68 -0
  60. package/dist/tools/organizations.d.ts.map +1 -0
  61. package/dist/tools/organizations.js +123 -0
  62. package/dist/tools/organizations.js.map +1 -0
  63. package/dist/tools/passwords.d.ts +86 -0
  64. package/dist/tools/passwords.d.ts.map +1 -0
  65. package/dist/tools/passwords.js +165 -0
  66. package/dist/tools/passwords.js.map +1 -0
  67. package/dist/tools/search.d.ts +34 -0
  68. package/dist/tools/search.d.ts.map +1 -0
  69. package/dist/tools/search.js +79 -0
  70. package/dist/tools/search.js.map +1 -0
  71. package/dist/types/itglue.d.ts +129 -0
  72. package/dist/types/itglue.d.ts.map +1 -0
  73. package/dist/types/itglue.js +10 -0
  74. package/dist/types/itglue.js.map +1 -0
  75. package/dist/types/mcp.d.ts +33 -0
  76. package/dist/types/mcp.d.ts.map +1 -0
  77. package/dist/types/mcp.js +11 -0
  78. package/dist/types/mcp.js.map +1 -0
  79. package/package.json +64 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Viyu Networks
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,382 @@
1
+ # ITGlue MCP Server
2
+
3
+ Model Context Protocol (MCP) server for ITGlue - enables Claude Code to access ITGlue documentation through natural language queries.
4
+
5
+ ## Overview
6
+
7
+ MSPs (Managed Service Providers) use ITGlue as their central documentation platform, storing critical information about 50-200+ client organizations including passwords, server configurations, network diagrams, vendor contacts, and SOPs. This MCP server eliminates context switching between terminal/IDE and ITGlue's web interface.
8
+
9
+ **Benefits:**
10
+ - ✅ Natural language queries for ITGlue data
11
+ - ✅ Reduced Mean Time to Resolution (MTTR) with instant credential access
12
+ - ✅ AI-assisted documentation discovery
13
+ - ✅ Audit trails for compliance (password access logging)
14
+ - ✅ Smart caching and rate limiting
15
+ - ✅ Multi-region support (US/EU/AU)
16
+
17
+ ## Features
18
+
19
+ ### Progressive Disclosure Architecture
20
+ Following the claude-mem pattern for token efficiency:
21
+
22
+ **Tier 1: Discovery** - Lightweight summaries
23
+ - `itglue_search_organizations` - Find organizations by name/ID
24
+ - `itglue_list_organization_types` - Get org types
25
+ - `itglue_search_global` - Cross-entity search
26
+
27
+ **Tier 2: Entity Navigation** - Scoped queries
28
+ - `itglue_list_configurations` - List servers/workstations/devices
29
+ - `itglue_list_passwords` - List passwords (metadata only, no values)
30
+ - `itglue_list_flexible_assets` - List custom documentation
31
+ - `itglue_list_documents` - List documents
32
+
33
+ **Tier 3: Detail Retrieval** - Full data
34
+ - `itglue_get_password` - Retrieve password values (audit logged)
35
+ - `itglue_get_flexible_asset` - Get full flexible asset details
36
+
37
+ ### Security Features
38
+ - 🔒 All password access is audit logged to stderr
39
+ - 🔒 No sensitive data in logs (automatic sanitization)
40
+ - 🔒 API keys never exposed in responses
41
+ - 🔒 Audit trail for compliance requirements
42
+
43
+ ### Performance Features
44
+ - ⚡ Smart caching (5min for orgs, 1min for configs/docs)
45
+ - ⚡ Rate limiting (8 req/sec with 20% safety margin)
46
+ - ⚡ Automatic retry with exponential backoff
47
+ - ⚡ Multi-region support (US/EU/AU)
48
+
49
+ ## Installation
50
+
51
+ ### Prerequisites
52
+ - Node.js 18 or higher
53
+ - ITGlue API key (from Settings → API Keys in ITGlue)
54
+ - [Claude Code](https://claude.ai/claude-code) installed
55
+
56
+ ### Quick Start (npm)
57
+
58
+ ```bash
59
+ npm install -g itglue-mcp
60
+ ```
61
+
62
+ ### Configuration
63
+
64
+ Add the MCP server to your Claude Code configuration (`~/.claude/settings.json`):
65
+
66
+ ```json
67
+ {
68
+ "mcpServers": {
69
+ "itglue": {
70
+ "command": "npx",
71
+ "args": ["-y", "itglue-mcp"],
72
+ "env": {
73
+ "ITGLUE_API_KEY": "your-api-key-here",
74
+ "ITGLUE_REGION": "US"
75
+ }
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ **Get your API key:**
82
+ 1. Log into ITGlue
83
+ 2. Go to Settings → API Keys
84
+ 3. Create a new API key
85
+ 4. Copy and add to your configuration
86
+
87
+ **Region options:** `US`, `EU`, or `AU`
88
+
89
+ ### Development Installation
90
+
91
+ For local development or contributing:
92
+
93
+ ```bash
94
+ # Clone the repository
95
+ git clone https://github.com/suleman-viyu/itglue-mcp.git
96
+ cd itglue-mcp
97
+
98
+ # Install dependencies
99
+ npm install
100
+
101
+ # Build the project
102
+ npm run build
103
+
104
+ # Link globally for development
105
+ npm link
106
+
107
+ # Configure Claude Code to use local build
108
+ # Update ~/.claude/settings.json:
109
+ {
110
+ "mcpServers": {
111
+ "itglue": {
112
+ "command": "node",
113
+ "args": ["/absolute/path/to/itglue-mcp/dist/index.js"],
114
+ "env": {
115
+ "ITGLUE_API_KEY": "your-api-key-here",
116
+ "ITGLUE_REGION": "US"
117
+ }
118
+ }
119
+ }
120
+ }
121
+ ```
122
+
123
+ ### Testing Installation
124
+
125
+ ```bash
126
+ # Test that the server is accessible
127
+ echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | npx itglue-mcp
128
+
129
+ # You should see a list of 14 available tools
130
+ ```
131
+
132
+ ## Usage Examples
133
+
134
+ ### With Claude Code
135
+
136
+ Once configured, use natural language to query ITGlue:
137
+
138
+ ```
139
+ User: "Show me all organizations in ITGlue"
140
+ → Uses itglue_search_organizations
141
+
142
+ User: "List servers for Acme Corp"
143
+ → Uses itglue_search_organizations (name="Acme Corp")
144
+ → Then itglue_list_configurations (organization_id=...)
145
+
146
+ User: "Find the admin password for Contoso's firewall"
147
+ → Uses itglue_search_organizations (name="Contoso")
148
+ → Then itglue_list_passwords (organization_id=...)
149
+ → Then itglue_get_password (password_id=...) [AUDIT LOGGED]
150
+ ```
151
+
152
+ ### Direct MCP Protocol Testing
153
+
154
+ ```bash
155
+ # Search for an organization
156
+ echo '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"itglue_search_organizations","arguments":{"name":"Acme"}}}' | node dist/index.js
157
+
158
+ # List configurations for an organization
159
+ echo '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"itglue_list_configurations","arguments":{"organization_id":"12345"}}}' | node dist/index.js
160
+ ```
161
+
162
+ ## Configuration
163
+
164
+ ### Environment Variables
165
+
166
+ | Variable | Required | Default | Description |
167
+ |----------|----------|---------|-------------|
168
+ | `ITGLUE_API_KEY` | ✅ Yes | - | API key from ITGlue Settings → API Keys |
169
+ | `ITGLUE_REGION` | No | `US` | API region: `US`, `EU`, or `AU` |
170
+ | `ITGLUE_CACHE_TTL` | No | `300` | Cache TTL in seconds (5 minutes) |
171
+ | `ITGLUE_RATE_LIMIT` | No | `8` | Max requests per second |
172
+ | `ITGLUE_DEBUG` | No | `false` | Enable debug logging to stderr |
173
+
174
+ ### Regional Endpoints
175
+
176
+ - **US**: `https://api.itglue.com`
177
+ - **EU**: `https://api.eu.itglue.com`
178
+ - **AU**: `https://api.au.itglue.com`
179
+
180
+ ### On-Premise Installations
181
+
182
+ For on-premise ITGlue installations, add the `ITGLUE_BASE_URL` environment variable:
183
+
184
+ ```json
185
+ {
186
+ "mcpServers": {
187
+ "itglue": {
188
+ "command": "npx",
189
+ "args": ["-y", "itglue-mcp"],
190
+ "env": {
191
+ "ITGLUE_API_KEY": "your-on-prem-api-key",
192
+ "ITGLUE_BASE_URL": "https://your-itglue-server.com/api"
193
+ }
194
+ }
195
+ }
196
+ }
197
+ ```
198
+
199
+ **Note:** On-premise installations use standard JSON headers instead of JSON:API headers. The server automatically detects and adapts based on the `ITGLUE_BASE_URL` setting.
200
+
201
+ ## Development
202
+
203
+ ### Project Structure
204
+
205
+ ```
206
+ src/
207
+ ├── index.ts # MCP server entry point
208
+ ├── lib/
209
+ │ ├── api-client.ts # ITGlue API client with rate limiting + caching
210
+ │ ├── rate-limiter.ts # Queue-based rate limiting (8 req/sec)
211
+ │ ├── cache.ts # LRU cache with TTL
212
+ │ ├── error-handler.ts # Error transformation
213
+ │ └── audit-logger.ts # Security audit logging
214
+ ├── tools/
215
+ │ ├── organizations.ts # Organization discovery
216
+ │ ├── search.ts # Global search
217
+ │ ├── configurations.ts # Configuration listing
218
+ │ ├── passwords.ts # Password management (audit logged)
219
+ │ ├── flexible-assets.ts # Flexible asset management
220
+ │ └── documents.ts # Document listing
221
+ └── types/
222
+ ├── itglue.ts # ITGlue API types
223
+ └── mcp.ts # MCP tool types
224
+ ```
225
+
226
+ ### Available Scripts
227
+
228
+ ```bash
229
+ npm run build # Build TypeScript to dist/
230
+ npm run dev # Watch mode for development
231
+ npm run test # Run tests
232
+ npm run test:watch # Watch mode for tests
233
+ npm run lint # Lint TypeScript files
234
+ npm run clean # Remove dist/ directory
235
+ ```
236
+
237
+ ### Testing
238
+
239
+ Run the test suite:
240
+ ```bash
241
+ npm test
242
+ ```
243
+
244
+ Test rate limiting:
245
+ ```bash
246
+ # Make 20 rapid requests - should throttle to ~2.5 seconds
247
+ for i in {1..20}; do
248
+ echo '{"jsonrpc":"2.0","id":'$i',"method":"tools/call","params":{"name":"itglue_search_organizations","arguments":{"limit":1}}}' | node dist/index.js &
249
+ done
250
+ wait
251
+ ```
252
+
253
+ ## Security Considerations
254
+
255
+ ### Audit Logging
256
+
257
+ All password access is logged to stderr with HIGH severity:
258
+ ```json
259
+ {
260
+ "timestamp": "2026-02-10T21:30:00.000Z",
261
+ "severity": "HIGH",
262
+ "operation": "PASSWORD_ACCESS",
263
+ "resourceType": "password",
264
+ "resourceId": "12345",
265
+ "organizationId": "67890"
266
+ }
267
+ ```
268
+
269
+ ### Sensitive Data Handling
270
+
271
+ - ✅ API keys are never logged or exposed in responses
272
+ - ✅ Password values are redacted from logs
273
+ - ✅ Sensitive fields (api_key, secret, token) are automatically sanitized
274
+ - ✅ Passwords are never cached
275
+
276
+ ### Best Practices
277
+
278
+ 1. **Store API keys securely** - Use environment variables, never commit to git
279
+ 2. **Review audit logs** - Monitor password access for unauthorized use
280
+ 3. **Use least privilege** - ITGlue API keys should have minimal necessary permissions
281
+ 4. **Rotate keys regularly** - Change API keys periodically
282
+
283
+ ## Troubleshooting
284
+
285
+ ### "ITGLUE_API_KEY environment variable is required"
286
+
287
+ Set your API key:
288
+ ```bash
289
+ export ITGLUE_API_KEY="your-api-key"
290
+ ```
291
+
292
+ Get your API key from: ITGlue → Settings → API Keys
293
+
294
+ ### "Authentication failed. Please check your ITGLUE_API_KEY"
295
+
296
+ Your API key is invalid or expired. Generate a new key from ITGlue Settings.
297
+
298
+ ### "Network error: Unable to connect to ITGlue API"
299
+
300
+ Check:
301
+ 1. Internet connection is working
302
+ 2. `ITGLUE_REGION` matches your ITGlue account (US/EU/AU)
303
+ 3. No firewall blocking access to api.itglue.com
304
+
305
+ ### Rate Limiting
306
+
307
+ If you see "Rate limit exceeded" errors:
308
+ 1. The server automatically retries with exponential backoff
309
+ 2. Reduce `ITGLUE_RATE_LIMIT` environment variable (default: 8)
310
+ 3. Enable debug logging: `ITGLUE_DEBUG=true`
311
+
312
+ ### Enable Debug Logging
313
+
314
+ ```bash
315
+ export ITGLUE_DEBUG=true
316
+ node dist/index.js
317
+ ```
318
+
319
+ Debug messages will appear in stderr.
320
+
321
+ ## Performance
322
+
323
+ ### Caching Strategy
324
+
325
+ | Resource Type | TTL | Reason |
326
+ |---------------|-----|--------|
327
+ | Organizations | 5 minutes | Rarely change |
328
+ | Org Types | 10 minutes | Static data |
329
+ | Configurations | 1 minute | Change occasionally |
330
+ | Documents | 1 minute | Change occasionally |
331
+ | Passwords | Never cached | Security requirement |
332
+ | Search Results | Never cached | Dynamic queries |
333
+
334
+ ### Rate Limiting
335
+
336
+ - **ITGlue Limit**: 3000 requests / 5 minutes = 10 req/sec
337
+ - **Our Limit**: 8 req/sec (20% safety margin)
338
+ - **Algorithm**: Sliding window with queue-based throttling
339
+
340
+ ### Token Efficiency
341
+
342
+ Progressive disclosure reduces token usage by 90%+:
343
+ - **Tier 1**: Get lightweight summaries (100-200 tokens)
344
+ - **Tier 2**: Scoped queries (200-500 tokens)
345
+ - **Tier 3**: Only fetch full details when needed (500-2000 tokens)
346
+
347
+ ## Contributing
348
+
349
+ ### Adding New Tools
350
+
351
+ 1. Create tool file in `src/tools/`
352
+ 2. Define Zod schema for parameters
353
+ 3. Implement handler function
354
+ 4. Add to `src/index.ts` tool list and routing
355
+
356
+ See `src/tools/organizations.ts` for reference implementation.
357
+
358
+ ### Running Tests
359
+
360
+ ```bash
361
+ npm test
362
+ ```
363
+
364
+ ## License
365
+
366
+ MIT License - See LICENSE file for details
367
+
368
+ ## Support
369
+
370
+ For issues, questions, or feature requests:
371
+ - File an issue on GitHub
372
+ - Contact: Viyu Networks
373
+
374
+ ## Resources
375
+
376
+ - [ITGlue API Documentation](https://api.itglue.com/developer/)
377
+ - [Model Context Protocol Specification](https://modelcontextprotocol.io/)
378
+ - [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
379
+
380
+ ---
381
+
382
+ Built with ❤️ by Suleman @ Viyu
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * ITGlue MCP Server
4
+ * Model Context Protocol server for ITGlue API access
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG"}