@ductape/mcp 0.1.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 ADDED
@@ -0,0 +1,82 @@
1
+ # Ductape MCP Server
2
+
3
+ MCP (Model Context Protocol) server that exposes **Ductape SDK** operations as tools. All calls go through the **Ductape backend proxy** at a fixed URL; the SDK never runs in the MCP process. It is completely stateless; you provide your **Publishable Key** per execution.
4
+
5
+ ## Prerequisites
6
+
7
+ - Ductape backend (proxy and users services) reachable at `https://api.ductape.app` (handled automatically)
8
+ - A workspace **Publishable Key** (from your Ductape workspace)
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ cd platform/mcp-server
14
+ npm install
15
+ ```
16
+
17
+ **MCP SDK:** `npm install` pulls in `@modelcontextprotocol/sdk` and `zod` (v1, recommended). For the v2 alpha server package instead, use `npm install @modelcontextprotocol/server zod @cfworker/json-schema`.
18
+
19
+ ## Configuration & Run
20
+
21
+ ```bash
22
+ npm run build && node dist/index.js
23
+ ```
24
+
25
+ Or with tsx:
26
+
27
+ ```bash
28
+ npm run dev
29
+ ```
30
+
31
+ The server uses **stdio** transport (stdin/stdout), so it is intended to be spawned by an MCP client (e.g. Cursor).
32
+ There are no environment variables required to run the server.
33
+
34
+ ## Cursor configuration
35
+
36
+ In Cursor, add the server in MCP settings (e.g. `~/.cursor/mcp.json` or project `.cursor/mcp.json`):
37
+
38
+ ```json
39
+ {
40
+ "mcpServers": {
41
+ "ductape": {
42
+ "command": "node",
43
+ "args": ["/absolute/path/to/Ductape/platform/mcp-server/dist/index.js"]
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ Use an absolute path for `args[0]`.
50
+
51
+ ## Tools
52
+
53
+ The server exposes **three tools**:
54
+
55
+ 1. **`ductape_execute`**:
56
+ - It runs any allowed SDK module method via the backend proxy.
57
+ - **Arguments:**
58
+ - `publishable_key` (string, required for authentication)
59
+ - `module` (e.g. `databases`, `storage`, `vector`)
60
+ - `method` (e.g. `query`, `list`, `findSimilar`)
61
+ - `params` (array of positional arguments matching the SDK).
62
+ - **Full reference:** The tool description embeds the complete list of modules, allowed methods, and their expected parameters for quick reference. (See **[docs/TOOLS.md](docs/TOOLS.md)** if using a client that requires it).
63
+
64
+ 2. **`ductape_generate_payload`**:
65
+ - Calls backend `POST /integrations/v1/payloads/generate`.
66
+ - Returns canonical executable payload templates with schema metadata (`{ payload, meta }`).
67
+ - Intended for MCP-assisted code snippet generation and payload prefill in agent workflows.
68
+ - **Arguments:**
69
+ - `workspace_id`, `user_id`, `public_key`
70
+ - `product_tag`, `env_slug`
71
+ - `operation_family`, `method`
72
+ - optional `targets`, `schema_mode`, `include_session`, `include_cache`, `input_hint`
73
+
74
+ 3. **`ductape_generate_snippet`**:
75
+ - Calls `ductape_generate_payload` flow and returns:
76
+ - generated payload/meta
77
+ - ready-to-copy SDK snippet in `typescript` or `python`
78
+ - Intended for engineers and copilots that need executable examples quickly.
79
+
80
+ ## Security
81
+
82
+ - Passing the `publishable_key` on a per-request basis guarantees that each execution is isolated. This architecture safely supports deployments that multiplex multiple user connections in a single server thread (e.g., SSE), avoiding cross-tenant leakage.
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Ductape MCP Server
4
+ *
5
+ * Exposes Ductape SDK operations as MCP tools by calling the backend proxy.
6
+ *
7
+ * Authentication:
8
+ * Requires passing a `publishable_key` with every `ductape_execute` payload.
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG"}