klevia-mcp 0.1.0 → 0.1.1
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 +20 -0
- package/dist/contracts.js +8 -0
- package/dist/index.js +1 -1
- package/dist/tools/build.js +13 -6
- package/dist/tools/sell.js +13 -3
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ Drive [Klevia](https://klevia.com.tr) from a CLI or an agent: read what is in a
|
|
|
4
4
|
workspace, scan a region, build demo pages for businesses that have none, edit
|
|
5
5
|
them, and deliver them.
|
|
6
6
|
|
|
7
|
+
[](https://www.npmjs.com/package/klevia-mcp)
|
|
8
|
+
|
|
7
9
|
## Install
|
|
8
10
|
|
|
9
11
|
Nothing to install. Point your MCP host at it with `npx`.
|
|
@@ -67,6 +69,24 @@ so:
|
|
|
67
69
|
| `klevia_scans` | Region scans, and whether one is waiting for your approval |
|
|
68
70
|
| `klevia_leads` | Businesses found, with the phone that decides if they are workable |
|
|
69
71
|
|
|
72
|
+
| `klevia_scan_start` | Start a metered region scan |
|
|
73
|
+
| `klevia_scan` | Read progress, candidates and the planner's question |
|
|
74
|
+
| `klevia_scan_answer` | Answer the planner's question and resume |
|
|
75
|
+
| `klevia_scan_approve` | Approve or reject the candidate list |
|
|
76
|
+
| `klevia_customer_lookup` | Find a known business on Google |
|
|
77
|
+
| `klevia_demo_build` | Build a demo for a sourced lead |
|
|
78
|
+
| `klevia_demo_build_manual` | Build from a selected place or supplied facts |
|
|
79
|
+
| `klevia_demo_document` | Read the editable document |
|
|
80
|
+
| `klevia_demo_edit` | Apply typed edits |
|
|
81
|
+
| `klevia_demo_mark_sent` | Record an actual send and start follow-up |
|
|
82
|
+
| `klevia_demo_mark_sold` | Record or remove a sale |
|
|
83
|
+
| `klevia_demo_publish` | Publish the approved content |
|
|
84
|
+
| `klevia_domain_attach` | Attach a domain and return its DNS instructions |
|
|
85
|
+
| `klevia_open` | Open the preview locally |
|
|
86
|
+
| `klevia_whatsapp_open` | Open a WhatsApp chat locally |
|
|
87
|
+
| `klevia_package_build` | Prepare a sold demo's delivery archive |
|
|
88
|
+
| `klevia_package_download` | Save the archive locally |
|
|
89
|
+
|
|
70
90
|
## What it will not do
|
|
71
91
|
|
|
72
92
|
- **Nothing customer-facing happens without you.** A scan parks on its
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Payload shared by the manual-build tool and its API contract checks. */
|
|
2
|
+
export function manualBuildPayload(input) {
|
|
3
|
+
const { sector, ...facts } = input;
|
|
4
|
+
return { sectorKey: sector, ...facts };
|
|
5
|
+
}
|
|
6
|
+
export function domainInstructions(result) {
|
|
7
|
+
return `${result.domain} attached. Add this at the registrar: ${result.dns.type} ${result.dns.name} -> ${result.dns.target}`;
|
|
8
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import { registerEditTools } from "./tools/edit.js";
|
|
|
21
21
|
import { registerSellTools } from "./tools/sell.js";
|
|
22
22
|
import { registerLocalTools } from "./tools/local.js";
|
|
23
23
|
import { registerReadTools } from "./tools/read.js";
|
|
24
|
-
const VERSION = "0.1.
|
|
24
|
+
const VERSION = "0.1.1";
|
|
25
25
|
async function main() {
|
|
26
26
|
const client = new KleviaClient(readConfig());
|
|
27
27
|
const server = new McpServer({ name: "klevia", version: VERSION }, {
|
package/dist/tools/build.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// refusal comes back as a refusal rather than an exception, so the model
|
|
6
6
|
// reports "the allowance is spent" instead of retrying a wall.
|
|
7
7
|
import { z } from "zod";
|
|
8
|
+
import { manualBuildPayload } from "../contracts.js";
|
|
8
9
|
import { respond } from "./read.js";
|
|
9
10
|
export function registerBuildTools(server, client) {
|
|
10
11
|
server.registerTool("klevia_scan_start", {
|
|
@@ -61,6 +62,17 @@ export function registerBuildTools(server, client) {
|
|
|
61
62
|
data: r,
|
|
62
63
|
};
|
|
63
64
|
}));
|
|
65
|
+
server.registerTool("klevia_scan_answer", {
|
|
66
|
+
title: "Taramanın sorusunu yanıtla",
|
|
67
|
+
description: "Answer the clarifying question reported by klevia_scan and resume that paused scan. Use the operator's answer; do not guess missing facts.",
|
|
68
|
+
inputSchema: { scanId: z.string().uuid(), answer: z.string().trim().min(2).max(4000) },
|
|
69
|
+
annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true },
|
|
70
|
+
}, async ({ scanId, answer }) => respond(async () => {
|
|
71
|
+
const r = await client.request(`/api/v1/scans/${encodeURIComponent(scanId)}/answer`, {
|
|
72
|
+
method: "POST", body: { answer },
|
|
73
|
+
});
|
|
74
|
+
return { summary: "Answer accepted. Read klevia_scan to follow the scan.", data: r };
|
|
75
|
+
}));
|
|
64
76
|
server.registerTool("klevia_scan_approve", {
|
|
65
77
|
title: "Aday listesini onayla",
|
|
66
78
|
description: "THE APPROVAL GATE. Approves or rejects a scan's candidate list. Approving lets the fleet spend real money enriching those businesses, so ask the operator before calling it, and show them the list first with klevia_scan. Businesses passed in dropLeadIds are struck off before the approval takes effect.",
|
|
@@ -141,12 +153,7 @@ export function registerBuildTools(server, client) {
|
|
|
141
153
|
}, async ({ sector, businessName, placeId, phone, address, district }) => respond(async () => {
|
|
142
154
|
const r = await client.request("/api/sites/manual", {
|
|
143
155
|
method: "POST",
|
|
144
|
-
body: {
|
|
145
|
-
sectorKey: sector,
|
|
146
|
-
businessName,
|
|
147
|
-
placeId,
|
|
148
|
-
contact: { phone, address, district },
|
|
149
|
-
},
|
|
156
|
+
body: manualBuildPayload({ sector, businessName, placeId, phone, address, district }),
|
|
150
157
|
});
|
|
151
158
|
return {
|
|
152
159
|
summary: `Demo built: ${r.site.id}`,
|
package/dist/tools/sell.js
CHANGED
|
@@ -5,8 +5,20 @@
|
|
|
5
5
|
// None of them sends anything: reaching the business is still a human opening
|
|
6
6
|
// their own WhatsApp.
|
|
7
7
|
import { z } from "zod";
|
|
8
|
+
import { domainInstructions } from "../contracts.js";
|
|
8
9
|
import { respond } from "./read.js";
|
|
9
10
|
export function registerSellTools(server, client) {
|
|
11
|
+
server.registerTool("klevia_demo_mark_sent", {
|
|
12
|
+
title: "Gönderildi olarak işaretle",
|
|
13
|
+
description: "Record that the operator actually sent the demo. This starts the preview expiry and follow-up clock. Opening WhatsApp does not mean a message was sent. Confirm with the operator first.",
|
|
14
|
+
inputSchema: { demoId: z.string().uuid() },
|
|
15
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true },
|
|
16
|
+
}, async ({ demoId }) => respond(async () => {
|
|
17
|
+
await client.request(`/api/sites/${encodeURIComponent(demoId)}`, {
|
|
18
|
+
method: "PATCH", body: { markSent: true },
|
|
19
|
+
});
|
|
20
|
+
return { summary: "Demo marked sent. The preview expiry and follow-up clock have started.", data: { demoId } };
|
|
21
|
+
}));
|
|
10
22
|
server.registerTool("klevia_demo_publish", {
|
|
11
23
|
title: "Yayına al",
|
|
12
24
|
description: "Put a demo live on its own address. The content is FROZEN at that moment, so later edits do not reach the live page until it is published again. Publishing is the step after the sale, not before sharing: the demo is already shareable at its preview address.",
|
|
@@ -65,9 +77,7 @@ export function registerSellTools(server, client) {
|
|
|
65
77
|
body: { domain },
|
|
66
78
|
});
|
|
67
79
|
return {
|
|
68
|
-
summary: r
|
|
69
|
-
? `${r.domain} attached. Add this at the registrar: ${r.dnsRecord.type} ${r.dnsRecord.name} -> ${r.dnsRecord.target}`
|
|
70
|
-
: `${r.domain} attached.`,
|
|
80
|
+
summary: domainInstructions(r),
|
|
71
81
|
data: r,
|
|
72
82
|
};
|
|
73
83
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "klevia-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Drive Klevia from a CLI or an agent: scan a region, build demo sites, edit them, deliver them.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"zod": "^3.25.76"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
34
|
+
"@types/node": "^24.2.0",
|
|
35
|
+
"tsx": "^4.22.4",
|
|
36
|
+
"typescript": "^5.9.2"
|
|
36
37
|
}
|
|
37
38
|
}
|