@davidfuchs/mcp-uptime-kuma 0.6.4 → 0.7.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 +76 -449
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +459 -11
- package/dist/server.js.map +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/maintenance.d.ts +70 -0
- package/dist/types/maintenance.d.ts.map +1 -0
- package/dist/types/maintenance.js +22 -0
- package/dist/types/maintenance.js.map +1 -0
- package/dist/types/notification.d.ts +29 -0
- package/dist/types/notification.d.ts.map +1 -0
- package/dist/types/notification.js +14 -0
- package/dist/types/notification.js.map +1 -0
- package/dist/types/status-page.d.ts +46 -0
- package/dist/types/status-page.d.ts.map +1 -0
- package/dist/types/status-page.js +19 -0
- package/dist/types/status-page.js.map +1 -0
- package/dist/uptime-kuma-client.d.ts +110 -1
- package/dist/uptime-kuma-client.d.ts.map +1 -1
- package/dist/uptime-kuma-client.js +324 -4
- package/dist/uptime-kuma-client.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -72
package/README.md
CHANGED
|
@@ -16,54 +16,15 @@ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for [U
|
|
|
16
16
|
|
|
17
17
|
## Features
|
|
18
18
|
|
|
19
|
-
- **
|
|
20
|
-
- **Context-Friendly**:
|
|
21
|
-
- **Multiple Transports**: Supports
|
|
22
|
-
|
|
23
|
-
## Available Tools
|
|
24
|
-
|
|
25
|
-
| Tool | Purpose |
|
|
26
|
-
|------|---------|
|
|
27
|
-
| `getMonitorSummary` | Get a quick overview of all monitors with their current status. Supports filtering by keywords, type, active/maintenance status, tags, and current status. |
|
|
28
|
-
| `listMonitors` | Get the full list of all monitors with configurations. Supports filtering by keywords, type, active/maintenance status, and tags. |
|
|
29
|
-
| `getMonitor` | Get detailed configuration for a specific monitor by ID |
|
|
30
|
-
| `pauseMonitor` | Pause a monitor to stop performing checks |
|
|
31
|
-
| `resumeMonitor` | Resume a paused monitor to restart checks |
|
|
32
|
-
| `listHeartbeats` | Get status check history for all monitors |
|
|
33
|
-
| `getHeartbeats` | Get status check history for a specific monitor |
|
|
34
|
-
| `getSettings` | Get Uptime Kuma server settings |
|
|
35
|
-
|
|
36
|
-
### Filtering
|
|
37
|
-
|
|
38
|
-
Both `getMonitorSummary` and `listMonitors` support powerful filtering options:
|
|
39
|
-
|
|
40
|
-
- **Keywords**: Space-separated keywords for fuzzy matching against monitor pathNames
|
|
41
|
-
- **Type**: Filter by monitor type(s). Comma-separated for multiple types - e.g., `"http"` or `"http,ping,dns"`
|
|
42
|
-
- **Active Status**: Filter by active (`true`) or inactive (`false`) monitors
|
|
43
|
-
- **Maintenance Status**: Filter by maintenance mode status
|
|
44
|
-
- **Tags**: Filter by tag name and optional value. Comma-separated for multiple tags - format: `"tagName"` or `"tagName=value"`. Monitors must have all specified tags.
|
|
45
|
-
- **Status** (getMonitorSummary only): Filter by current heartbeat status. Comma-separated for multiple - `"0"`=DOWN, `"1"`=UP, `"2"`=PENDING, `"3"`=MAINTENANCE
|
|
46
|
-
|
|
47
|
-
**Examples:**
|
|
48
|
-
- Get all DOWN monitors: `getMonitorSummary({ status: "0" })`
|
|
49
|
-
- Get all HTTP monitors in maintenance: `getMonitorSummary({ type: "http", maintenance: true })`
|
|
50
|
-
- Get all inactive monitors with tag "production": `listMonitors({ active: false, tags: "production" })`
|
|
51
|
-
- Get monitors with environment tag set to "staging": `getMonitorSummary({ tags: "env=staging" })`
|
|
52
|
-
- Get monitors with multiple tags: `listMonitors({ tags: "production,region=us-east" })`
|
|
53
|
-
- Get DOWN or PENDING monitors: `getMonitorSummary({ status: "0,2" })`
|
|
54
|
-
- Get HTTP or ping monitors: `getMonitorSummary({ type: "http,ping" })`
|
|
55
|
-
- Get monitors matching "web" or "api": `getMonitorSummary({ keywords: "web api" })`
|
|
56
|
-
|
|
57
|
-
## Example Conversation
|
|
58
|
-
|
|
59
|
-

|
|
60
|
-
*Conversation in [LibreChat](https://github.com/danny-avila/LibreChat) where the `mcp-uptime-kuma` server is providing real-time information from Uptime Kuma.*
|
|
19
|
+
- **Real-time Monitoring**: Access monitors, heartbeats, uptime, and responsiveness metrics via Socket.IO with instant status change notifications.
|
|
20
|
+
- **Context-Friendly**: Returns only essential data by default to avoid overwhelming LLM context windows.
|
|
21
|
+
- **Multiple Transports**: Supports stdio (local) and streamable HTTP (remote) transports.
|
|
61
22
|
|
|
62
23
|
## Quick Start
|
|
63
24
|
|
|
64
25
|
### Using npx (stdio transport)
|
|
65
26
|
|
|
66
|
-
|
|
27
|
+
Add this to your MCP client configuration:
|
|
67
28
|
|
|
68
29
|
```json
|
|
69
30
|
{
|
|
@@ -74,48 +35,16 @@ Most folks will want to configure mcp-uptime-kuma using stdio as follows.
|
|
|
74
35
|
"env": {
|
|
75
36
|
"UPTIME_KUMA_URL": "http://your-uptime-kuma-instance:3001",
|
|
76
37
|
"UPTIME_KUMA_USERNAME": "your_username",
|
|
77
|
-
"UPTIME_KUMA_PASSWORD": "your_password"
|
|
38
|
+
"UPTIME_KUMA_PASSWORD": "your_password"
|
|
78
39
|
}
|
|
79
40
|
}
|
|
80
41
|
}
|
|
81
42
|
}
|
|
82
43
|
```
|
|
83
44
|
|
|
84
|
-
If authentication is disabled on your Uptime Kuma instance, you can remove the username/password environment variables. See the [Usage Instructions](#usage-instructions) section for more details on authentication methods.
|
|
85
|
-
|
|
86
45
|
### Using Docker (streamable HTTP transport)
|
|
87
46
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
**Option 1: Using Docker Compose**
|
|
91
|
-
|
|
92
|
-
Create a `docker-compose.yml` file:
|
|
93
|
-
|
|
94
|
-
```yaml
|
|
95
|
-
services:
|
|
96
|
-
mcp-uptime-kuma:
|
|
97
|
-
image: davidfuchs/mcp-uptime-kuma:latest
|
|
98
|
-
container_name: mcp-uptime-kuma
|
|
99
|
-
environment:
|
|
100
|
-
- UPTIME_KUMA_URL=http://your-uptime-kuma-instance:3001
|
|
101
|
-
- UPTIME_KUMA_USERNAME=your_username # Optional
|
|
102
|
-
- UPTIME_KUMA_PASSWORD=your_password # Optional
|
|
103
|
-
# OR use JWT token authentication:
|
|
104
|
-
# - UPTIME_KUMA_JWT_TOKEN=your_jwt_token
|
|
105
|
-
- PORT=3000 # Optional, defaults to 3000
|
|
106
|
-
ports:
|
|
107
|
-
- "3000:3000"
|
|
108
|
-
command: ["-t", "streamable-http"]
|
|
109
|
-
restart: unless-stopped
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Then run:
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
docker compose up -d
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
**Option 2: Using Docker Run**
|
|
47
|
+
**Option 1: Docker Run**
|
|
119
48
|
|
|
120
49
|
```bash
|
|
121
50
|
docker run -d \
|
|
@@ -128,429 +57,127 @@ docker run -d \
|
|
|
128
57
|
-t streamable-http
|
|
129
58
|
```
|
|
130
59
|
|
|
131
|
-
|
|
60
|
+
**Option 2: Docker Compose**
|
|
132
61
|
|
|
133
|
-
|
|
62
|
+
A [docker-compose.yml](docker-compose.yml) file is provided in the repository. Download it, configure your environment variables, and run:
|
|
134
63
|
|
|
135
|
-
|
|
64
|
+
```bash
|
|
65
|
+
docker compose up -d
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Then configure your MCP client to connect to the endpoint:
|
|
136
69
|
|
|
137
70
|
```json
|
|
138
71
|
{
|
|
139
72
|
"mcpServers": {
|
|
140
73
|
"uptime-kuma": {
|
|
141
|
-
"url": "http://
|
|
74
|
+
"url": "http://localhost:3000/mcp"
|
|
142
75
|
}
|
|
143
76
|
}
|
|
144
77
|
}
|
|
145
78
|
```
|
|
146
79
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
```yaml
|
|
150
|
-
mcpServers:
|
|
151
|
-
uptime-kuma:
|
|
152
|
-
type: streamable-http
|
|
153
|
-
url: "http://mcp-uptime-kuma:3000/mcp"
|
|
154
|
-
serverInstructions: true
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
## Usage Instructions
|
|
158
|
-
|
|
159
|
-
### Prerequisites
|
|
160
|
-
|
|
161
|
-
- Node.js (v18 or higher)
|
|
162
|
-
- An Uptime Kuma instance (version 2)
|
|
163
|
-
|
|
164
|
-
### Authentication Methods
|
|
80
|
+
See [Authentication Methods](#authentication-methods) for JWT token and anonymous authentication options.
|
|
165
81
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
> **A note about 2FA:** If you're using 2FA, it's recommended that you go straight for the JWT authentication approach and avoid username/password authentication, as your 2FA token will need to be refreshed every time you initialize the MCP server.
|
|
169
|
-
>
|
|
170
|
-
> Even with the JWT method, you may run into issues with token expiry, but as of this writing the JWT returned by Uptime Kuma does not appear to expire.
|
|
82
|
+
## Example Conversation
|
|
171
83
|
|
|
172
|
-
|
|
173
|
-
|
|
84
|
+

|
|
85
|
+
*Conversation in [LibreChat](https://github.com/danny-avila/LibreChat) where the `mcp-uptime-kuma` server is providing real-time information from Uptime Kuma.*
|
|
174
86
|
|
|
175
|
-
|
|
176
|
-
- `UPTIME_KUMA_URL`: The URL of your Uptime Kuma instance
|
|
87
|
+
## Available Tools
|
|
177
88
|
|
|
178
|
-
|
|
179
|
-
|
|
89
|
+
| Tool | Purpose |
|
|
90
|
+
|------|---------|
|
|
91
|
+
| `getMonitorSummary` | Get a quick overview of all monitors with their current status. Supports filtering. |
|
|
92
|
+
| `listMonitors` | Get the full list of all monitors with configurations. Supports filtering. |
|
|
93
|
+
| `listMonitorTypes` | Get all available monitor types supported by Uptime Kuma. |
|
|
94
|
+
| `getMonitor` | Get detailed configuration for a specific monitor by ID. |
|
|
95
|
+
| `pauseMonitor` | Pause a monitor to stop performing checks. |
|
|
96
|
+
| `resumeMonitor` | Resume a paused monitor to restart checks. |
|
|
97
|
+
| `listHeartbeats` | Get status check history for all monitors. |
|
|
98
|
+
| `getHeartbeats` | Get status check history for a specific monitor. |
|
|
99
|
+
| `getSettings` | Get Uptime Kuma server settings. |
|
|
180
100
|
|
|
181
|
-
|
|
182
|
-
- `UPTIME_KUMA_URL`: The URL of your Uptime Kuma instance
|
|
183
|
-
- `UPTIME_KUMA_USERNAME`: Your Uptime Kuma username
|
|
184
|
-
- `UPTIME_KUMA_PASSWORD`: Your Uptime Kuma password
|
|
185
|
-
|
|
186
|
-
- **Optional Variable:**
|
|
187
|
-
- `UPTIME_KUMA_2FA_TOKEN`: Your 2FA token (only required if two-factor authentication is enabled on your account)
|
|
101
|
+
### Filtering
|
|
188
102
|
|
|
189
|
-
|
|
190
|
-
Token-based authentication using a JWT token from Uptime Kuma. This method uses the `UPTIME_KUMA_JWT_TOKEN` environment variable and takes precedence over username/password if both are provided.
|
|
103
|
+
`getMonitorSummary` and `listMonitors` support filtering by:
|
|
191
104
|
|
|
192
|
-
- **
|
|
193
|
-
|
|
194
|
-
|
|
105
|
+
- **keywords**: Space-separated keywords for fuzzy matching against monitor pathNames
|
|
106
|
+
- **type**: Monitor type(s), comma-separated (e.g., `"http"`, `"http,ping,dns"`)
|
|
107
|
+
- **active**: Filter by active (`true`) or inactive (`false`) monitors
|
|
108
|
+
- **maintenance**: Filter by maintenance mode status
|
|
109
|
+
- **tags**: Tag name and optional value, comma-separated (e.g., `"production"`, `"env=staging"`)
|
|
110
|
+
- **status** (getMonitorSummary only): Heartbeat status (`"0"`=DOWN, `"1"`=UP, `"2"`=PENDING, `"3"`=MAINTENANCE)
|
|
195
111
|
|
|
196
|
-
|
|
112
|
+
**Examples:**
|
|
113
|
+
```javascript
|
|
114
|
+
getMonitorSummary({ status: "0" }) // All DOWN monitors
|
|
115
|
+
getMonitorSummary({ type: "http", maintenance: true }) // HTTP monitors in maintenance
|
|
116
|
+
listMonitors({ tags: "production,region=us-east" }) // Monitors with specific tags
|
|
117
|
+
```
|
|
197
118
|
|
|
198
|
-
|
|
119
|
+
## Authentication Methods
|
|
199
120
|
|
|
200
|
-
|
|
121
|
+
### Anonymous Authentication
|
|
122
|
+
If authentication is disabled on your Uptime Kuma instance, only `UPTIME_KUMA_URL` is required.
|
|
201
123
|
|
|
202
|
-
|
|
203
|
-
|
|
124
|
+
### Username/Password Authentication
|
|
125
|
+
```
|
|
126
|
+
UPTIME_KUMA_URL=http://your-instance:3001
|
|
127
|
+
UPTIME_KUMA_USERNAME=your_username
|
|
128
|
+
UPTIME_KUMA_PASSWORD=your_password
|
|
129
|
+
UPTIME_KUMA_2FA_TOKEN=123456 # Optional, only if 2FA is enabled
|
|
204
130
|
```
|
|
205
131
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
# Without 2FA
|
|
209
|
-
npx -p @davidfuchs/mcp-uptime-kuma mcp-uptime-kuma-get-jwt http://localhost:3001 admin mypassword
|
|
132
|
+
### JWT Token Authentication
|
|
133
|
+
Recommended for 2FA users. Takes precedence over username/password if both are provided.
|
|
210
134
|
|
|
211
|
-
|
|
212
|
-
|
|
135
|
+
```
|
|
136
|
+
UPTIME_KUMA_URL=http://your-instance:3001
|
|
137
|
+
UPTIME_KUMA_JWT_TOKEN=your_jwt_token
|
|
213
138
|
```
|
|
214
139
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
You can also use the Docker image to retrieve the JWT token:
|
|
140
|
+
#### Obtaining Your JWT Token
|
|
218
141
|
|
|
142
|
+
**Using the CLI utility (recommended):**
|
|
219
143
|
```bash
|
|
220
|
-
|
|
144
|
+
npx -p @davidfuchs/mcp-uptime-kuma mcp-uptime-kuma-get-jwt http://localhost:3001 admin mypassword
|
|
221
145
|
```
|
|
222
146
|
|
|
223
|
-
**
|
|
147
|
+
**Using Docker:**
|
|
224
148
|
```bash
|
|
225
|
-
# Without 2FA
|
|
226
149
|
docker run --rm davidfuchs/mcp-uptime-kuma:latest get-jwt http://host.docker.internal:3001 admin mypassword
|
|
227
|
-
|
|
228
|
-
# With 2FA
|
|
229
|
-
docker run --rm davidfuchs/mcp-uptime-kuma:latest get-jwt http://host.docker.internal:3001 admin mypassword 123456
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
> **Note:** If Docker and your Uptime Kuma instance are on the same machine, use `http://host.docker.internal:3001` instead of `http://localhost:3001` to access the host machine from within the container.
|
|
233
|
-
|
|
234
|
-
**Method 3: Extract from Browser**
|
|
235
|
-
|
|
236
|
-
1. Log into your Uptime Kuma instance in your web browser
|
|
237
|
-
2. Open your browser's Developer Tools (F12 or right-click → Inspect)
|
|
238
|
-
3. Navigate to the **Storage** tab (Firefox) or **Application** tab (Chrome/Edge)
|
|
239
|
-
4. Under **Local Storage** find your Uptime Kuma domain
|
|
240
|
-
5. Look for a key named `token` - the value is your JWT token (it should start with 'ey...')
|
|
241
|
-
6. Copy the token value and use it as `UPTIME_KUMA_JWT_TOKEN`
|
|
242
|
-
|
|
243
|
-
### Setting up mcp-uptime-kuma using the stdio transport
|
|
244
|
-
|
|
245
|
-
For many MCP clients, you can configure the server as follows:
|
|
246
|
-
|
|
247
|
-
**Option 1: Username/Password Authentication**
|
|
248
|
-
```json
|
|
249
|
-
{
|
|
250
|
-
"mcpServers": {
|
|
251
|
-
"uptime-kuma": {
|
|
252
|
-
"command": "npx",
|
|
253
|
-
"args": ["-y", "@davidfuchs/mcp-uptime-kuma"],
|
|
254
|
-
"env": {
|
|
255
|
-
"UPTIME_KUMA_URL": "http://your-uptime-kuma-instance:3001",
|
|
256
|
-
"UPTIME_KUMA_USERNAME": "your_username",
|
|
257
|
-
"UPTIME_KUMA_PASSWORD": "your_password",
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
**Option 2: JWT Token Authentication**
|
|
265
|
-
```json
|
|
266
|
-
{
|
|
267
|
-
"mcpServers": {
|
|
268
|
-
"uptime-kuma": {
|
|
269
|
-
"command": "npx",
|
|
270
|
-
"args": ["-y", "@davidfuchs/mcp-uptime-kuma"],
|
|
271
|
-
"env": {
|
|
272
|
-
"UPTIME_KUMA_URL": "http://your-uptime-kuma-instance:3001",
|
|
273
|
-
"UPTIME_KUMA_JWT_TOKEN": "your_jwt_token"
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
150
|
```
|
|
279
151
|
|
|
280
|
-
|
|
152
|
+
**From browser:** Open Developer Tools → Storage/Application → Local Storage → find `token` key.
|
|
281
153
|
|
|
282
|
-
|
|
154
|
+
## LibreChat Configuration
|
|
283
155
|
|
|
284
|
-
**
|
|
156
|
+
**stdio transport:**
|
|
285
157
|
```yaml
|
|
286
158
|
mcpServers:
|
|
287
|
-
uptime-kuma:
|
|
288
|
-
command: npx
|
|
289
|
-
args: ["-y", "@davidfuchs/mcp-uptime-kuma"]
|
|
290
|
-
customUserVars:
|
|
291
|
-
UPTIME_KUMA_URL:
|
|
292
|
-
title: "Uptime Kuma URL"
|
|
293
|
-
description: "The URL to log into Uptime Kuma."
|
|
294
|
-
UPTIME_KUMA_USERNAME:
|
|
295
|
-
title: "Uptime Kuma Username"
|
|
296
|
-
description: "The username to log into Uptime Kuma."
|
|
297
|
-
UPTIME_KUMA_PASSWORD:
|
|
298
|
-
title: "Uptime Kuma Password"
|
|
299
|
-
description: "The password to log into Uptime Kuma."
|
|
159
|
+
uptime-kuma:
|
|
160
|
+
command: npx
|
|
161
|
+
args: ["-y", "@davidfuchs/mcp-uptime-kuma"]
|
|
300
162
|
env:
|
|
301
|
-
UPTIME_KUMA_URL: "
|
|
302
|
-
UPTIME_KUMA_USERNAME: "
|
|
303
|
-
UPTIME_KUMA_PASSWORD: "
|
|
163
|
+
UPTIME_KUMA_URL: "http://your-instance:3001"
|
|
164
|
+
UPTIME_KUMA_USERNAME: "your_username"
|
|
165
|
+
UPTIME_KUMA_PASSWORD: "your_password"
|
|
304
166
|
serverInstructions: true
|
|
305
|
-
startup: false
|
|
306
167
|
```
|
|
307
168
|
|
|
308
|
-
**
|
|
169
|
+
**streamable HTTP transport:**
|
|
309
170
|
```yaml
|
|
310
171
|
mcpServers:
|
|
311
172
|
uptime-kuma:
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
customUserVars:
|
|
315
|
-
UPTIME_KUMA_URL:
|
|
316
|
-
title: "Uptime Kuma URL"
|
|
317
|
-
description: "The URL to log into Uptime Kuma."
|
|
318
|
-
UPTIME_KUMA_JWT_TOKEN:
|
|
319
|
-
title: "Uptime Kuma JWT Token"
|
|
320
|
-
description: "JWT token for Uptime Kuma authentication."
|
|
321
|
-
env:
|
|
322
|
-
UPTIME_KUMA_URL: "{{UPTIME_KUMA_URL}}"
|
|
323
|
-
UPTIME_KUMA_JWT_TOKEN: "{{UPTIME_KUMA_JWT_TOKEN}}"
|
|
173
|
+
type: streamable-http
|
|
174
|
+
url: "http://mcp-uptime-kuma:3000/mcp"
|
|
324
175
|
serverInstructions: true
|
|
325
|
-
startup: false
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
See the [How to Find Your JWT Token](#how-to-find-your-jwt-token) section for instructions on how to obtain it.
|
|
329
|
-
|
|
330
|
-
If you're the only one using the LibreChat server, you can remove `customUserVars` and set the environment variables directly in the `env` section. You can also remove `startup: false` - that's only in there because without it, LibreChat tries to start the mcp-uptime-kuma MCP server immediately on startup, which fails because the user-provided credentials aren't available yet.
|
|
331
|
-
|
|
332
|
-
### Setting up mcp-uptime-kuma using the streamable HTTP transport
|
|
333
|
-
|
|
334
|
-
The recommended way to run the MCP server using streamable HTTP is to run it as a Docker container.
|
|
335
|
-
|
|
336
|
-
A [docker-compose.yml](docker-compose.yml) file is provided in the Github repository. Download it and update the included environment variables as needed for your Uptime Kuma deployment, and run:
|
|
337
|
-
|
|
338
|
-
`docker compose up -d`
|
|
339
|
-
|
|
340
|
-
The MCP endpoint will be available on your Docker host at port 3000 (configurable via `PORT` environment variable). If you'd prefer to run it directly on your host machine, see the Development Usage section below.
|
|
341
|
-
|
|
342
|
-
## Detailed Tool Descriptions
|
|
343
|
-
|
|
344
|
-
### getMonitorSummary
|
|
345
|
-
Retrieves a summarized list of all monitors with essential information and their current status.
|
|
346
|
-
|
|
347
|
-
- **Input**:
|
|
348
|
-
- `keywords` (string, optional): Space-separated keywords to filter monitors by pathName (case-insensitive fuzzy match). All keywords must match for a monitor to be included.
|
|
349
|
-
- `type` (string, optional): Filter by monitor type(s). Comma-separated for multiple types. Examples: `"http"`, `"http,ping,dns"`, `"port,docker"`
|
|
350
|
-
- `active` (boolean, optional): Filter by active status. `true`=only active monitors, `false`=only inactive monitors
|
|
351
|
-
- `maintenance` (boolean, optional): Filter by maintenance status. `true`=only monitors in maintenance, `false`=only monitors not in maintenance
|
|
352
|
-
- `tags` (string, optional): Filter by tag name and optional value. Comma-separated for multiple tags. Format: `"tagName"` or `"tagName=value"`. Monitor must have all specified tags. Case-insensitive. Examples: `"production"`, `"env=staging"`, `"production,region=us-east"`
|
|
353
|
-
- `status` (string, optional): Filter by current heartbeat status. Comma-separated for multiple statuses. `"0"`=DOWN, `"1"`=UP, `"2"`=PENDING, `"3"`=MAINTENANCE. Examples: `"0"`, `"0,2"`
|
|
354
|
-
- **Output**: Array of monitor summaries with:
|
|
355
|
-
- Monitor ID, name, pathName
|
|
356
|
-
- Monitor type
|
|
357
|
-
- Active and maintenance state
|
|
358
|
-
- Most recent heartbeat status (0=DOWN, 1=UP, 2=PENDING, 3=MAINTENANCE)
|
|
359
|
-
- Status message from the most recent heartbeat
|
|
360
|
-
- Associated tags
|
|
361
|
-
- Uptime percentages for different periods (24h, 720h, 1y)
|
|
362
|
-
- Average ping in milliseconds
|
|
363
|
-
- Total count of matching monitors
|
|
364
|
-
|
|
365
|
-
### getMonitor
|
|
366
|
-
Retrieves detailed information about a specific monitor by its ID.
|
|
367
|
-
|
|
368
|
-
- **Input**:
|
|
369
|
-
- `monitorID` (number): The ID of the monitor to retrieve
|
|
370
|
-
- `includeAdditionalFields` (boolean, optional): Include all additional fields from Uptime Kuma (default: false)
|
|
371
|
-
- **Output**: Monitor configuration object with details like URL, type, check interval, notification settings, etc.
|
|
372
|
-
|
|
373
|
-
### listMonitors
|
|
374
|
-
Retrieves the full list of all monitors the user has access to with their configuration details.
|
|
375
|
-
|
|
376
|
-
- **Input**:
|
|
377
|
-
- `includeAdditionalFields` (boolean, optional): Include all additional fields from Uptime Kuma (default: false)
|
|
378
|
-
- `keywords` (string, optional): Space-separated keywords to filter monitors by pathName (case-insensitive fuzzy match). All keywords must match for a monitor to be included.
|
|
379
|
-
- `type` (string, optional): Filter by monitor type(s). Comma-separated for multiple types. Examples: `"http"`, `"http,ping,dns"`, `"port,docker"`
|
|
380
|
-
- `active` (boolean, optional): Filter by active status. `true`=only active monitors, `false`=only inactive monitors
|
|
381
|
-
- `maintenance` (boolean, optional): Filter by maintenance status. `true`=only monitors in maintenance, `false`=only monitors not in maintenance
|
|
382
|
-
- `tags` (string, optional): Filter by tag name and optional value. Comma-separated for multiple tags. Format: `"tagName"` or `"tagName=value"`. Monitor must have all specified tags. Case-insensitive. Examples: `"production"`, `"env=staging"`, `"production,region=us-east"`
|
|
383
|
-
- **Output**: Array of monitor configuration objects with:
|
|
384
|
-
- All monitor settings (URL, check interval, retry settings, notification configuration, etc.)
|
|
385
|
-
- Tags and pathName
|
|
386
|
-
- Uptime percentages and average ping
|
|
387
|
-
- Total count of matching monitors
|
|
388
|
-
|
|
389
|
-
### getHeartbeats
|
|
390
|
-
Retrieves heartbeats (status checks) for a specific monitor.
|
|
391
|
-
|
|
392
|
-
- **Input**:
|
|
393
|
-
- `monitorID` (number): The ID of the monitor to get heartbeats for
|
|
394
|
-
- `maxHeartbeats` (number, optional): Maximum number of most recent heartbeats to return (1-100). Default: 1
|
|
395
|
-
- **Output**: Object containing:
|
|
396
|
-
- `monitorID`: The monitor ID
|
|
397
|
-
- `heartbeats`: Array of heartbeat objects with status, response time, timestamps, etc.
|
|
398
|
-
- `count`: Number of heartbeats returned
|
|
399
|
-
|
|
400
|
-
### listHeartbeats
|
|
401
|
-
Retrieves the heartbeats for all monitors.
|
|
402
|
-
|
|
403
|
-
- **Input**:
|
|
404
|
-
- `maxHeartbeats` (number, optional): Maximum number of most recent heartbeats per monitor (1-100). Default: 1
|
|
405
|
-
- **Output**: Object containing:
|
|
406
|
-
- `heartbeats`: Map of monitor IDs to their heartbeat arrays
|
|
407
|
-
- `monitorCount`: Number of monitors
|
|
408
|
-
- `totalHeartbeatCount`: Total number of heartbeats across all monitors
|
|
409
|
-
|
|
410
|
-
### getSettings
|
|
411
|
-
Retrieves the current Uptime Kuma server settings.
|
|
412
|
-
|
|
413
|
-
- **Input**: None
|
|
414
|
-
- **Output**: Settings object containing:
|
|
415
|
-
- `serverTimezone`: Server timezone setting
|
|
416
|
-
- `checkUpdate`: Whether to check for updates
|
|
417
|
-
- `searchEngineIndex`: Search engine indexing setting
|
|
418
|
-
- `entryPage`: Entry page configuration
|
|
419
|
-
- `dnsCache`: DNS cache setting
|
|
420
|
-
- `keepDataPeriodDays`: Data retention period in days
|
|
421
|
-
- `tlsExpiryNotifyDays`: TLS expiry notification days
|
|
422
|
-
- `trustProxy`: Trust proxy setting
|
|
423
|
-
- `nscd`: NSCD setting
|
|
424
|
-
- `disableAuth`: Authentication disabled status
|
|
425
|
-
- `primaryBaseURL`: Primary base URL (optional)
|
|
426
|
-
|
|
427
|
-
### pauseMonitor
|
|
428
|
-
Pauses a monitor, stopping it from performing checks. The monitor will remain in the system but will not send notifications or collect data until resumed.
|
|
429
|
-
|
|
430
|
-
- **Input**:
|
|
431
|
-
- `monitorID` (number): The ID of the monitor to pause
|
|
432
|
-
- **Output**: Object containing:
|
|
433
|
-
- `ok`: Boolean indicating success
|
|
434
|
-
- `msg`: Optional status message
|
|
435
|
-
|
|
436
|
-
### resumeMonitor
|
|
437
|
-
Resumes a paused monitor, restarting its checks and notifications.
|
|
438
|
-
|
|
439
|
-
- **Input**:
|
|
440
|
-
- `monitorID` (number): The ID of the monitor to resume
|
|
441
|
-
- **Output**: Object containing:
|
|
442
|
-
- `ok`: Boolean indicating success
|
|
443
|
-
- `msg`: Optional status message
|
|
444
|
-
|
|
445
|
-
## Developing
|
|
446
|
-
|
|
447
|
-
To run locally, clone the repository and follow these steps:
|
|
448
|
-
|
|
449
|
-
### Install dependencies
|
|
450
|
-
|
|
451
|
-
```bash
|
|
452
|
-
npm install
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
### Create the environment configuration
|
|
456
|
-
|
|
457
|
-
Copy [.env.example](.env.example) to `.env` and configure the required environment variables for your Uptime Kuma instance (URL and authentication method).
|
|
458
|
-
|
|
459
|
-
## Building
|
|
460
|
-
|
|
461
|
-
Build the TypeScript code to JavaScript:
|
|
462
|
-
|
|
463
|
-
```bash
|
|
464
|
-
npm run build
|
|
465
|
-
```
|
|
466
|
-
|
|
467
|
-
For development with auto-rebuild:
|
|
468
|
-
|
|
469
|
-
```bash
|
|
470
|
-
npm run watch
|
|
471
|
-
```
|
|
472
|
-
|
|
473
|
-
## Running
|
|
474
|
-
|
|
475
|
-
### Default (stdio Transport)
|
|
476
|
-
|
|
477
|
-
Run in production mode (requires build first):
|
|
478
|
-
|
|
479
|
-
```bash
|
|
480
|
-
npm start
|
|
481
|
-
```
|
|
482
|
-
|
|
483
|
-
or
|
|
484
|
-
|
|
485
|
-
```bash
|
|
486
|
-
npm run start:stdio
|
|
487
|
-
```
|
|
488
|
-
|
|
489
|
-
This mode is designed to be spawned by MCP clients (like Claude Desktop, VS Code, etc.) that communicate via standard input/output.
|
|
490
|
-
|
|
491
|
-
### Streamable HTTP Transport (for remote access)
|
|
492
|
-
|
|
493
|
-
Run in production mode (requires build first):
|
|
494
|
-
|
|
495
|
-
```bash
|
|
496
|
-
npm run start:http
|
|
497
|
-
```
|
|
498
|
-
|
|
499
|
-
By default, the HTTP server runs on port 3000. You can change this with the `PORT` environment variable:
|
|
500
|
-
|
|
501
|
-
```bash
|
|
502
|
-
PORT=8080 npm run start:http
|
|
503
|
-
```
|
|
504
|
-
|
|
505
|
-
The MCP endpoint will be available at `http://localhost:3000/mcp`
|
|
506
|
-
|
|
507
|
-
## Testing
|
|
508
|
-
|
|
509
|
-
You can test the server using the MCP Inspector:
|
|
510
|
-
|
|
511
|
-
```bash
|
|
512
|
-
npm run inspector
|
|
513
|
-
```
|
|
514
|
-
|
|
515
|
-
### For HTTP transport:
|
|
516
|
-
Start the HTTP server:
|
|
517
|
-
```bash
|
|
518
|
-
npm run dev:http
|
|
519
|
-
```
|
|
520
|
-
|
|
521
|
-
Then use the MCP Inspector:
|
|
522
|
-
```bash
|
|
523
|
-
npx @modelcontextprotocol/inspector
|
|
524
|
-
```
|
|
525
|
-
Connect to: `http://localhost:3000/mcp`
|
|
526
|
-
|
|
527
|
-
## Project Structure
|
|
528
|
-
|
|
529
|
-
```
|
|
530
|
-
mcp-uptime-kuma/
|
|
531
|
-
├── src/
|
|
532
|
-
│ ├── index.ts # Main entry point with transport selection
|
|
533
|
-
│ ├── server.ts # Core MCP server configuration with tools
|
|
534
|
-
│ ├── uptime-kuma-client.ts # WebSocket client for Uptime Kuma API
|
|
535
|
-
│ ├── types.ts # TypeScript type definitions
|
|
536
|
-
│ └── version.ts # Runtime version information
|
|
537
|
-
├── .github/ # GitHub workflows and configurations
|
|
538
|
-
├── .vscode/ # VS Code workspace settings
|
|
539
|
-
├── docker-compose.yml # Docker Compose configuration
|
|
540
|
-
├── Dockerfile # Docker image definition
|
|
541
|
-
├── .dockerignore # Docker ignore file
|
|
542
|
-
├── .env.example # Example environment configuration
|
|
543
|
-
├── .gitignore # Git ignore file
|
|
544
|
-
├── package.json # Project dependencies and scripts
|
|
545
|
-
├── package-lock.json # Locked dependency versions
|
|
546
|
-
├── tsconfig.json # TypeScript configuration
|
|
547
|
-
├── LICENSE # License file
|
|
548
|
-
└── README.md # This file
|
|
549
176
|
```
|
|
550
177
|
|
|
551
|
-
##
|
|
178
|
+
## Contributing
|
|
552
179
|
|
|
553
|
-
|
|
180
|
+
For development setup, building, testing, and project structure, see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
554
181
|
|
|
555
182
|
## Learn More
|
|
556
183
|
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,kBAAkB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,kBAAkB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CA2gC9J"}
|