diff --git a/.mcp.json b/.mcp.json index bd3cfb6..9ca8f0d 100644 --- a/.mcp.json +++ b/.mcp.json @@ -2,7 +2,24 @@ "mcpServers": { "checkly": { "type": "http", - "url": "https://api.checklyhq.com/mcp" + "url": "https://api.checklyhq.com/mcp", + "scopes": [ + "checkly:account:read", + "checkly:account:invite", + "checkly:checks:read", + "checkly:checks:write", + "checkly:checks:run", + "checkly:incidents:read", + "checkly:incidents:write", + "checkly:environment-variables:read", + "checkly:environment-variables:write", + "checkly:status-pages:read", + "checkly:rca:read", + "checkly:rca:run", + "checkly:test-sessions:read", + "checkly:assets:read", + "checkly:usage:read" + ] } } } diff --git a/test/plugin-config.test.ts b/test/plugin-config.test.ts new file mode 100644 index 0000000..70f27f3 --- /dev/null +++ b/test/plugin-config.test.ts @@ -0,0 +1,28 @@ +import { strict as assert } from "node:assert"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import { test } from "node:test"; + +const EXPECTED_CHECKLY_SCOPES = [ + "checkly:account:read", + "checkly:account:invite", + "checkly:checks:read", + "checkly:checks:write", + "checkly:checks:run", + "checkly:incidents:read", + "checkly:incidents:write", + "checkly:environment-variables:read", + "checkly:environment-variables:write", + "checkly:status-pages:read", + "checkly:rca:read", + "checkly:rca:run", + "checkly:test-sessions:read", + "checkly:assets:read", + "checkly:usage:read", +]; + +test("Checkly MCP requests every supported OAuth scope", async () => { + const config = JSON.parse(await readFile(join(import.meta.dirname, "..", ".mcp.json"), "utf8")); + + assert.deepEqual(config.mcpServers.checkly.scopes, EXPECTED_CHECKLY_SCOPES); +});