@davidfuchs/mcp-uptime-kuma 0.3.2 → 0.4.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 +220 -87
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -16
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +1 -8
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +35 -12
- package/dist/server.js.map +1 -1
- package/dist/types.d.ts +102 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +69 -37
- package/dist/types.js.map +1 -1
- package/dist/uptime-kuma-client.d.ts +22 -4
- package/dist/uptime-kuma-client.d.ts.map +1 -1
- package/dist/uptime-kuma-client.js +128 -14
- package/dist/uptime-kuma-client.js.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,87 +2,113 @@
|
|
|
2
2
|
|
|
3
3
|
A Model Context Protocol (MCP) server for [Uptime Kuma](https://github.com/louislam/uptime-kuma) *version 2*, built with TypeScript and supporting both stdio and streamable HTTP transports.
|
|
4
4
|
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+
|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
16
|
+
|
|
5
17
|
## Features
|
|
6
18
|
|
|
7
|
-
- **Uptime Kuma Integration**: Real-time access to monitors and heartbeats via WebSocket connection. This MCP server is immediately notified of status changes in Uptime Kuma.
|
|
19
|
+
- **Uptime Kuma Integration**: Real-time access to monitors and heartbeats via WebSocket connection. This MCP server is immediately notified of status changes in Uptime Kuma and caches this information for fast retrieval.
|
|
8
20
|
- **Context-Friendly**: Carefully controls the amount of data returned to avoid overwhelming the LLM context window. Tools default to returning only essential fields and recent heartbeats, with options to request more when needed.
|
|
9
21
|
- **Multiple Transports**: Supports both stdio (for local integration) and streamable HTTP (for remote access).
|
|
10
|
-
- **MCP SDK**: Uses the official `@modelcontextprotocol/sdk` package
|
|
11
|
-
- **Comprehensive Tools**: Retrieve monitor configurations and status data (heartbeats)
|
|
12
22
|
|
|
13
23
|
## Available Tools
|
|
14
24
|
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
| Tool | Purpose |
|
|
26
|
+
|------|---------|
|
|
27
|
+
| `getMonitorSummary` | Get a quick overview of all monitors with their current status |
|
|
28
|
+
| `getMonitor` | Get detailed configuration for a specific monitor by ID |
|
|
29
|
+
| `listMonitors` | Get the full list of all monitors with configurations |
|
|
30
|
+
| `getHeartbeats` | Get status check history for a specific monitor |
|
|
31
|
+
| `listHeartbeats` | Get status check history for all monitors |
|
|
32
|
+
| `getSettings` | Get Uptime Kuma server settings |
|
|
17
33
|
|
|
18
|
-
|
|
19
|
-
- `keywords` (string, optional): Space-separated keywords to filter monitors by pathName (case-insensitive). All keywords must match for a monitor to be included.
|
|
20
|
-
- **Output**: Array of monitor summaries with:
|
|
21
|
-
- Monitor ID, name, pathName
|
|
22
|
-
- Active and maintenance state
|
|
23
|
-
- Most recent heartbeat status (0=DOWN, 1=UP, 2=PENDING, 3=MAINTENANCE)
|
|
24
|
-
- Status message from the most recent heartbeat
|
|
25
|
-
- Total count of matching monitors
|
|
34
|
+
## Quick Start
|
|
26
35
|
|
|
27
|
-
|
|
28
|
-
Retrieves detailed information about a specific monitor by its ID.
|
|
36
|
+
Most folks will want to configure mcp-uptime-kuma using stdio as follows.
|
|
29
37
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"uptime-kuma": {
|
|
42
|
+
"command": "npx",
|
|
43
|
+
"args": ["-y", "@davidfuchs/mcp-uptime-kuma"],
|
|
44
|
+
"env": {
|
|
45
|
+
"UPTIME_KUMA_URL": "http://your-uptime-kuma-instance:3001",
|
|
46
|
+
"UPTIME_KUMA_USERNAME": "your_username",
|
|
47
|
+
"UPTIME_KUMA_PASSWORD": "your_password",
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
34
53
|
|
|
35
|
-
|
|
36
|
-
Retrieves the full list of all monitors the user has access to.
|
|
54
|
+
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.
|
|
37
55
|
|
|
38
|
-
|
|
39
|
-
- `includeAdditionalFields` (boolean, optional): Include all additional fields from Uptime Kuma (default: false)
|
|
40
|
-
- **Output**: Array of monitor objects with count
|
|
56
|
+
## Usage Instructions
|
|
41
57
|
|
|
42
|
-
###
|
|
43
|
-
Retrieves heartbeats (status checks) for a specific monitor.
|
|
58
|
+
### Prerequisites
|
|
44
59
|
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
- **Output**: Object containing:
|
|
49
|
-
- `monitorID`: The monitor ID
|
|
50
|
-
- `heartbeats`: Array of heartbeat objects with status, response time, timestamps, etc.
|
|
51
|
-
- `count`: Number of heartbeats returned
|
|
60
|
+
- Node.js (v18 or higher)
|
|
61
|
+
- An Uptime Kuma instance (version 2)
|
|
62
|
+
- Environment variables for configuration (see Configuration section)
|
|
52
63
|
|
|
53
|
-
###
|
|
54
|
-
Retrieves the heartbeats for all monitors.
|
|
64
|
+
### Authentication Methods
|
|
55
65
|
|
|
56
|
-
|
|
57
|
-
- `maxHeartbeats` (number, optional): Maximum number of most recent heartbeats per monitor (1-100). Default: 1
|
|
58
|
-
- **Output**: Object containing:
|
|
59
|
-
- `heartbeats`: Map of monitor IDs to their heartbeat arrays
|
|
60
|
-
- `monitorCount`: Number of monitors
|
|
61
|
-
- `totalHeartbeatCount`: Total number of heartbeats across all monitors
|
|
66
|
+
This MCP server supports three authentication methods for connecting to your Uptime Kuma instance.
|
|
62
67
|
|
|
63
|
-
|
|
68
|
+
> *A note about 2FA:* If you're using 2FA, it's recommended that you avoid username/password authentication and go straight for the JWT approach, as your 2FA token will need to be refreshed every time you initialize the MCP server. Even with the JWT method, you may still run into issues depending on how Uptime Kuma handles token expiry. As of this writing, the JWT returned by Uptime Kuma does not contain an expiry claim, so you may be fine, but be aware of potential issues. Hopefully future versions of Uptime Kuma will allow API keys to be used for the Socket.IO interface (API keys are currently only used for reading Prometheus metrics).
|
|
64
69
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- To check if something is **up or down**, use the heartbeat tools, not the monitor tools
|
|
68
|
-
- Use **getMonitorSummary** for a quick overview of all monitors and their current status
|
|
69
|
-
- By default, monitor tools return only essential fields. Set `includeAdditionalFields=true` to get all available data
|
|
70
|
-
- By default, heartbeat tools return only the most recent heartbeat. Use `maxHeartbeats` to retrieve more historical data
|
|
70
|
+
#### 1. Username/Password Authentication
|
|
71
|
+
Standard authentication using your Uptime Kuma credentials. This method uses the `UPTIME_KUMA_USERNAME` and `UPTIME_KUMA_PASSWORD` environment variables.
|
|
71
72
|
|
|
72
|
-
|
|
73
|
+
- **Required Variables:**
|
|
74
|
+
- `UPTIME_KUMA_URL`: The URL of your Uptime Kuma instance
|
|
75
|
+
- `UPTIME_KUMA_USERNAME`: Your Uptime Kuma username
|
|
76
|
+
- `UPTIME_KUMA_PASSWORD`: Your Uptime Kuma password
|
|
77
|
+
|
|
78
|
+
- **Optional Variable:**
|
|
79
|
+
- `UPTIME_KUMA_2FA_TOKEN`: Your 2FA token (only required if two-factor authentication is enabled on your account)
|
|
73
80
|
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
|
|
81
|
+
#### 2. JWT Token Authentication
|
|
82
|
+
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.
|
|
83
|
+
|
|
84
|
+
- **Required Variables:**
|
|
85
|
+
- `UPTIME_KUMA_URL`: The URL of your Uptime Kuma instance
|
|
86
|
+
- `UPTIME_KUMA_JWT_TOKEN`: Your JWT token (see instructions below for how to obtain it)
|
|
77
87
|
|
|
78
|
-
|
|
88
|
+
**How to Find Your JWT Token:**
|
|
79
89
|
|
|
80
|
-
|
|
90
|
+
1. Log into your Uptime Kuma instance in your web browser
|
|
91
|
+
2. Open your browser's Developer Tools (F12 or right-click → Inspect)
|
|
92
|
+
3. Navigate to the **Storage** tab (Firefox) or **Application** tab (Chrome/Edge)
|
|
93
|
+
4. Under **Local Storage** or **Session Storage**, find your Uptime Kuma domain
|
|
94
|
+
5. Look for a key named `token` - the value is your JWT token (it should start with 'ey...')
|
|
95
|
+
6. Copy the token value and use it as `UPTIME_KUMA_JWT_TOKEN`
|
|
81
96
|
|
|
82
|
-
|
|
97
|
+
Note: The JWT token is tied to your session and may expire based on your Uptime Kuma configuration.
|
|
83
98
|
|
|
84
|
-
|
|
99
|
+
#### 3. Anonymous Authentication
|
|
100
|
+
If your Uptime Kuma instance has authentication disabled (`disableAuth` setting), you can connect without providing any credentials. Only the `UPTIME_KUMA_URL` environment variable is required.
|
|
85
101
|
|
|
102
|
+
- **Required Variables:**
|
|
103
|
+
- `UPTIME_KUMA_URL`: The URL of your Uptime Kuma instance
|
|
104
|
+
|
|
105
|
+
**Note:** Anonymous authentication only works if your Uptime Kuma instance has disabled authentication. This is not recommended for production environments.
|
|
106
|
+
|
|
107
|
+
### Setting up mcp-uptime-kuma using the stdio transport
|
|
108
|
+
|
|
109
|
+
For many MCP clients, you can configure the server as follows:
|
|
110
|
+
|
|
111
|
+
**Option 1: Username/Password Authentication**
|
|
86
112
|
```json
|
|
87
113
|
{
|
|
88
114
|
"mcpServers": {
|
|
@@ -92,15 +118,35 @@ For Claude Code, VS Code, or other MCP clients, you can configure the server as
|
|
|
92
118
|
"env": {
|
|
93
119
|
"UPTIME_KUMA_URL": "http://your-uptime-kuma-instance:3001",
|
|
94
120
|
"UPTIME_KUMA_USERNAME": "your_username",
|
|
95
|
-
"UPTIME_KUMA_PASSWORD": "your_password"
|
|
121
|
+
"UPTIME_KUMA_PASSWORD": "your_password",
|
|
122
|
+
"UPTIME_KUMA_2FA_TOKEN": "your_2fa_token" // Optional, only if 2FA is enabled
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Option 2: JWT Token Authentication**
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"mcpServers": {
|
|
133
|
+
"uptime-kuma": {
|
|
134
|
+
"command": "npx",
|
|
135
|
+
"args": ["-y", "@davidfuchs/mcp-uptime-kuma"],
|
|
136
|
+
"env": {
|
|
137
|
+
"UPTIME_KUMA_URL": "http://your-uptime-kuma-instance:3001",
|
|
138
|
+
"UPTIME_KUMA_JWT_TOKEN": "your_jwt_token"
|
|
96
139
|
}
|
|
97
140
|
}
|
|
98
141
|
}
|
|
99
142
|
}
|
|
100
143
|
```
|
|
101
144
|
|
|
145
|
+
See the [JWT Token Authentication](#2-jwt-token-authentication) section for instructions on how to find your JWT token.
|
|
146
|
+
|
|
102
147
|
If you're using LibreChat (librechat.yaml), you can configure it like this:
|
|
103
148
|
|
|
149
|
+
**Option 1: Username/Password Authentication (LibreChat):**
|
|
104
150
|
```yaml
|
|
105
151
|
mcpServers:
|
|
106
152
|
uptime-kuma:
|
|
@@ -108,37 +154,128 @@ mcpServers:
|
|
|
108
154
|
args: ["-y", "@davidfuchs/mcp-uptime-kuma"]
|
|
109
155
|
customUserVars:
|
|
110
156
|
UPTIME_KUMA_URL:
|
|
111
|
-
title: "Uptime Kuma URL"
|
|
112
|
-
description: "The URL to log into Uptime Kuma."
|
|
113
|
-
UPTIME_KUMA_USERNAME:
|
|
114
|
-
title: "Uptime Kuma Username"
|
|
115
|
-
description: "The username to log into Uptime Kuma."
|
|
116
|
-
UPTIME_KUMA_PASSWORD:
|
|
117
|
-
title: "Uptime Kuma Password"
|
|
118
|
-
description: "The password to log into Uptime Kuma."
|
|
157
|
+
title: "Uptime Kuma URL"
|
|
158
|
+
description: "The URL to log into Uptime Kuma."
|
|
159
|
+
UPTIME_KUMA_USERNAME:
|
|
160
|
+
title: "Uptime Kuma Username"
|
|
161
|
+
description: "The username to log into Uptime Kuma."
|
|
162
|
+
UPTIME_KUMA_PASSWORD:
|
|
163
|
+
title: "Uptime Kuma Password"
|
|
164
|
+
description: "The password to log into Uptime Kuma."
|
|
165
|
+
UPTIME_KUMA_2FA_TOKEN: # Optional, only if 2FA is enabled
|
|
166
|
+
title: "Uptime Kuma 2FA Token"
|
|
167
|
+
description: "The 2FA token for Uptime Kuma (optional)."
|
|
168
|
+
env:
|
|
169
|
+
UPTIME_KUMA_URL: "{{UPTIME_KUMA_URL}}"
|
|
170
|
+
UPTIME_KUMA_USERNAME: "{{UPTIME_KUMA_USERNAME}}"
|
|
171
|
+
UPTIME_KUMA_PASSWORD: "{{UPTIME_KUMA_PASSWORD}}"
|
|
172
|
+
UPTIME_KUMA_2FA_TOKEN: "{{UPTIME_KUMA_2FA_TOKEN}}" # Optional, only if 2FA is enabled
|
|
173
|
+
serverInstructions: true
|
|
174
|
+
startup: false
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Option 2: JWT Token Authentication (LibreChat)**
|
|
178
|
+
```yaml
|
|
179
|
+
mcpServers:
|
|
180
|
+
uptime-kuma:
|
|
181
|
+
command: npx
|
|
182
|
+
args: ["-y", "@davidfuchs/mcp-uptime-kuma"]
|
|
183
|
+
customUserVars:
|
|
184
|
+
UPTIME_KUMA_URL:
|
|
185
|
+
title: "Uptime Kuma URL"
|
|
186
|
+
description: "The URL to log into Uptime Kuma."
|
|
187
|
+
UPTIME_KUMA_JWT_TOKEN:
|
|
188
|
+
title: "Uptime Kuma JWT Token"
|
|
189
|
+
description: "JWT token for Uptime Kuma authentication."
|
|
119
190
|
env:
|
|
120
|
-
UPTIME_KUMA_URL: "{{UPTIME_KUMA_URL}}"
|
|
121
|
-
|
|
122
|
-
UPTIME_KUMA_PASSWORD: "{{UPTIME_KUMA_PASSWORD}}"
|
|
191
|
+
UPTIME_KUMA_URL: "{{UPTIME_KUMA_URL}}"
|
|
192
|
+
UPTIME_KUMA_JWT_TOKEN: "{{UPTIME_KUMA_JWT_TOKEN}}"
|
|
123
193
|
serverInstructions: true
|
|
124
|
-
startup: false
|
|
194
|
+
startup: false
|
|
125
195
|
```
|
|
126
196
|
|
|
197
|
+
See the [JWT Token Authentication](#2-jwt-token-authentication) section for instructions on how to find your JWT token.
|
|
198
|
+
|
|
127
199
|
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.
|
|
128
200
|
|
|
129
|
-
###
|
|
201
|
+
### Setting up mcp-uptime-kuma using the streamable HTTP transport
|
|
130
202
|
|
|
131
203
|
The recommended way to run the MCP server using streamable HTTP is to run it as a Docker container.
|
|
132
204
|
|
|
133
|
-
A docker-compose file is provided in the Github repository.
|
|
205
|
+
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:
|
|
134
206
|
|
|
135
207
|
`docker compose up -d`
|
|
136
208
|
|
|
137
|
-
The MCP endpoint will be available on your Docker host at port 3000 (configurable via `PORT` environment variable).
|
|
209
|
+
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.
|
|
210
|
+
|
|
211
|
+
## Detailed Tool Descriptions
|
|
212
|
+
|
|
213
|
+
### getMonitorSummary
|
|
214
|
+
Retrieves a summarized list of all monitors with essential information and their current status.
|
|
215
|
+
|
|
216
|
+
- **Input**:
|
|
217
|
+
- `keywords` (string, optional): Space-separated keywords to filter monitors by pathName (case-insensitive). All keywords must match for a monitor to be included.
|
|
218
|
+
- **Output**: Array of monitor summaries with:
|
|
219
|
+
- Monitor ID, name, pathName
|
|
220
|
+
- Active and maintenance state
|
|
221
|
+
- Most recent heartbeat status (0=DOWN, 1=UP, 2=PENDING, 3=MAINTENANCE)
|
|
222
|
+
- Status message from the most recent heartbeat
|
|
223
|
+
- Total count of matching monitors
|
|
224
|
+
|
|
225
|
+
### getMonitor
|
|
226
|
+
Retrieves detailed information about a specific monitor by its ID.
|
|
227
|
+
|
|
228
|
+
- **Input**:
|
|
229
|
+
- `monitorID` (number): The ID of the monitor to retrieve
|
|
230
|
+
- `includeAdditionalFields` (boolean, optional): Include all additional fields from Uptime Kuma (default: false)
|
|
231
|
+
- **Output**: Monitor configuration object with details like URL, type, check interval, notification settings, etc.
|
|
232
|
+
|
|
233
|
+
### listMonitors
|
|
234
|
+
Retrieves the full list of all monitors the user has access to.
|
|
235
|
+
|
|
236
|
+
- **Input**:
|
|
237
|
+
- `includeAdditionalFields` (boolean, optional): Include all additional fields from Uptime Kuma (default: false)
|
|
238
|
+
- **Output**: Array of monitor objects with count
|
|
239
|
+
|
|
240
|
+
### getHeartbeats
|
|
241
|
+
Retrieves heartbeats (status checks) for a specific monitor.
|
|
242
|
+
|
|
243
|
+
- **Input**:
|
|
244
|
+
- `monitorID` (number): The ID of the monitor to get heartbeats for
|
|
245
|
+
- `maxHeartbeats` (number, optional): Maximum number of most recent heartbeats to return (1-100). Default: 1
|
|
246
|
+
- **Output**: Object containing:
|
|
247
|
+
- `monitorID`: The monitor ID
|
|
248
|
+
- `heartbeats`: Array of heartbeat objects with status, response time, timestamps, etc.
|
|
249
|
+
- `count`: Number of heartbeats returned
|
|
138
250
|
|
|
139
|
-
|
|
251
|
+
### listHeartbeats
|
|
252
|
+
Retrieves the heartbeats for all monitors.
|
|
140
253
|
|
|
141
|
-
|
|
254
|
+
- **Input**:
|
|
255
|
+
- `maxHeartbeats` (number, optional): Maximum number of most recent heartbeats per monitor (1-100). Default: 1
|
|
256
|
+
- **Output**: Object containing:
|
|
257
|
+
- `heartbeats`: Map of monitor IDs to their heartbeat arrays
|
|
258
|
+
- `monitorCount`: Number of monitors
|
|
259
|
+
- `totalHeartbeatCount`: Total number of heartbeats across all monitors
|
|
260
|
+
|
|
261
|
+
### getSettings
|
|
262
|
+
Retrieves the current Uptime Kuma server settings.
|
|
263
|
+
|
|
264
|
+
- **Input**: None
|
|
265
|
+
- **Output**: Settings object containing:
|
|
266
|
+
- `serverTimezone`: Server timezone setting
|
|
267
|
+
- `checkUpdate`: Whether to check for updates
|
|
268
|
+
- `searchEngineIndex`: Search engine indexing setting
|
|
269
|
+
- `entryPage`: Entry page configuration
|
|
270
|
+
- `dnsCache`: DNS cache setting
|
|
271
|
+
- `keepDataPeriodDays`: Data retention period in days
|
|
272
|
+
- `tlsExpiryNotifyDays`: TLS expiry notification days
|
|
273
|
+
- `trustProxy`: Trust proxy setting
|
|
274
|
+
- `nscd`: NSCD setting
|
|
275
|
+
- `disableAuth`: Authentication disabled status
|
|
276
|
+
- `primaryBaseURL`: Primary base URL (optional)
|
|
277
|
+
|
|
278
|
+
## Developing
|
|
142
279
|
|
|
143
280
|
To run locally, clone the repository and follow these steps:
|
|
144
281
|
|
|
@@ -150,16 +287,7 @@ npm install
|
|
|
150
287
|
|
|
151
288
|
### Create the environment configuration
|
|
152
289
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
These are the required variables:
|
|
156
|
-
|
|
157
|
-
```env
|
|
158
|
-
UPTIME_KUMA_URL=http://your-uptime-kuma-instance:3001
|
|
159
|
-
UPTIME_KUMA_USERNAME=your_username
|
|
160
|
-
UPTIME_KUMA_PASSWORD=your_password
|
|
161
|
-
PORT=3000 # Optional, only for HTTP transport
|
|
162
|
-
```
|
|
290
|
+
Copy [.env.example](.env.example) to `.env` and configure the required environment variables for your Uptime Kuma instance (URL and authentication method).
|
|
163
291
|
|
|
164
292
|
## Building
|
|
165
293
|
|
|
@@ -237,13 +365,18 @@ mcp-uptime-kuma/
|
|
|
237
365
|
│ ├── index.ts # Main entry point with transport selection
|
|
238
366
|
│ ├── server.ts # Core MCP server configuration with tools
|
|
239
367
|
│ ├── uptime-kuma-client.ts # WebSocket client for Uptime Kuma API
|
|
240
|
-
│
|
|
241
|
-
|
|
368
|
+
│ ├── types.ts # TypeScript type definitions
|
|
369
|
+
│ └── version.ts # Runtime version information
|
|
370
|
+
├── .github/ # GitHub workflows and configurations
|
|
371
|
+
├── .vscode/ # VS Code workspace settings
|
|
242
372
|
├── docker-compose.yml # Docker Compose configuration
|
|
243
373
|
├── Dockerfile # Docker image definition
|
|
374
|
+
├── .dockerignore # Docker ignore file
|
|
375
|
+
├── .env.example # Example environment configuration
|
|
376
|
+
├── .gitignore # Git ignore file
|
|
244
377
|
├── package.json # Project dependencies and scripts
|
|
378
|
+
├── package-lock.json # Locked dependency versions
|
|
245
379
|
├── tsconfig.json # TypeScript configuration
|
|
246
|
-
├── .env # Environment configuration (create this)
|
|
247
380
|
├── LICENSE # License file
|
|
248
381
|
└── README.md # This file
|
|
249
382
|
```
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AAyJvB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,28 +9,23 @@ import { createServer } from './server.js';
|
|
|
9
9
|
* Supports both stdio (default) and streamable-http transports via CLI flags
|
|
10
10
|
*/
|
|
11
11
|
// Validate required environment variables
|
|
12
|
-
function validateEnvironment() {
|
|
12
|
+
function validateEnvironment(readWriteEnabled) {
|
|
13
13
|
const url = process.env.UPTIME_KUMA_URL;
|
|
14
14
|
const username = process.env.UPTIME_KUMA_USERNAME;
|
|
15
15
|
const password = process.env.UPTIME_KUMA_PASSWORD;
|
|
16
|
+
const token = process.env.UPTIME_KUMA_2FA_TOKEN;
|
|
17
|
+
const jwtToken = process.env.UPTIME_KUMA_JWT_TOKEN;
|
|
16
18
|
if (!url) {
|
|
17
19
|
console.error('Error: UPTIME_KUMA_URL environment variable is required');
|
|
18
20
|
process.exit(1);
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
console.error('Error: UPTIME_KUMA_USERNAME environment variable is required');
|
|
22
|
-
process.exit(1);
|
|
23
|
-
}
|
|
24
|
-
if (!password) {
|
|
25
|
-
console.error('Error: UPTIME_KUMA_PASSWORD environment variable is required');
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
return { url, username, password };
|
|
22
|
+
return { url, username, password, token, jwtToken, readWriteEnabled };
|
|
29
23
|
}
|
|
30
24
|
// Parse command-line arguments
|
|
31
25
|
function parseArgs() {
|
|
32
26
|
const args = process.argv.slice(2);
|
|
33
27
|
let transport = 'stdio';
|
|
28
|
+
let readWriteEnabled = false;
|
|
34
29
|
for (let i = 0; i < args.length; i++) {
|
|
35
30
|
if (args[i] === '-t' || args[i] === '--transport') {
|
|
36
31
|
const value = args[i + 1];
|
|
@@ -43,23 +38,29 @@ function parseArgs() {
|
|
|
43
38
|
process.exit(1);
|
|
44
39
|
}
|
|
45
40
|
}
|
|
41
|
+
else if (args[i] === '--read-write') {
|
|
42
|
+
readWriteEnabled = true;
|
|
43
|
+
}
|
|
46
44
|
else if (args[i] === '-h' || args[i] === '--help') {
|
|
47
45
|
console.log(`Usage: mcp-uptime-kuma [options]
|
|
48
46
|
|
|
49
47
|
Options:
|
|
50
48
|
-t, --transport <type> Transport type: 'stdio' (default) or 'streamable-http'
|
|
49
|
+
--read-write Enable read-write operations (default: read-only)
|
|
51
50
|
-h, --help Show this help message
|
|
52
51
|
|
|
53
52
|
Examples:
|
|
54
|
-
mcp-uptime-kuma # Run with stdio transport (
|
|
55
|
-
mcp-uptime-kuma -
|
|
56
|
-
mcp-uptime-kuma -t
|
|
53
|
+
mcp-uptime-kuma # Run with stdio transport (read-only)
|
|
54
|
+
mcp-uptime-kuma --read-write # Run with stdio transport (read-write enabled)
|
|
55
|
+
mcp-uptime-kuma -t stdio # Run with stdio transport (read-only)
|
|
56
|
+
mcp-uptime-kuma -t streamable-http # Run with streamable HTTP transport (read-only, port 3000)
|
|
57
|
+
mcp-uptime-kuma -t streamable-http --read-write # Run HTTP with read-write enabled
|
|
57
58
|
PORT=8080 mcp-uptime-kuma -t streamable-http # Run HTTP on custom port
|
|
58
59
|
`);
|
|
59
60
|
process.exit(0);
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
|
-
return { transport };
|
|
63
|
+
return { transport, readWriteEnabled };
|
|
63
64
|
}
|
|
64
65
|
// Run with the stdio transport
|
|
65
66
|
async function runStdio(config) {
|
|
@@ -123,8 +124,8 @@ async function runHttp(config) {
|
|
|
123
124
|
}
|
|
124
125
|
// Main entry point
|
|
125
126
|
async function main() {
|
|
126
|
-
const
|
|
127
|
-
const
|
|
127
|
+
const { transport, readWriteEnabled } = parseArgs();
|
|
128
|
+
const config = validateEnvironment(readWriteEnabled);
|
|
128
129
|
if (transport === 'stdio') {
|
|
129
130
|
await runStdio(config);
|
|
130
131
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,E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AI,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC;IAElD,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;QACpB,OAAO,CAAC,GAAG,CAAC,sDAAsD,IAAI,MAAM,CAAC,CAAC;QAC9E,OAAO,CAAC,GAAG,CAAC,8CAA8C,IAAI,SAAS,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QACvB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,mBAAmB;AACnB,KAAK,UAAU,IAAI;IACjB,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAG,SAAS,EAAE,CAAC;IACpD,MAAM,MAAM,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAErD,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;QAC1B,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;SAAM,CAAC;QACN,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC;AAEP,gEAAgE;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
|
|
3
|
-
* Configuration interface for Uptime Kuma
|
|
4
|
-
*/
|
|
5
|
-
export interface UptimeKumaConfig {
|
|
6
|
-
url: string;
|
|
7
|
-
username: string;
|
|
8
|
-
password: string;
|
|
9
|
-
}
|
|
2
|
+
import type { UptimeKumaConfig } from './types.js';
|
|
10
3
|
/**
|
|
11
4
|
* Creates and configures the MCP server with tools, resources, and prompts
|
|
12
5
|
*/
|
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;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD;;GAEG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CA6U/E"}
|
package/dist/server.js
CHANGED
|
@@ -2,14 +2,15 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
2
2
|
import { McpError, ErrorCode } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { UptimeKumaClient, filterMonitorFields } from './uptime-kuma-client.js';
|
|
5
|
-
import { HeartbeatSchema, MonitorBaseSchema } from './types.js';
|
|
5
|
+
import { HeartbeatSchema, MonitorBaseSchema, MonitorSummarySchema, SettingsSchema } from './types.js';
|
|
6
|
+
import { VERSION } from './version.js';
|
|
6
7
|
/**
|
|
7
8
|
* Creates and configures the MCP server with tools, resources, and prompts
|
|
8
9
|
*/
|
|
9
10
|
export async function createServer(config) {
|
|
10
11
|
const server = new McpServer({
|
|
11
12
|
name: 'mcp-uptime-kuma',
|
|
12
|
-
version:
|
|
13
|
+
version: VERSION,
|
|
13
14
|
}, {
|
|
14
15
|
instructions: `
|
|
15
16
|
This MCP server provides access to Uptime Kuma monitoring data for system status and uptime/downtime information.
|
|
@@ -24,7 +25,10 @@ export async function createServer(config) {
|
|
|
24
25
|
let isAuthenticated = false;
|
|
25
26
|
try {
|
|
26
27
|
await client.connect();
|
|
27
|
-
await client.login(config.username, config.password);
|
|
28
|
+
await client.login(config.username, config.password, config.token, config.jwtToken);
|
|
29
|
+
// Logging in anonymously gives no indication that authentication failed.
|
|
30
|
+
// So instead, we issue a getSettings call after login, to prove the connection is working.
|
|
31
|
+
await client.getSettings();
|
|
28
32
|
isAuthenticated = true;
|
|
29
33
|
console.error('Successfully authenticated with Uptime Kuma');
|
|
30
34
|
}
|
|
@@ -106,15 +110,7 @@ export async function createServer(config) {
|
|
|
106
110
|
keywords: z.string().optional().describe('Space-separated keywords to filter monitors by pathName (case-insensitive). All keywords must match for a monitor to be included.')
|
|
107
111
|
},
|
|
108
112
|
outputSchema: {
|
|
109
|
-
summaries: z.array(
|
|
110
|
-
id: z.number(),
|
|
111
|
-
name: z.string(),
|
|
112
|
-
pathName: z.string(),
|
|
113
|
-
active: z.boolean(),
|
|
114
|
-
maintenance: z.boolean(),
|
|
115
|
-
status: z.number().optional().describe('0=DOWN, 1=UP, 2=PENDING, 3=MAINTENANCE'),
|
|
116
|
-
msg: z.string().optional().describe('Status message from the most recent heartbeat'),
|
|
117
|
-
})).describe('Array of monitor summaries'),
|
|
113
|
+
summaries: z.array(MonitorSummarySchema).describe('Array of monitor summaries'),
|
|
118
114
|
count: z.number()
|
|
119
115
|
},
|
|
120
116
|
}, async ({ keywords }) => {
|
|
@@ -176,6 +172,33 @@ export async function createServer(config) {
|
|
|
176
172
|
throw new McpError(ErrorCode.InternalError, `Failed to get heartbeats: ${errorMessage}`);
|
|
177
173
|
}
|
|
178
174
|
});
|
|
175
|
+
// Register getSettings tool
|
|
176
|
+
server.registerTool('getSettings', {
|
|
177
|
+
title: 'Get Settings',
|
|
178
|
+
description: 'Retrieves the current Uptime Kuma server settings including timezone, authentication status, primary base URL, and other configuration options.',
|
|
179
|
+
inputSchema: {},
|
|
180
|
+
outputSchema: {
|
|
181
|
+
settings: SettingsSchema.describe('Current Uptime Kuma server settings')
|
|
182
|
+
},
|
|
183
|
+
}, async () => {
|
|
184
|
+
if (!isAuthenticated) {
|
|
185
|
+
throw new McpError(ErrorCode.InternalError, 'Not authenticated with Uptime Kuma');
|
|
186
|
+
}
|
|
187
|
+
try {
|
|
188
|
+
const response = await client.getSettings();
|
|
189
|
+
if (!response.data) {
|
|
190
|
+
throw new Error('No settings data returned');
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }],
|
|
194
|
+
structuredContent: { settings: response.data },
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
199
|
+
throw new McpError(ErrorCode.InternalError, `Failed to get settings: ${errorMessage}`);
|
|
200
|
+
}
|
|
201
|
+
});
|
|
179
202
|
// Register listAllHeartbeats tool
|
|
180
203
|
server.registerTool('listHeartbeats', {
|
|
181
204
|
title: 'List Heartbeats',
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAA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