staygreen 0.1.0 → 0.1.2
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/CLI.md +2 -2
- package/README.md +10 -0
- package/dist/cli.js +19 -10
- package/package.json +1 -1
package/CLI.md
CHANGED
|
@@ -17,8 +17,8 @@ Requires Node 22 or later:
|
|
|
17
17
|
npx -y staygreen mcp
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
To run a checkout of this source instead, build it (below) and use
|
|
21
|
+
`node /absolute/path/to/dist/cli.js mcp` in place of `npx`.
|
|
22
22
|
|
|
23
23
|
Create a workspace API token at [Agents and API](https://staygreen.io/app/agents)
|
|
24
24
|
and provide it as `STAYGREEN_API_TOKEN` in the server process's environment.
|
package/README.md
CHANGED
|
@@ -31,6 +31,16 @@ claude mcp add --transport http staygreen https://staygreen.io/mcp \
|
|
|
31
31
|
--header "Authorization: Bearer $STAYGREEN_API_TOKEN"
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
### Local server (npm)
|
|
35
|
+
|
|
36
|
+
The [`staygreen`](https://www.npmjs.com/package/staygreen) package runs the same tools as a local stdio server and calls the REST API with a workspace API token. Node 22 or later.
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
claude mcp add staygreen -e STAYGREEN_API_TOKEN=… -- npx -y staygreen mcp
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Without a token only `scan_app` works. Configuration for Claude Desktop, Cursor and VS Code, and the package's `scan` and `provision` commands, are in [CLI.md](CLI.md).
|
|
43
|
+
|
|
34
44
|
### Tools
|
|
35
45
|
|
|
36
46
|
| Tool | What it does |
|
package/dist/cli.js
CHANGED
|
@@ -8,9 +8,10 @@ var __export = (target, all) => {
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
import { parseArgs } from "node:util";
|
|
10
10
|
import { randomUUID } from "node:crypto";
|
|
11
|
+
import { realpathSync } from "node:fs";
|
|
11
12
|
import { writeFile, mkdir } from "node:fs/promises";
|
|
12
13
|
import { dirname, resolve } from "node:path";
|
|
13
|
-
import {
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
14
15
|
|
|
15
16
|
// node_modules/zod/v4/classic/external.js
|
|
16
17
|
var external_exports = {};
|
|
@@ -20134,7 +20135,7 @@ var contract_generated_default = {
|
|
|
20134
20135
|
{
|
|
20135
20136
|
name: "list_monitors",
|
|
20136
20137
|
title: "List monitors",
|
|
20137
|
-
description: "List monitors in your workspace,
|
|
20138
|
+
description: "List monitors in your workspace with their app ids, current state and last check, ordered by id. The app, type and status filters combine, each narrowing the same list; with none you get every monitor, automatic SSL checks included. last_check_precision says whether last_check is an exact outcome, the start of its latest five-minute check window, or no data. Never returns credentials or heartbeat URLs. Use get_status instead for each app's overall state and open incidents, get_uptime for history. Call again with cursor set to next_cursor until null.",
|
|
20138
20139
|
inputSchema: {
|
|
20139
20140
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
20140
20141
|
type: "object",
|
|
@@ -20273,7 +20274,7 @@ var contract_generated_default = {
|
|
|
20273
20274
|
{
|
|
20274
20275
|
name: "get_status",
|
|
20275
20276
|
title: "Get status",
|
|
20276
|
-
description: "Read the current status of one app or every app,
|
|
20277
|
+
description: "Read the current status of one app or every app: its overall state, monitors (private ones included), status page components and open incidents with their latest published note. Omit app or pass * for the whole workspace; an app id outside your workspace returns not_found. Start here: its app, monitor and incident ids feed the other tools. Use get_uptime or get_incidents for history. No draft notes are returned.",
|
|
20277
20278
|
inputSchema: {
|
|
20278
20279
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
20279
20280
|
type: "object",
|
|
@@ -20512,7 +20513,7 @@ var contract_generated_default = {
|
|
|
20512
20513
|
{
|
|
20513
20514
|
name: "get_uptime",
|
|
20514
20515
|
title: "Get uptime",
|
|
20515
|
-
description: "Read measured uptime, downtime minutes, incident counts and daily history
|
|
20516
|
+
description: "Read measured uptime, downtime minutes, incident counts and daily history. With monitor omitted or *, every monitor is returned a page at a time (follow next_cursor); a monitor id returns that monitor alone, so pass no cursor with it. window is capped at 30d unless your plan includes a year of history, and the result's window says which one applied. Unmeasured time is no data, not 100% uptime. Use get_response_times instead for latency, and get_incidents for what failed and why.",
|
|
20516
20517
|
inputSchema: {
|
|
20517
20518
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
20518
20519
|
type: "object",
|
|
@@ -20966,7 +20967,7 @@ var contract_generated_default = {
|
|
|
20966
20967
|
{
|
|
20967
20968
|
name: "get_ssl_and_domain_expiry",
|
|
20968
20969
|
title: "Get ssl and domain expiry",
|
|
20969
|
-
description: "Read certificate and domain expiry dates
|
|
20970
|
+
description: "Read certificate and domain expiry dates, with days remaining, for the hosts your SSL monitors check. Omit app for every SSL monitor in the workspace, or pass an app id for that app's hosts only. A null date means Staygreen has no date to show for that host; it never guesses one. Use this for renewal deadlines; use get_status instead for whether a site is up now. Follow next_cursor to read every host.",
|
|
20970
20971
|
inputSchema: {
|
|
20971
20972
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
20972
20973
|
type: "object",
|
|
@@ -21066,7 +21067,7 @@ var contract_generated_default = {
|
|
|
21066
21067
|
{
|
|
21067
21068
|
name: "provision_app",
|
|
21068
21069
|
title: "Provision app",
|
|
21069
|
-
description: "Set up
|
|
21070
|
+
description: "Set up a new app in one transaction: its website check, an automatic SSL/domain check when url is https on port 443 with a hostname that has no SSL monitor yet, a status page, and one heartbeat per crons_from entry. Optional checks come in pairs, supabase_url with supabase_key and stripe_key with stripe_endpoints: half a pair is reported in skipped, and a full pair that fails verification refuses the whole call. mcp_url and status_domain are reported in skipped when supplied. A new app's explicit name must be free; without one, the hostname is made unique. Every option is validated and checked first; then, if url matches an existing app, that app comes back with its monitors as they were (add checks with create_monitor), plus a status page if it had none. A plan_limit error creates nothing and lists what was not created. Heartbeat URLs are returned only to this request and its retries with the same request_id. Needs write access.",
|
|
21070
21071
|
inputSchema: {
|
|
21071
21072
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
21072
21073
|
type: "object",
|
|
@@ -21286,7 +21287,7 @@ var contract_generated_default = {
|
|
|
21286
21287
|
{
|
|
21287
21288
|
name: "create_monitor",
|
|
21288
21289
|
title: "Create monitor",
|
|
21289
|
-
description: "Create one monitor in an app
|
|
21290
|
+
description: "Create one monitor in an existing app; for a new app use provision_app instead. type decides what target is and which config keys apply: http takes a URL with method, expect, keyword, slowMs, assertions and headers; tcp a hostname or public IP with port, tls and slowMs; ssl a hostname and no config; dns a record name with record and expected; heartbeat ignores target and takes schedule, tz, graceMin, maxRunMin and assertions, so give it a name; supabase a project URL with key and databaseRead; stripe https://api.stripe.com with key, endpoints, critical, failureThreshold, windowMin and pendingMin. A key belonging to another type is refused. Validation, public-address checks and plan quotas match the dashboard, and Stripe and Supabase checks must verify before saving. Returns a first test result but never a heartbeat's URL, which the dashboard shows. Supply request_id for safe retries. Needs write access.",
|
|
21290
21291
|
inputSchema: {
|
|
21291
21292
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
21292
21293
|
type: "object",
|
|
@@ -21316,14 +21317,14 @@ var contract_generated_default = {
|
|
|
21316
21317
|
description: "Monitor type. MCP server monitors are not available yet."
|
|
21317
21318
|
},
|
|
21318
21319
|
name: {
|
|
21319
|
-
description:
|
|
21320
|
+
description: `Monitor name. Without one, Staygreen picks a default (a heartbeat's is "Scheduled job"), which this tool does not return; list_monitors shows it.`,
|
|
21320
21321
|
type: "string",
|
|
21321
21322
|
maxLength: 80
|
|
21322
21323
|
},
|
|
21323
21324
|
target: {
|
|
21324
21325
|
type: "string",
|
|
21325
21326
|
maxLength: 2048,
|
|
21326
|
-
description: "HTTP or Supabase URL, SSL
|
|
21327
|
+
description: "HTTP or Supabase URL, SSL hostname, TCP hostname or public IP, or DNS record name. HTTP(S) URL hostnames may be at most 80 characters. Stripe uses https://api.stripe.com; a heartbeat ignores it."
|
|
21327
21328
|
},
|
|
21328
21329
|
config: {
|
|
21329
21330
|
default: {},
|
|
@@ -22142,7 +22143,15 @@ async function main(args = process.argv.slice(2), env = process.env) {
|
|
|
22142
22143
|
await writeFile(output2, JSON.stringify(result, null, 2) + "\n", { mode: 384 });
|
|
22143
22144
|
console.log("Monitoring provisioned. Private setup and heartbeat URLs saved to the output file.");
|
|
22144
22145
|
}
|
|
22145
|
-
|
|
22146
|
+
var real = (path) => {
|
|
22147
|
+
try {
|
|
22148
|
+
return realpathSync(path);
|
|
22149
|
+
} catch {
|
|
22150
|
+
return null;
|
|
22151
|
+
}
|
|
22152
|
+
};
|
|
22153
|
+
var invoked = process.argv[1] ? real(resolve(process.argv[1])) : null;
|
|
22154
|
+
if (invoked && invoked === real(fileURLToPath(import.meta.url)))
|
|
22146
22155
|
main().catch(() => {
|
|
22147
22156
|
console.error("Staygreen command failed. Check --help, inputs, credentials and plan limits. Retry provisioning with the same output file and unchanged inputs.");
|
|
22148
22157
|
process.exitCode = 1;
|
package/package.json
CHANGED