@askqa/mcp 1.0.3 → 1.0.5
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/.claude-plugin/plugin.json +5 -0
- package/package.json +6 -3
- package/server.js +28 -9
- package/skills/setup-slack/SKILL.md +40 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askqa/mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "MCP server for AskQA — monitor websites with automated tests by chatting with AI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,10 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"server.js",
|
|
24
|
-
"README.md"
|
|
24
|
+
"README.md",
|
|
25
|
+
".claude-plugin",
|
|
26
|
+
"skills"
|
|
25
27
|
],
|
|
26
28
|
"dependencies": {
|
|
27
29
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
28
|
-
"zod": "^3.23.0"
|
|
30
|
+
"zod": "^3.23.0",
|
|
31
|
+
"zod-to-json-schema": "^3.25.0"
|
|
29
32
|
}
|
|
30
33
|
}
|
package/server.js
CHANGED
|
@@ -637,17 +637,26 @@ server.registerTool(
|
|
|
637
637
|
server.registerTool(
|
|
638
638
|
"add_notification_channel",
|
|
639
639
|
{
|
|
640
|
-
description: "Add a notification channel to receive alerts when scheduled tests fail.
|
|
640
|
+
description: "Add a notification channel to receive alerts when scheduled tests fail. Supports email, Telegram, and Slack. For Telegram, get a chat ID from https://t.me/userinfobot. For Slack, create an Incoming Webhook in your Slack workspace settings.",
|
|
641
641
|
inputSchema: {
|
|
642
|
-
channel_type: z.enum(["telegram"]).describe("The notification channel type"),
|
|
643
|
-
|
|
642
|
+
channel_type: z.enum(["email", "telegram", "slack"]).describe("The notification channel type"),
|
|
643
|
+
email_address: z.string().optional().describe("Email address for email channels (required when channel_type is email)"),
|
|
644
|
+
chat_id: z.string().optional().describe("Telegram chat ID (required when channel_type is telegram). Get it from https://t.me/userinfobot."),
|
|
645
|
+
webhook_url: z.string().optional().describe("Slack incoming webhook URL (required when channel_type is slack). Create one at https://api.slack.com/messaging/webhooks."),
|
|
644
646
|
},
|
|
645
647
|
},
|
|
646
|
-
async ({ channel_type, chat_id }) => {
|
|
648
|
+
async ({ channel_type, email_address, chat_id, webhook_url }) => {
|
|
647
649
|
try {
|
|
648
650
|
const config = {};
|
|
649
651
|
if (channel_type === "telegram") {
|
|
652
|
+
if (!chat_id) return { content: [{ type: "text", text: "Error: chat_id is required for telegram channels." }], isError: true };
|
|
650
653
|
config.chat_id = chat_id;
|
|
654
|
+
} else if (channel_type === "email") {
|
|
655
|
+
if (!email_address) return { content: [{ type: "text", text: "Error: email_address is required for email channels." }], isError: true };
|
|
656
|
+
config.email_address = email_address;
|
|
657
|
+
} else if (channel_type === "slack") {
|
|
658
|
+
if (!webhook_url) return { content: [{ type: "text", text: "Error: webhook_url is required for slack channels." }], isError: true };
|
|
659
|
+
config.webhook_url = webhook_url;
|
|
651
660
|
}
|
|
652
661
|
const channel = await apiPost("/api/notification-channels", {
|
|
653
662
|
channel_type,
|
|
@@ -656,11 +665,17 @@ server.registerTool(
|
|
|
656
665
|
const lines = [
|
|
657
666
|
`Notification channel created (ID: ${channel.id})`,
|
|
658
667
|
` Type: ${channel.channel_type}`,
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
668
|
+
];
|
|
669
|
+
if (channel_type === "telegram") {
|
|
670
|
+
lines.push(` Chat ID: ${channel.config.chat_id}`);
|
|
671
|
+
} else if (channel_type === "email") {
|
|
672
|
+
lines.push(` Email: ${channel.config.email_address}`);
|
|
673
|
+
} else if (channel_type === "slack") {
|
|
674
|
+
lines.push(` Webhook: ${channel.config.webhook_url}`);
|
|
675
|
+
}
|
|
676
|
+
lines.push(` Enabled: ${channel.enabled}`);
|
|
677
|
+
lines.push("");
|
|
678
|
+
lines.push("Sending a test notification to verify the channel works...");
|
|
664
679
|
|
|
665
680
|
// Send test notification
|
|
666
681
|
try {
|
|
@@ -694,6 +709,10 @@ server.registerTool(
|
|
|
694
709
|
lines.push(`ID: ${ch.id} | ${ch.channel_type} (${status})`);
|
|
695
710
|
if (ch.channel_type === "telegram") {
|
|
696
711
|
lines.push(` Chat ID: ${ch.config.chat_id}`);
|
|
712
|
+
} else if (ch.channel_type === "email") {
|
|
713
|
+
lines.push(` Email: ${ch.config.email_address}`);
|
|
714
|
+
} else if (ch.channel_type === "slack") {
|
|
715
|
+
lines.push(` Webhook: ${ch.config.webhook_url}`);
|
|
697
716
|
}
|
|
698
717
|
lines.push("");
|
|
699
718
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Set Up Slack Notifications
|
|
2
|
+
|
|
3
|
+
Use this skill to configure Slack notifications for AskQA test failures. When a scheduled test fails, AskQA will post a message to your Slack channel with the test name, failed steps, and a link to the full results.
|
|
4
|
+
|
|
5
|
+
## Step 1: Create a Slack Incoming Webhook
|
|
6
|
+
|
|
7
|
+
Slack requires creating a lightweight "app" to generate a webhook URL — it takes under a minute and no coding is involved. Walk the user through these steps:
|
|
8
|
+
|
|
9
|
+
1. Go to https://api.slack.com/apps
|
|
10
|
+
2. Click **Create New App** > **From scratch**
|
|
11
|
+
3. Name it anything (e.g. "AskQA"), pick your workspace, click **Create App**
|
|
12
|
+
4. In the left sidebar, click **Incoming Webhooks**
|
|
13
|
+
5. Toggle **Activate Incoming Webhooks** to On
|
|
14
|
+
6. Click **Add New Webhook to Workspace** at the bottom
|
|
15
|
+
7. Choose the channel where you want failure alerts (e.g. `#qa-alerts`), click **Allow**
|
|
16
|
+
8. Copy the webhook URL — it looks like `https://hooks.slack.com/services/T.../B.../xxxx`
|
|
17
|
+
|
|
18
|
+
Ask the user to paste their webhook URL before proceeding.
|
|
19
|
+
|
|
20
|
+
## Step 2: Add the Notification Channel
|
|
21
|
+
|
|
22
|
+
Once you have the webhook URL, use the `add_notification_channel` MCP tool:
|
|
23
|
+
|
|
24
|
+
- `channel_type`: `slack`
|
|
25
|
+
- `webhook_url`: the URL the user provided
|
|
26
|
+
|
|
27
|
+
This will create the channel and automatically send a test message to verify it works.
|
|
28
|
+
|
|
29
|
+
## Step 3: Confirm
|
|
30
|
+
|
|
31
|
+
After the tool succeeds, let the user know:
|
|
32
|
+
|
|
33
|
+
- A test message was sent to their Slack channel — ask them to check that it arrived
|
|
34
|
+
- From now on, any scheduled test that fails will post an alert to that channel
|
|
35
|
+
- They can manage notification channels with `list_notification_channels` and `remove_notification_channel`
|
|
36
|
+
|
|
37
|
+
If the test message didn't arrive, suggest they double-check:
|
|
38
|
+
- The webhook URL is correct (starts with `https://hooks.slack.com/`)
|
|
39
|
+
- The Slack app has permission to post to the chosen channel
|
|
40
|
+
- The webhook hasn't been revoked in Slack's app settings
|