Skip to content

Commit de5f2de

Browse files
committed
2.1
1 parent 49792c8 commit de5f2de

99 files changed

Lines changed: 9864 additions & 3021 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 22.x
15+
cache: 'npm'
16+
- run: npm ci
17+
- run: npm run build
18+
- run: npm test -- tests/unit/
19+
- run: npm test -- tests/smoke.test.ts
20+
21+
publish:
22+
needs: test
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
id-token: write
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 22.x
32+
cache: 'npm'
33+
registry-url: 'https://registry.npmjs.org'
34+
- run: npm ci
35+
- name: Set version from release tag
36+
run: |
37+
TAG_VERSION="${GITHUB_REF_NAME#v}"
38+
echo "Publishing version $TAG_VERSION from tag $GITHUB_REF_NAME"
39+
npm version "$TAG_VERSION" --no-git-tag-version --allow-same-version
40+
- run: npm run build
41+
- run: npm publish --access public
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Thumbs.db
4141
coverage/
4242
.nyc_output/
4343

44+
# LLM eval reports
45+
tests/eval/reports/
46+
4447
# PM2
4548
.pm2/
4649
CLAUDE.md

README.md

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A Model Context Protocol (MCP) server that provides secure access to the LogicMo
1010

1111
## Features
1212

13-
- **Comprehensive Resource Management**: Devices, device groups, websites, website groups, collectors, alerts, users, dashboards, collector groups, and device metrics
13+
- **Comprehensive Resource Management**: Devices, device groups, websites, website groups, collectors, alerts, users, dashboards, collector groups, device metrics, SDTs, and OpsNotes
1414
- **Device Metrics & Data**: Retrieve monitoring data including datasources, instances, and time-series metrics
1515
- **Batch Operations**: Process multiple items efficiently with rate limiting and error handling
1616
- **Guided Workflows**: Built-in prompts for complex tasks like exporting device metrics
@@ -42,7 +42,7 @@ npm install -g logicmonitor-api-mcp
4242

4343
```bash
4444
# Clone the repository
45-
git clone https://github.com/stevevillardi/logicmonitor-api-mcp.git
45+
git clone https://github.com/LogicMonitor/logicmonitor-api-mcp.git
4646
cd logicmonitor-api-mcp
4747

4848
# Install dependencies
@@ -102,11 +102,12 @@ HTTP mode allows remote access and is suitable for shared deployments:
102102

103103
1. **Start the server:**
104104
```bash
105-
# With environment variables
106-
LM_ACCOUNT=your-account LM_BEARER_TOKEN=your-bearer-token PORT=3000 logicmonitor-api-mcp
105+
# With environment variables (default port is 3000)
106+
LM_ACCOUNT=your-account LM_BEARER_TOKEN=your-bearer-token logicmonitor-api-mcp
107107

108108
# Or use a .env file
109-
echo "PORT=3000" > .env
109+
cp .env.example .env
110+
# Edit .env with your credentials
110111
logicmonitor-api-mcp
111112
```
112113

@@ -269,17 +270,35 @@ Retrieve device monitoring data including datasources, instances, and time-serie
269270
Key features:
270271
- Wildcard filtering for datasources (e.g., `datasourceIncludeFilter: "CPU*"`)
271272
- Batch instance data retrieval (e.g., all CPU cores at once)
272-
- Flexible time ranges (ISO 8601 dates or Unix epochs, defaults to last 24 hours)
273+
- Flexible time ranges (relative strings like `-6h`/`-7d`, ISO 8601 dates, Unix epochs, or `"now"` defaults to last 24 hours)
273274
- Formatted output with timestamps and metric values
274275

276+
#### `lm_sdt`
277+
Manage Scheduled Down Times (maintenance windows):
278+
- **list** - List SDTs with filtering (e.g., `isEffective:true` for active SDTs)
279+
- **get** - Get SDT details by ID (string format, e.g., `"R_42"`)
280+
- **create** - Create one-time or recurring SDTs targeting devices, groups, websites, collectors, or datasources
281+
- **update** - Update SDT schedule, comment, or target
282+
- **delete** - Delete/end SDTs (single or batch)
283+
284+
SDT types: ResourceSDT (device), ResourceGroupSDT, WebsiteSDT, WebsiteGroupSDT, CollectorSDT, DeviceDataSourceSDT, and more.
285+
286+
#### `lm_opsnote`
287+
Manage operational notes for change tracking:
288+
- **list** - List ops notes with filtering (by tags, createdBy, happenedOn, etc.)
289+
- **get** - Get note details by ID
290+
- **create** - Create notes with optional scopes (device, service, deviceGroup, serviceGroup) and tags
291+
- **update** - Update note text, scopes, or tags
292+
- **delete** - Delete notes (single or batch)
293+
275294
#### `lm_session`
276295
Manage session context and variables using standard CRUD operations:
277296

278297
**Operations:**
279298
- **list** - Get session history (recent tool calls)
280299
- Parameters: `limit` (optional, 1-50)
281300
- **get** - Get session context or specific variable
282-
- Parameters: `key` (optional - if omitted, returns full context), `historyLimit`, `includeResults`
301+
- Parameters: `key` (optional - if omitted, returns full context), `fields` (project specific fields from arrays), `index` (single item by position), `limit` (first N items), `historyLimit`, `includeResults`
283302
- **create** - Store a new session variable
284303
- Parameters: `key` (required), `value` (required)
285304
- Use for storing results for batch operations with applyToPrevious
@@ -329,6 +348,26 @@ A comprehensive workflow that guides you through exporting monitoring data from
329348

330349
The prompt will guide the AI through each step, ensuring proper data collection and formatting.
331350

351+
### `batch-device-update`
352+
A guided workflow for finding devices by filter, reviewing them, and applying updates in bulk.
353+
354+
**Arguments:**
355+
- `device_filter` (required) - Filter to select devices (e.g., `"displayName:*prod*"`, `"hostStatus:dead"`)
356+
- `update_description` (required) - Description of what to update (e.g., `"disable alerting"`, `"add custom property env=production"`)
357+
358+
**Workflow Steps:**
359+
1. List devices matching the filter
360+
2. Review matched devices for confirmation
361+
3. Apply batch update via `applyToPrevious`
362+
4. Verify results
363+
364+
### `alert-triage`
365+
A guided workflow for listing, filtering, and triaging LogicMonitor alerts.
366+
367+
**Arguments:**
368+
- `severity_filter` (optional) - Alert severity to focus on: `"critical"`, `"error"`, `"warning"`, or `"all"` (default)
369+
- `resource_filter` (optional) - Filter to scope alerts to specific resources (e.g., `"monitorObjectName:*prod*"`)
370+
332371
## Key Features
333372

334373
### Automatic ID Resolution
@@ -444,6 +483,7 @@ npm run dev
444483

445484
# Build
446485
npm run build
486+
```
447487

448488
### Debug Mode
449489

@@ -458,7 +498,7 @@ LOG_LEVEL=debug logicmonitor-api-mcp
458498
- **Session Management**: Stateful connections with cleanup
459499
- **Rate Limiting**: Automatic retry with exponential backoff
460500
- **Batch Processing**: Concurrent operations with partial failure handling
461-
- **Input Validation**: Joi schemas ensure data integrity
501+
- **Input Validation**: Zod schemas ensure data integrity
462502

463503
## Contributing
464504

THIRD-PARTY-NOTICES.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ The following table summarizes the licenses used by this project's dependencies:
1919

2020
| Package | Version | License | Repository |
2121
|---------|---------|---------|------------|
22-
| @modelcontextprotocol/sdk | 1.20.2 | MIT | https://github.com/modelcontextprotocol/typescript-sdk |
23-
| axios | 1.13.0 | MIT | https://github.com/axios/axios |
24-
| dotenv | 16.6.1 | BSD-2-Clause | https://github.com/motdotla/dotenv |
25-
| express | 5.1.0 | MIT | https://github.com/expressjs/express |
26-
| helmet | 8.1.0 | MIT | https://github.com/helmetjs/helmet |
27-
| joi | 17.13.3 | BSD-3-Clause | https://github.com/hapijs/joi |
28-
| winston | 3.18.3 | MIT | https://github.com/winstonjs/winston |
22+
| @modelcontextprotocol/sdk | ^1.27.1 | MIT | https://github.com/modelcontextprotocol/typescript-sdk |
23+
| axios | ^1.13.6 | MIT | https://github.com/axios/axios |
24+
| dotenv | ^17.3.1 | BSD-2-Clause | https://github.com/motdotla/dotenv |
25+
| express | ^5.2.1 | MIT | https://github.com/expressjs/express |
26+
| express-rate-limit | ^8.3.1 | MIT | https://github.com/express-rate-limit/express-rate-limit |
27+
| winston | ^3.19.0 | MIT | https://github.com/winstonjs/winston |
28+
| zod | ^4.3.6 | MIT | https://github.com/colinhacks/zod |
2929

3030
## License Texts
3131

@@ -108,5 +108,5 @@ https://github.com/LogicMonitor/logicmonitor-api-mcp/issues
108108

109109
---
110110

111-
*Last updated: November 14, 2025*
111+
*Last updated: March 21, 2026*
112112

ecosystem.config.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

jest.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ export default {
3939
coverageReporters: ['text', 'lcov', 'html'],
4040
coverageThreshold: {
4141
global: {
42-
branches: 50,
43-
functions: 50,
44-
lines: 50,
45-
statements: 50,
42+
branches: 70,
43+
functions: 70,
44+
lines: 70,
45+
statements: 70,
4646
},
4747
},
4848
testTimeout: 30000,

0 commit comments

Comments
 (0)