@walkeros/mcp 0.3.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 +227 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +790 -0
- package/dist/index.js.map +1 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
# @walkeros/mcp
|
|
2
|
+
|
|
3
|
+
MCP server for walkerOS — validate, bundle, and simulate analytics events
|
|
4
|
+
locally, plus manage projects and flows via the walkerOS API.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm install @walkeros/mcp
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Environment Variables
|
|
13
|
+
|
|
14
|
+
| Variable | Required | Default | Purpose |
|
|
15
|
+
| --------------------- | -------------------------- | ------------------------- | -------------------------------- |
|
|
16
|
+
| `WALKEROS_TOKEN` | Yes (API tools) | — | Bearer token (`sk-walkeros-...`) |
|
|
17
|
+
| `WALKEROS_PROJECT_ID` | Yes (project-scoped tools) | — | Active project ID (`proj_...`) |
|
|
18
|
+
| `WALKEROS_APP_URL` | No | `https://app.walkeros.io` | Base URL override |
|
|
19
|
+
|
|
20
|
+
API tools require `WALKEROS_TOKEN`. Project-scoped tools (flows) also need
|
|
21
|
+
`WALKEROS_PROJECT_ID`, or you can pass `projectId` as a parameter.
|
|
22
|
+
|
|
23
|
+
## Usage with Claude Desktop
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"mcpServers": {
|
|
28
|
+
"walkeros": {
|
|
29
|
+
"command": "npx",
|
|
30
|
+
"args": ["@walkeros/mcp"],
|
|
31
|
+
"env": {
|
|
32
|
+
"WALKEROS_TOKEN": "sk-walkeros-...",
|
|
33
|
+
"WALKEROS_PROJECT_ID": "proj_..."
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Usage with Claude Code
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"mcpServers": {
|
|
45
|
+
"walkeros": {
|
|
46
|
+
"command": "npx",
|
|
47
|
+
"args": ["@walkeros/mcp"],
|
|
48
|
+
"env": {
|
|
49
|
+
"WALKEROS_TOKEN": "sk-walkeros-...",
|
|
50
|
+
"WALKEROS_PROJECT_ID": "proj_..."
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Available Tools (17)
|
|
58
|
+
|
|
59
|
+
### Local CLI Tools
|
|
60
|
+
|
|
61
|
+
#### `validate`
|
|
62
|
+
|
|
63
|
+
Validate walkerOS events, flow configurations, or mapping rules.
|
|
64
|
+
|
|
65
|
+
- `type` (required): `"event"` | `"flow"` | `"mapping"`
|
|
66
|
+
- `input` (required): JSON string or file path to validate
|
|
67
|
+
- `flow` (optional): Flow name to validate against
|
|
68
|
+
|
|
69
|
+
#### `bundle`
|
|
70
|
+
|
|
71
|
+
Bundle a walkerOS flow configuration into deployable JavaScript.
|
|
72
|
+
|
|
73
|
+
- `configPath` (required): Path to the flow configuration file
|
|
74
|
+
- `flow` (optional): Specific flow name to bundle
|
|
75
|
+
- `stats` (optional): Include bundle statistics in output
|
|
76
|
+
- `output` (optional): Output file path for the bundle
|
|
77
|
+
|
|
78
|
+
#### `simulate`
|
|
79
|
+
|
|
80
|
+
Simulate events through a walkerOS flow without making real API calls.
|
|
81
|
+
|
|
82
|
+
- `configPath` (required): Path to the flow configuration file
|
|
83
|
+
- `event` (required): JSON string representing the event to simulate
|
|
84
|
+
- `flow` (optional): Flow name to simulate through
|
|
85
|
+
- `platform` (optional): `"web"` | `"server"` (default: `"web"`)
|
|
86
|
+
|
|
87
|
+
#### `push`
|
|
88
|
+
|
|
89
|
+
Push a real event through a walkerOS flow to actual destinations. WARNING: This
|
|
90
|
+
makes real API calls to real endpoints.
|
|
91
|
+
|
|
92
|
+
- `configPath` (required): Path to the flow configuration file
|
|
93
|
+
- `event` (required): JSON string representing the event to push
|
|
94
|
+
- `flow` (optional): Flow name for multi-flow configs
|
|
95
|
+
- `platform` (optional): `"web"` | `"server"` (default: `"web"`)
|
|
96
|
+
|
|
97
|
+
### Auth
|
|
98
|
+
|
|
99
|
+
#### `whoami`
|
|
100
|
+
|
|
101
|
+
Verify your API token and see your identity. Returns user ID, email, and project
|
|
102
|
+
ID.
|
|
103
|
+
|
|
104
|
+
### Projects
|
|
105
|
+
|
|
106
|
+
#### `list-projects`
|
|
107
|
+
|
|
108
|
+
List all projects you have access to.
|
|
109
|
+
|
|
110
|
+
#### `get-project`
|
|
111
|
+
|
|
112
|
+
Get details for a project. Uses `WALKEROS_PROJECT_ID` if `projectId` is omitted.
|
|
113
|
+
|
|
114
|
+
- `projectId` (optional): Project ID
|
|
115
|
+
|
|
116
|
+
#### `create-project`
|
|
117
|
+
|
|
118
|
+
Create a new project.
|
|
119
|
+
|
|
120
|
+
- `name` (required): Project name
|
|
121
|
+
|
|
122
|
+
#### `update-project`
|
|
123
|
+
|
|
124
|
+
Update a project name.
|
|
125
|
+
|
|
126
|
+
- `projectId` (optional): Project ID
|
|
127
|
+
- `name` (required): New project name
|
|
128
|
+
|
|
129
|
+
#### `delete-project`
|
|
130
|
+
|
|
131
|
+
Soft-delete a project and all its flows.
|
|
132
|
+
|
|
133
|
+
- `projectId` (optional): Project ID
|
|
134
|
+
|
|
135
|
+
### Flows
|
|
136
|
+
|
|
137
|
+
#### `list-flows`
|
|
138
|
+
|
|
139
|
+
List all flow configurations in a project.
|
|
140
|
+
|
|
141
|
+
- `projectId` (optional): Project ID
|
|
142
|
+
- `sort` (optional): `"name"` | `"updated_at"` | `"created_at"`
|
|
143
|
+
- `order` (optional): `"asc"` | `"desc"`
|
|
144
|
+
- `includeDeleted` (optional): Include soft-deleted flows
|
|
145
|
+
|
|
146
|
+
#### `get-flow`
|
|
147
|
+
|
|
148
|
+
Get a flow configuration with its full content.
|
|
149
|
+
|
|
150
|
+
- `flowId` (required): Flow ID (`cfg_...`)
|
|
151
|
+
- `projectId` (optional): Project ID
|
|
152
|
+
|
|
153
|
+
#### `create-flow`
|
|
154
|
+
|
|
155
|
+
Create a new flow configuration.
|
|
156
|
+
|
|
157
|
+
- `name` (required): Flow name
|
|
158
|
+
- `content` (required): Flow.Setup JSON content
|
|
159
|
+
- `projectId` (optional): Project ID
|
|
160
|
+
|
|
161
|
+
#### `update-flow`
|
|
162
|
+
|
|
163
|
+
Update a flow name and/or content. Creates a version snapshot automatically.
|
|
164
|
+
|
|
165
|
+
- `flowId` (required): Flow ID (`cfg_...`)
|
|
166
|
+
- `name` (optional): New flow name
|
|
167
|
+
- `content` (optional): New Flow.Setup JSON content
|
|
168
|
+
- `projectId` (optional): Project ID
|
|
169
|
+
|
|
170
|
+
#### `delete-flow`
|
|
171
|
+
|
|
172
|
+
Soft-delete a flow configuration.
|
|
173
|
+
|
|
174
|
+
- `flowId` (required): Flow ID (`cfg_...`)
|
|
175
|
+
- `projectId` (optional): Project ID
|
|
176
|
+
|
|
177
|
+
#### `duplicate-flow`
|
|
178
|
+
|
|
179
|
+
Create a copy of an existing flow configuration.
|
|
180
|
+
|
|
181
|
+
- `flowId` (required): Flow ID to duplicate (`cfg_...`)
|
|
182
|
+
- `name` (optional): Name for the copy
|
|
183
|
+
- `projectId` (optional): Project ID
|
|
184
|
+
|
|
185
|
+
### Bundle (Remote)
|
|
186
|
+
|
|
187
|
+
#### `bundle-remote`
|
|
188
|
+
|
|
189
|
+
Bundle a flow configuration using the walkerOS cloud service. No local build
|
|
190
|
+
tools needed.
|
|
191
|
+
|
|
192
|
+
- `content` (required): Flow.Setup JSON content
|
|
193
|
+
|
|
194
|
+
## Local Development
|
|
195
|
+
|
|
196
|
+
### Smoke Test
|
|
197
|
+
|
|
198
|
+
A script exercises all API endpoints against a running app instance:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
WALKEROS_TOKEN='<your-token>' \
|
|
202
|
+
WALKEROS_APP_URL=http://localhost:3000 \
|
|
203
|
+
WALKEROS_PROJECT_ID='<your-project-id>' \
|
|
204
|
+
npx tsx packages/mcp/scripts/smoke-test.ts
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Updating the OpenAPI Baseline
|
|
208
|
+
|
|
209
|
+
The contract test (`npm test`) checks that all MCP endpoints exist in a snapshot
|
|
210
|
+
of the app's OpenAPI spec. After API changes:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
curl $WALKEROS_APP_URL/api/openapi.json | python3 -m json.tool \
|
|
214
|
+
> packages/mcp/src/__tests__/fixtures/openapi-baseline.json
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Dependencies
|
|
218
|
+
|
|
219
|
+
This package depends on:
|
|
220
|
+
|
|
221
|
+
- `@walkeros/cli` — walkerOS command-line interface (validate, bundle, simulate,
|
|
222
|
+
push)
|
|
223
|
+
- `@modelcontextprotocol/sdk` — Model Context Protocol server framework
|
|
224
|
+
|
|
225
|
+
## License
|
|
226
|
+
|
|
227
|
+
MIT
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,790 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
+
|
|
7
|
+
// src/tools/bundle.ts
|
|
8
|
+
import { schemas } from "@walkeros/cli/dev";
|
|
9
|
+
|
|
10
|
+
// src/schemas/output.ts
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
var timestamp = z.string().describe("ISO 8601 timestamp");
|
|
13
|
+
var projectId = z.string().describe("Project ID (proj_...)");
|
|
14
|
+
var flowId = z.string().describe("Flow ID (cfg_...)");
|
|
15
|
+
var ErrorOutputShape = {
|
|
16
|
+
error: z.string().describe("Error message")
|
|
17
|
+
};
|
|
18
|
+
var ValidateOutputShape = {
|
|
19
|
+
valid: z.boolean().describe("Whether validation passed"),
|
|
20
|
+
type: z.enum(["event", "flow", "mapping"]).describe("What was validated"),
|
|
21
|
+
errors: z.array(
|
|
22
|
+
z.object({
|
|
23
|
+
path: z.string(),
|
|
24
|
+
message: z.string(),
|
|
25
|
+
value: z.unknown().optional(),
|
|
26
|
+
code: z.string().optional()
|
|
27
|
+
})
|
|
28
|
+
).describe("Validation errors"),
|
|
29
|
+
warnings: z.array(
|
|
30
|
+
z.object({
|
|
31
|
+
path: z.string(),
|
|
32
|
+
message: z.string(),
|
|
33
|
+
suggestion: z.string().optional()
|
|
34
|
+
})
|
|
35
|
+
).describe("Validation warnings"),
|
|
36
|
+
details: z.record(z.string(), z.unknown()).describe("Additional validation details")
|
|
37
|
+
};
|
|
38
|
+
var BundleOutputShape = {
|
|
39
|
+
success: z.boolean().describe("Whether bundling succeeded"),
|
|
40
|
+
totalSize: z.number().optional().describe("Total bundle size in bytes"),
|
|
41
|
+
buildTime: z.number().optional().describe("Build time in milliseconds"),
|
|
42
|
+
packages: z.array(
|
|
43
|
+
z.object({
|
|
44
|
+
name: z.string(),
|
|
45
|
+
size: z.number()
|
|
46
|
+
})
|
|
47
|
+
).optional().describe("Per-package size breakdown"),
|
|
48
|
+
treeshakingEffective: z.boolean().optional().describe("Whether tree-shaking was effective"),
|
|
49
|
+
message: z.string().optional().describe("Status message")
|
|
50
|
+
};
|
|
51
|
+
var SimulateOutputShape = {
|
|
52
|
+
success: z.boolean().describe("Whether simulation succeeded"),
|
|
53
|
+
error: z.string().optional().describe("Error message if simulation failed"),
|
|
54
|
+
collector: z.unknown().optional().describe("Collector state after simulation"),
|
|
55
|
+
elbResult: z.unknown().optional().describe("Push result from the collector"),
|
|
56
|
+
logs: z.array(z.unknown()).optional().describe("Log entries from simulation"),
|
|
57
|
+
usage: z.record(z.string(), z.array(z.unknown())).optional().describe("API call usage per destination"),
|
|
58
|
+
duration: z.number().optional().describe("Simulation duration in milliseconds")
|
|
59
|
+
};
|
|
60
|
+
var PushOutputShape = {
|
|
61
|
+
success: z.boolean().describe("Whether push succeeded"),
|
|
62
|
+
elbResult: z.unknown().optional().describe("Push result from the collector"),
|
|
63
|
+
duration: z.number().describe("Push duration in milliseconds"),
|
|
64
|
+
error: z.string().optional().describe("Error message if push failed")
|
|
65
|
+
};
|
|
66
|
+
var WhoamiOutputShape = {
|
|
67
|
+
userId: z.string().describe("User ID"),
|
|
68
|
+
email: z.string().describe("User email address"),
|
|
69
|
+
projectId: z.string().nullable().describe("Project ID if token is project-scoped")
|
|
70
|
+
};
|
|
71
|
+
var projectFields = {
|
|
72
|
+
id: projectId,
|
|
73
|
+
name: z.string().describe("Project name"),
|
|
74
|
+
role: z.enum(["owner", "member"]).describe("Your role in this project"),
|
|
75
|
+
createdAt: timestamp,
|
|
76
|
+
updatedAt: timestamp
|
|
77
|
+
};
|
|
78
|
+
var ProjectOutputShape = { ...projectFields };
|
|
79
|
+
var ListProjectsOutputShape = {
|
|
80
|
+
projects: z.array(z.object(projectFields)).describe("List of projects"),
|
|
81
|
+
total: z.number().describe("Total number of projects")
|
|
82
|
+
};
|
|
83
|
+
var flowFields = {
|
|
84
|
+
id: flowId,
|
|
85
|
+
name: z.string().describe("Flow name"),
|
|
86
|
+
content: z.record(z.string(), z.unknown()).describe("Flow.Setup JSON content"),
|
|
87
|
+
createdAt: timestamp,
|
|
88
|
+
updatedAt: timestamp,
|
|
89
|
+
deletedAt: z.string().nullable().optional().describe("Deletion timestamp if soft-deleted")
|
|
90
|
+
};
|
|
91
|
+
var FlowOutputShape = { ...flowFields };
|
|
92
|
+
var flowSummaryFields = {
|
|
93
|
+
id: flowId,
|
|
94
|
+
name: z.string().describe("Flow name"),
|
|
95
|
+
createdAt: timestamp,
|
|
96
|
+
updatedAt: timestamp,
|
|
97
|
+
deletedAt: z.string().nullable().describe("Deletion timestamp if soft-deleted")
|
|
98
|
+
};
|
|
99
|
+
var ListFlowsOutputShape = {
|
|
100
|
+
flows: z.array(z.object(flowSummaryFields)).describe("List of flow summaries"),
|
|
101
|
+
total: z.number().describe("Total number of flows")
|
|
102
|
+
};
|
|
103
|
+
var DeleteOutputShape = {
|
|
104
|
+
success: z.literal(true).describe("Deletion succeeded")
|
|
105
|
+
};
|
|
106
|
+
var BundleRemoteOutputShape = {
|
|
107
|
+
success: z.boolean().describe("Whether bundling succeeded"),
|
|
108
|
+
bundle: z.string().describe("Compiled JavaScript bundle"),
|
|
109
|
+
size: z.number().describe("Bundle size in bytes"),
|
|
110
|
+
stats: z.record(z.string(), z.unknown()).optional().describe("Bundle statistics from server")
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// src/tools/bundle.ts
|
|
114
|
+
function registerBundleTool(server2) {
|
|
115
|
+
server2.registerTool(
|
|
116
|
+
"bundle",
|
|
117
|
+
{
|
|
118
|
+
title: "Bundle",
|
|
119
|
+
description: "Bundle a walkerOS flow configuration into deployable JavaScript. Resolves all destinations, sources, and transformers, then outputs a tree-shaken production bundle. Returns bundle statistics.",
|
|
120
|
+
inputSchema: schemas.BundleInputShape,
|
|
121
|
+
outputSchema: BundleOutputShape,
|
|
122
|
+
annotations: {
|
|
123
|
+
readOnlyHint: false,
|
|
124
|
+
destructiveHint: false,
|
|
125
|
+
idempotentHint: true,
|
|
126
|
+
openWorldHint: false
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
async ({ configPath, flow, stats, output }) => {
|
|
130
|
+
try {
|
|
131
|
+
const { bundle } = await import("@walkeros/cli");
|
|
132
|
+
const result = await bundle(configPath, {
|
|
133
|
+
flowName: flow,
|
|
134
|
+
stats: stats ?? true,
|
|
135
|
+
buildOverrides: output ? { output } : void 0
|
|
136
|
+
});
|
|
137
|
+
const output_ = result ?? {
|
|
138
|
+
success: true,
|
|
139
|
+
message: "Bundle created"
|
|
140
|
+
};
|
|
141
|
+
return {
|
|
142
|
+
content: [
|
|
143
|
+
{
|
|
144
|
+
type: "text",
|
|
145
|
+
text: JSON.stringify(output_, null, 2)
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
structuredContent: output_
|
|
149
|
+
};
|
|
150
|
+
} catch (error) {
|
|
151
|
+
return {
|
|
152
|
+
content: [
|
|
153
|
+
{
|
|
154
|
+
type: "text",
|
|
155
|
+
text: JSON.stringify({
|
|
156
|
+
success: false,
|
|
157
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
isError: true
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// src/tools/simulate.ts
|
|
169
|
+
import { schemas as schemas2 } from "@walkeros/cli/dev";
|
|
170
|
+
function registerSimulateTool(server2) {
|
|
171
|
+
server2.registerTool(
|
|
172
|
+
"simulate",
|
|
173
|
+
{
|
|
174
|
+
title: "Simulate",
|
|
175
|
+
description: "Simulate events through a walkerOS flow without making real API calls. Processes events through the full pipeline including transformers and destinations, returning detailed results with logs and usage statistics.",
|
|
176
|
+
inputSchema: schemas2.SimulateInputShape,
|
|
177
|
+
outputSchema: SimulateOutputShape,
|
|
178
|
+
annotations: {
|
|
179
|
+
readOnlyHint: true,
|
|
180
|
+
destructiveHint: false,
|
|
181
|
+
idempotentHint: true,
|
|
182
|
+
openWorldHint: false
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
async ({ configPath, event, flow, platform }) => {
|
|
186
|
+
try {
|
|
187
|
+
const { simulate } = await import("@walkeros/cli");
|
|
188
|
+
let parsedEvent = event;
|
|
189
|
+
if (event.startsWith("{") || event.startsWith("[")) {
|
|
190
|
+
try {
|
|
191
|
+
parsedEvent = JSON.parse(event);
|
|
192
|
+
} catch {
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const result = await simulate(configPath, parsedEvent, {
|
|
196
|
+
json: true,
|
|
197
|
+
flow,
|
|
198
|
+
platform
|
|
199
|
+
});
|
|
200
|
+
return {
|
|
201
|
+
content: [
|
|
202
|
+
{
|
|
203
|
+
type: "text",
|
|
204
|
+
text: JSON.stringify(result, null, 2)
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
structuredContent: result
|
|
208
|
+
};
|
|
209
|
+
} catch (error) {
|
|
210
|
+
return {
|
|
211
|
+
content: [
|
|
212
|
+
{
|
|
213
|
+
type: "text",
|
|
214
|
+
text: JSON.stringify({
|
|
215
|
+
success: false,
|
|
216
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
217
|
+
})
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
isError: true
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// src/tools/push.ts
|
|
228
|
+
import { schemas as schemas3 } from "@walkeros/cli/dev";
|
|
229
|
+
function registerPushTool(server2) {
|
|
230
|
+
server2.registerTool(
|
|
231
|
+
"push",
|
|
232
|
+
{
|
|
233
|
+
title: "Push",
|
|
234
|
+
description: "Push a real event through a walkerOS flow to actual destinations. WARNING: This makes real API calls to real endpoints. Events will be sent to configured destinations (analytics, CRM, etc.).",
|
|
235
|
+
inputSchema: schemas3.PushInputShape,
|
|
236
|
+
outputSchema: PushOutputShape,
|
|
237
|
+
annotations: {
|
|
238
|
+
readOnlyHint: false,
|
|
239
|
+
destructiveHint: true,
|
|
240
|
+
idempotentHint: false,
|
|
241
|
+
openWorldHint: true
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
async ({ configPath, event, flow, platform }) => {
|
|
245
|
+
try {
|
|
246
|
+
const { push } = await import("@walkeros/cli");
|
|
247
|
+
let parsedEvent = event;
|
|
248
|
+
if (event.startsWith("{") || event.startsWith("[")) {
|
|
249
|
+
try {
|
|
250
|
+
parsedEvent = JSON.parse(event);
|
|
251
|
+
} catch {
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
const result = await push(configPath, parsedEvent, {
|
|
255
|
+
json: true,
|
|
256
|
+
flow,
|
|
257
|
+
platform
|
|
258
|
+
});
|
|
259
|
+
return {
|
|
260
|
+
content: [
|
|
261
|
+
{
|
|
262
|
+
type: "text",
|
|
263
|
+
text: JSON.stringify(result, null, 2)
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
structuredContent: result
|
|
267
|
+
};
|
|
268
|
+
} catch (error) {
|
|
269
|
+
return {
|
|
270
|
+
content: [
|
|
271
|
+
{
|
|
272
|
+
type: "text",
|
|
273
|
+
text: JSON.stringify({
|
|
274
|
+
success: false,
|
|
275
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
276
|
+
})
|
|
277
|
+
}
|
|
278
|
+
],
|
|
279
|
+
isError: true
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// src/tools/validate.ts
|
|
287
|
+
import { schemas as schemas4 } from "@walkeros/cli/dev";
|
|
288
|
+
function registerValidateTool(server2) {
|
|
289
|
+
server2.registerTool(
|
|
290
|
+
"validate",
|
|
291
|
+
{
|
|
292
|
+
title: "Validate",
|
|
293
|
+
description: "Validate walkerOS events, flow configurations, or mapping rules. Accepts JSON strings, file paths, or URLs as input. Returns validation results with errors, warnings, and details.",
|
|
294
|
+
inputSchema: schemas4.ValidateInputShape,
|
|
295
|
+
outputSchema: ValidateOutputShape,
|
|
296
|
+
annotations: {
|
|
297
|
+
readOnlyHint: true,
|
|
298
|
+
destructiveHint: false,
|
|
299
|
+
idempotentHint: true,
|
|
300
|
+
openWorldHint: false
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
async ({ type, input, flow }) => {
|
|
304
|
+
try {
|
|
305
|
+
const { validate } = await import("@walkeros/cli");
|
|
306
|
+
let parsedInput = input;
|
|
307
|
+
if (input.startsWith("{") || input.startsWith("[")) {
|
|
308
|
+
try {
|
|
309
|
+
parsedInput = JSON.parse(input);
|
|
310
|
+
} catch {
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
const result = await validate(type, parsedInput, { flow });
|
|
314
|
+
return {
|
|
315
|
+
content: [
|
|
316
|
+
{
|
|
317
|
+
type: "text",
|
|
318
|
+
text: JSON.stringify(result, null, 2)
|
|
319
|
+
}
|
|
320
|
+
],
|
|
321
|
+
structuredContent: result
|
|
322
|
+
};
|
|
323
|
+
} catch (error) {
|
|
324
|
+
return {
|
|
325
|
+
content: [
|
|
326
|
+
{
|
|
327
|
+
type: "text",
|
|
328
|
+
text: JSON.stringify({
|
|
329
|
+
valid: false,
|
|
330
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
331
|
+
})
|
|
332
|
+
}
|
|
333
|
+
],
|
|
334
|
+
isError: true
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// src/tools/auth.ts
|
|
342
|
+
function registerAuthTools(server2) {
|
|
343
|
+
server2.registerTool(
|
|
344
|
+
"whoami",
|
|
345
|
+
{
|
|
346
|
+
title: "Who Am I",
|
|
347
|
+
description: "Verify your API token and see your identity. Returns user ID, email, and project ID (if token is project-scoped). Use this to confirm your token works and discover your project ID.",
|
|
348
|
+
inputSchema: {},
|
|
349
|
+
annotations: {
|
|
350
|
+
readOnlyHint: true,
|
|
351
|
+
destructiveHint: false,
|
|
352
|
+
idempotentHint: true,
|
|
353
|
+
openWorldHint: true
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
async () => {
|
|
357
|
+
try {
|
|
358
|
+
const { whoami } = await import("@walkeros/cli");
|
|
359
|
+
const result = await whoami();
|
|
360
|
+
return {
|
|
361
|
+
content: [
|
|
362
|
+
{ type: "text", text: JSON.stringify(result, null, 2) }
|
|
363
|
+
]
|
|
364
|
+
};
|
|
365
|
+
} catch (error) {
|
|
366
|
+
return {
|
|
367
|
+
content: [
|
|
368
|
+
{
|
|
369
|
+
type: "text",
|
|
370
|
+
text: JSON.stringify({
|
|
371
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
372
|
+
})
|
|
373
|
+
}
|
|
374
|
+
],
|
|
375
|
+
isError: true
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// src/tools/projects.ts
|
|
383
|
+
import { z as z2 } from "zod";
|
|
384
|
+
function apiResult(result) {
|
|
385
|
+
return {
|
|
386
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
function apiError(error) {
|
|
390
|
+
return {
|
|
391
|
+
content: [
|
|
392
|
+
{
|
|
393
|
+
type: "text",
|
|
394
|
+
text: JSON.stringify({
|
|
395
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
396
|
+
})
|
|
397
|
+
}
|
|
398
|
+
],
|
|
399
|
+
isError: true
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
function registerProjectTools(server2) {
|
|
403
|
+
server2.registerTool(
|
|
404
|
+
"list-projects",
|
|
405
|
+
{
|
|
406
|
+
title: "List Projects",
|
|
407
|
+
description: "List all projects you have access to. Returns project IDs, names, and your role.",
|
|
408
|
+
inputSchema: {},
|
|
409
|
+
annotations: {
|
|
410
|
+
readOnlyHint: true,
|
|
411
|
+
destructiveHint: false,
|
|
412
|
+
idempotentHint: true,
|
|
413
|
+
openWorldHint: true
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
async () => {
|
|
417
|
+
try {
|
|
418
|
+
const { listProjects } = await import("@walkeros/cli");
|
|
419
|
+
return apiResult(await listProjects());
|
|
420
|
+
} catch (error) {
|
|
421
|
+
return apiError(error);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
);
|
|
425
|
+
server2.registerTool(
|
|
426
|
+
"get-project",
|
|
427
|
+
{
|
|
428
|
+
title: "Get Project",
|
|
429
|
+
description: "Get details for a project. Uses WALKEROS_PROJECT_ID if projectId is omitted.",
|
|
430
|
+
inputSchema: {
|
|
431
|
+
projectId: z2.string().optional().describe("Project ID (defaults to WALKEROS_PROJECT_ID)")
|
|
432
|
+
},
|
|
433
|
+
annotations: {
|
|
434
|
+
readOnlyHint: true,
|
|
435
|
+
destructiveHint: false,
|
|
436
|
+
idempotentHint: true,
|
|
437
|
+
openWorldHint: true
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
async ({ projectId: projectId2 }) => {
|
|
441
|
+
try {
|
|
442
|
+
const { getProject } = await import("@walkeros/cli");
|
|
443
|
+
return apiResult(await getProject({ projectId: projectId2 }));
|
|
444
|
+
} catch (error) {
|
|
445
|
+
return apiError(error);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
);
|
|
449
|
+
server2.registerTool(
|
|
450
|
+
"create-project",
|
|
451
|
+
{
|
|
452
|
+
title: "Create Project",
|
|
453
|
+
description: "Create a new project.",
|
|
454
|
+
inputSchema: {
|
|
455
|
+
name: z2.string().min(1).max(255).describe("Project name")
|
|
456
|
+
},
|
|
457
|
+
annotations: {
|
|
458
|
+
readOnlyHint: false,
|
|
459
|
+
destructiveHint: false,
|
|
460
|
+
idempotentHint: false,
|
|
461
|
+
openWorldHint: true
|
|
462
|
+
}
|
|
463
|
+
},
|
|
464
|
+
async ({ name }) => {
|
|
465
|
+
try {
|
|
466
|
+
const { createProject } = await import("@walkeros/cli");
|
|
467
|
+
return apiResult(await createProject({ name }));
|
|
468
|
+
} catch (error) {
|
|
469
|
+
return apiError(error);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
);
|
|
473
|
+
server2.registerTool(
|
|
474
|
+
"update-project",
|
|
475
|
+
{
|
|
476
|
+
title: "Update Project",
|
|
477
|
+
description: "Update a project name. Uses WALKEROS_PROJECT_ID if projectId is omitted.",
|
|
478
|
+
inputSchema: {
|
|
479
|
+
projectId: z2.string().optional().describe("Project ID (defaults to WALKEROS_PROJECT_ID)"),
|
|
480
|
+
name: z2.string().min(1).max(255).describe("New project name")
|
|
481
|
+
},
|
|
482
|
+
annotations: {
|
|
483
|
+
readOnlyHint: false,
|
|
484
|
+
destructiveHint: false,
|
|
485
|
+
idempotentHint: false,
|
|
486
|
+
openWorldHint: true
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
async ({ projectId: projectId2, name }) => {
|
|
490
|
+
try {
|
|
491
|
+
const { updateProject } = await import("@walkeros/cli");
|
|
492
|
+
return apiResult(await updateProject({ projectId: projectId2, name }));
|
|
493
|
+
} catch (error) {
|
|
494
|
+
return apiError(error);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
);
|
|
498
|
+
server2.registerTool(
|
|
499
|
+
"delete-project",
|
|
500
|
+
{
|
|
501
|
+
title: "Delete Project",
|
|
502
|
+
description: "Soft-delete a project and all its flows. Uses WALKEROS_PROJECT_ID if projectId is omitted.",
|
|
503
|
+
inputSchema: {
|
|
504
|
+
projectId: z2.string().optional().describe("Project ID (defaults to WALKEROS_PROJECT_ID)")
|
|
505
|
+
},
|
|
506
|
+
annotations: {
|
|
507
|
+
readOnlyHint: false,
|
|
508
|
+
destructiveHint: true,
|
|
509
|
+
idempotentHint: false,
|
|
510
|
+
openWorldHint: true
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
async ({ projectId: projectId2 }) => {
|
|
514
|
+
try {
|
|
515
|
+
const { deleteProject } = await import("@walkeros/cli");
|
|
516
|
+
return apiResult(await deleteProject({ projectId: projectId2 }));
|
|
517
|
+
} catch (error) {
|
|
518
|
+
return apiError(error);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
// src/tools/flows.ts
|
|
525
|
+
import { z as z3 } from "zod";
|
|
526
|
+
function apiResult2(result) {
|
|
527
|
+
return {
|
|
528
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
function apiError2(error) {
|
|
532
|
+
return {
|
|
533
|
+
content: [
|
|
534
|
+
{
|
|
535
|
+
type: "text",
|
|
536
|
+
text: JSON.stringify({
|
|
537
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
538
|
+
})
|
|
539
|
+
}
|
|
540
|
+
],
|
|
541
|
+
isError: true
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
function registerFlowTools(server2) {
|
|
545
|
+
server2.registerTool(
|
|
546
|
+
"list-flows",
|
|
547
|
+
{
|
|
548
|
+
title: "List Flows",
|
|
549
|
+
description: "List all flow configurations in a project.",
|
|
550
|
+
inputSchema: {
|
|
551
|
+
projectId: z3.string().optional().describe("Project ID (defaults to WALKEROS_PROJECT_ID)"),
|
|
552
|
+
sort: z3.enum(["name", "updated_at", "created_at"]).optional().describe("Sort field (default: updated_at)"),
|
|
553
|
+
order: z3.enum(["asc", "desc"]).optional().describe("Sort order (default: desc)"),
|
|
554
|
+
includeDeleted: z3.boolean().optional().describe("Include soft-deleted flows (default: false)")
|
|
555
|
+
},
|
|
556
|
+
annotations: {
|
|
557
|
+
readOnlyHint: true,
|
|
558
|
+
destructiveHint: false,
|
|
559
|
+
idempotentHint: true,
|
|
560
|
+
openWorldHint: true
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
async ({ projectId: projectId2, sort, order, includeDeleted }) => {
|
|
564
|
+
try {
|
|
565
|
+
const { listFlows } = await import("@walkeros/cli");
|
|
566
|
+
return apiResult2(
|
|
567
|
+
await listFlows({ projectId: projectId2, sort, order, includeDeleted })
|
|
568
|
+
);
|
|
569
|
+
} catch (error) {
|
|
570
|
+
return apiError2(error);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
);
|
|
574
|
+
server2.registerTool(
|
|
575
|
+
"get-flow",
|
|
576
|
+
{
|
|
577
|
+
title: "Get Flow",
|
|
578
|
+
description: "Get a flow configuration with its full content (Flow.Setup JSON).",
|
|
579
|
+
inputSchema: {
|
|
580
|
+
flowId: z3.string().describe("Flow ID (cfg_...)"),
|
|
581
|
+
projectId: z3.string().optional().describe("Project ID (defaults to WALKEROS_PROJECT_ID)")
|
|
582
|
+
},
|
|
583
|
+
annotations: {
|
|
584
|
+
readOnlyHint: true,
|
|
585
|
+
destructiveHint: false,
|
|
586
|
+
idempotentHint: true,
|
|
587
|
+
openWorldHint: true
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
async ({ flowId: flowId2, projectId: projectId2 }) => {
|
|
591
|
+
try {
|
|
592
|
+
const { getFlow } = await import("@walkeros/cli");
|
|
593
|
+
return apiResult2(await getFlow({ flowId: flowId2, projectId: projectId2 }));
|
|
594
|
+
} catch (error) {
|
|
595
|
+
return apiError2(error);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
);
|
|
599
|
+
server2.registerTool(
|
|
600
|
+
"create-flow",
|
|
601
|
+
{
|
|
602
|
+
title: "Create Flow",
|
|
603
|
+
description: "Create a new flow configuration in a project.",
|
|
604
|
+
inputSchema: {
|
|
605
|
+
name: z3.string().min(1).max(255).describe("Flow name"),
|
|
606
|
+
content: z3.record(z3.string(), z3.unknown()).describe("Flow.Setup JSON content (must have version: 1)"),
|
|
607
|
+
projectId: z3.string().optional().describe("Project ID (defaults to WALKEROS_PROJECT_ID)")
|
|
608
|
+
},
|
|
609
|
+
annotations: {
|
|
610
|
+
readOnlyHint: false,
|
|
611
|
+
destructiveHint: false,
|
|
612
|
+
idempotentHint: false,
|
|
613
|
+
openWorldHint: true
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
async ({ name, content, projectId: projectId2 }) => {
|
|
617
|
+
try {
|
|
618
|
+
const { createFlow } = await import("@walkeros/cli");
|
|
619
|
+
return apiResult2(await createFlow({ name, content, projectId: projectId2 }));
|
|
620
|
+
} catch (error) {
|
|
621
|
+
return apiError2(error);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
);
|
|
625
|
+
server2.registerTool(
|
|
626
|
+
"update-flow",
|
|
627
|
+
{
|
|
628
|
+
title: "Update Flow",
|
|
629
|
+
description: "Update a flow configuration name and/or content. Creates a version snapshot automatically.",
|
|
630
|
+
inputSchema: {
|
|
631
|
+
flowId: z3.string().describe("Flow ID (cfg_...)"),
|
|
632
|
+
name: z3.string().min(1).max(255).optional().describe("New flow name"),
|
|
633
|
+
content: z3.record(z3.string(), z3.unknown()).optional().describe("New Flow.Setup JSON content"),
|
|
634
|
+
projectId: z3.string().optional().describe("Project ID (defaults to WALKEROS_PROJECT_ID)")
|
|
635
|
+
},
|
|
636
|
+
annotations: {
|
|
637
|
+
readOnlyHint: false,
|
|
638
|
+
destructiveHint: false,
|
|
639
|
+
idempotentHint: false,
|
|
640
|
+
openWorldHint: true
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
async ({ flowId: flowId2, name, content, projectId: projectId2 }) => {
|
|
644
|
+
try {
|
|
645
|
+
const { updateFlow } = await import("@walkeros/cli");
|
|
646
|
+
return apiResult2(
|
|
647
|
+
await updateFlow({ flowId: flowId2, name, content, projectId: projectId2 })
|
|
648
|
+
);
|
|
649
|
+
} catch (error) {
|
|
650
|
+
return apiError2(error);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
);
|
|
654
|
+
server2.registerTool(
|
|
655
|
+
"delete-flow",
|
|
656
|
+
{
|
|
657
|
+
title: "Delete Flow",
|
|
658
|
+
description: "Soft-delete a flow configuration. Can be restored later.",
|
|
659
|
+
inputSchema: {
|
|
660
|
+
flowId: z3.string().describe("Flow ID (cfg_...)"),
|
|
661
|
+
projectId: z3.string().optional().describe("Project ID (defaults to WALKEROS_PROJECT_ID)")
|
|
662
|
+
},
|
|
663
|
+
annotations: {
|
|
664
|
+
readOnlyHint: false,
|
|
665
|
+
destructiveHint: true,
|
|
666
|
+
idempotentHint: false,
|
|
667
|
+
openWorldHint: true
|
|
668
|
+
}
|
|
669
|
+
},
|
|
670
|
+
async ({ flowId: flowId2, projectId: projectId2 }) => {
|
|
671
|
+
try {
|
|
672
|
+
const { deleteFlow } = await import("@walkeros/cli");
|
|
673
|
+
return apiResult2(await deleteFlow({ flowId: flowId2, projectId: projectId2 }));
|
|
674
|
+
} catch (error) {
|
|
675
|
+
return apiError2(error);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
);
|
|
679
|
+
server2.registerTool(
|
|
680
|
+
"duplicate-flow",
|
|
681
|
+
{
|
|
682
|
+
title: "Duplicate Flow",
|
|
683
|
+
description: "Create a copy of an existing flow configuration.",
|
|
684
|
+
inputSchema: {
|
|
685
|
+
flowId: z3.string().describe("Flow ID to duplicate (cfg_...)"),
|
|
686
|
+
name: z3.string().optional().describe('Name for the copy (defaults to "Copy of ...")'),
|
|
687
|
+
projectId: z3.string().optional().describe("Project ID (defaults to WALKEROS_PROJECT_ID)")
|
|
688
|
+
},
|
|
689
|
+
annotations: {
|
|
690
|
+
readOnlyHint: false,
|
|
691
|
+
destructiveHint: false,
|
|
692
|
+
idempotentHint: false,
|
|
693
|
+
openWorldHint: true
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
async ({ flowId: flowId2, name, projectId: projectId2 }) => {
|
|
697
|
+
try {
|
|
698
|
+
const { duplicateFlow } = await import("@walkeros/cli");
|
|
699
|
+
return apiResult2(await duplicateFlow({ flowId: flowId2, name, projectId: projectId2 }));
|
|
700
|
+
} catch (error) {
|
|
701
|
+
return apiError2(error);
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
// src/tools/bundle-remote.ts
|
|
708
|
+
import { z as z4 } from "zod";
|
|
709
|
+
import { apiRequest } from "@walkeros/cli";
|
|
710
|
+
function registerBundleRemoteTool(server2) {
|
|
711
|
+
server2.registerTool(
|
|
712
|
+
"bundle-remote",
|
|
713
|
+
{
|
|
714
|
+
title: "Bundle Remote",
|
|
715
|
+
description: "Bundle a flow configuration into deployable JavaScript using the walkerOS cloud service. Sends config JSON and receives a compiled .mjs bundle. No local build tools needed.",
|
|
716
|
+
inputSchema: {
|
|
717
|
+
content: z4.record(z4.string(), z4.unknown()).describe("Flow.Setup JSON content (must have version: 1)")
|
|
718
|
+
},
|
|
719
|
+
annotations: {
|
|
720
|
+
readOnlyHint: true,
|
|
721
|
+
destructiveHint: false,
|
|
722
|
+
idempotentHint: true,
|
|
723
|
+
openWorldHint: true
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
async ({ content }) => {
|
|
727
|
+
try {
|
|
728
|
+
const response = await apiRequest("/api/bundle", {
|
|
729
|
+
method: "POST",
|
|
730
|
+
body: JSON.stringify({ flow: content }),
|
|
731
|
+
responseFormat: "raw"
|
|
732
|
+
});
|
|
733
|
+
const js = await response.text();
|
|
734
|
+
const statsHeader = response.headers.get("X-Bundle-Stats");
|
|
735
|
+
const result = {
|
|
736
|
+
success: true,
|
|
737
|
+
bundle: js,
|
|
738
|
+
size: js.length
|
|
739
|
+
};
|
|
740
|
+
if (statsHeader) {
|
|
741
|
+
try {
|
|
742
|
+
result.stats = JSON.parse(statsHeader);
|
|
743
|
+
} catch {
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
return {
|
|
747
|
+
content: [
|
|
748
|
+
{ type: "text", text: JSON.stringify(result, null, 2) }
|
|
749
|
+
]
|
|
750
|
+
};
|
|
751
|
+
} catch (error) {
|
|
752
|
+
return {
|
|
753
|
+
content: [
|
|
754
|
+
{
|
|
755
|
+
type: "text",
|
|
756
|
+
text: JSON.stringify({
|
|
757
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
758
|
+
})
|
|
759
|
+
}
|
|
760
|
+
],
|
|
761
|
+
isError: true
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// src/index.ts
|
|
769
|
+
var server = new McpServer({
|
|
770
|
+
name: "walkeros",
|
|
771
|
+
version: "0.3.0"
|
|
772
|
+
});
|
|
773
|
+
registerBundleTool(server);
|
|
774
|
+
registerSimulateTool(server);
|
|
775
|
+
registerPushTool(server);
|
|
776
|
+
registerValidateTool(server);
|
|
777
|
+
registerAuthTools(server);
|
|
778
|
+
registerProjectTools(server);
|
|
779
|
+
registerFlowTools(server);
|
|
780
|
+
registerBundleRemoteTool(server);
|
|
781
|
+
async function main() {
|
|
782
|
+
const transport = new StdioServerTransport();
|
|
783
|
+
await server.connect(transport);
|
|
784
|
+
console.error("walkerOS MCP server running on stdio");
|
|
785
|
+
}
|
|
786
|
+
main().catch((error) => {
|
|
787
|
+
console.error("Failed to start MCP server:", error);
|
|
788
|
+
process.exit(1);
|
|
789
|
+
});
|
|
790
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/tools/bundle.ts","../src/schemas/output.ts","../src/tools/simulate.ts","../src/tools/push.ts","../src/tools/validate.ts","../src/tools/auth.ts","../src/tools/projects.ts","../src/tools/flows.ts","../src/tools/bundle-remote.ts"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\n// Local CLI tools\nimport { registerBundleTool } from './tools/bundle.js';\nimport { registerSimulateTool } from './tools/simulate.js';\nimport { registerPushTool } from './tools/push.js';\nimport { registerValidateTool } from './tools/validate.js';\n// API tools\nimport { registerAuthTools } from './tools/auth.js';\nimport { registerProjectTools } from './tools/projects.js';\nimport { registerFlowTools } from './tools/flows.js';\nimport { registerBundleRemoteTool } from './tools/bundle-remote.js';\n\ndeclare const __VERSION__: string;\n\nconst server = new McpServer({\n name: 'walkeros',\n version: __VERSION__,\n});\n\n// Local CLI tools\nregisterBundleTool(server);\nregisterSimulateTool(server);\nregisterPushTool(server);\nregisterValidateTool(server);\n\n// API tools\nregisterAuthTools(server);\nregisterProjectTools(server);\nregisterFlowTools(server);\nregisterBundleRemoteTool(server);\n\nasync function main() {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n console.error('walkerOS MCP server running on stdio');\n}\n\nmain().catch((error) => {\n console.error('Failed to start MCP server:', error);\n process.exit(1);\n});\n","import { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { BundleOutputShape } from '../schemas/output.js';\n\nexport function registerBundleTool(server: McpServer) {\n server.registerTool(\n 'bundle',\n {\n title: 'Bundle',\n description:\n 'Bundle a walkerOS flow configuration into deployable JavaScript. ' +\n 'Resolves all destinations, sources, and transformers, then outputs ' +\n 'a tree-shaken production bundle. Returns bundle statistics.',\n inputSchema: schemas.BundleInputShape,\n outputSchema: BundleOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ configPath, flow, stats, output }) => {\n try {\n // Dynamic import to handle peer dependency\n const { bundle } = await import('@walkeros/cli');\n\n const result = await bundle(configPath, {\n flowName: flow,\n stats: stats ?? true,\n buildOverrides: output ? { output } : undefined,\n });\n\n const output_ = (result as unknown as Record<string, unknown>) ?? {\n success: true,\n message: 'Bundle created',\n };\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(output_, null, 2),\n },\n ],\n structuredContent: output_,\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true,\n };\n }\n },\n );\n}\n","import { z } from 'zod';\n\n// Shared primitives\nconst timestamp = z.string().describe('ISO 8601 timestamp');\nconst projectId = z.string().describe('Project ID (proj_...)');\nconst flowId = z.string().describe('Flow ID (cfg_...)');\n\n// Error shape (for reference)\nexport const ErrorOutputShape = {\n error: z.string().describe('Error message'),\n};\n\n// CLI tool output shapes\nexport const ValidateOutputShape = {\n valid: z.boolean().describe('Whether validation passed'),\n type: z.enum(['event', 'flow', 'mapping']).describe('What was validated'),\n errors: z\n .array(\n z.object({\n path: z.string(),\n message: z.string(),\n value: z.unknown().optional(),\n code: z.string().optional(),\n }),\n )\n .describe('Validation errors'),\n warnings: z\n .array(\n z.object({\n path: z.string(),\n message: z.string(),\n suggestion: z.string().optional(),\n }),\n )\n .describe('Validation warnings'),\n details: z\n .record(z.string(), z.unknown())\n .describe('Additional validation details'),\n};\n\nexport const BundleOutputShape = {\n success: z.boolean().describe('Whether bundling succeeded'),\n totalSize: z.number().optional().describe('Total bundle size in bytes'),\n buildTime: z.number().optional().describe('Build time in milliseconds'),\n packages: z\n .array(\n z.object({\n name: z.string(),\n size: z.number(),\n }),\n )\n .optional()\n .describe('Per-package size breakdown'),\n treeshakingEffective: z\n .boolean()\n .optional()\n .describe('Whether tree-shaking was effective'),\n message: z.string().optional().describe('Status message'),\n};\n\nexport const SimulateOutputShape = {\n success: z.boolean().describe('Whether simulation succeeded'),\n error: z.string().optional().describe('Error message if simulation failed'),\n collector: z\n .unknown()\n .optional()\n .describe('Collector state after simulation'),\n elbResult: z.unknown().optional().describe('Push result from the collector'),\n logs: z.array(z.unknown()).optional().describe('Log entries from simulation'),\n usage: z\n .record(z.string(), z.array(z.unknown()))\n .optional()\n .describe('API call usage per destination'),\n duration: z\n .number()\n .optional()\n .describe('Simulation duration in milliseconds'),\n};\n\nexport const PushOutputShape = {\n success: z.boolean().describe('Whether push succeeded'),\n elbResult: z.unknown().optional().describe('Push result from the collector'),\n duration: z.number().describe('Push duration in milliseconds'),\n error: z.string().optional().describe('Error message if push failed'),\n};\n\n// Auth output shapes\nexport const WhoamiOutputShape = {\n userId: z.string().describe('User ID'),\n email: z.string().describe('User email address'),\n projectId: z\n .string()\n .nullable()\n .describe('Project ID if token is project-scoped'),\n};\n\n// Project output shapes\nconst projectFields = {\n id: projectId,\n name: z.string().describe('Project name'),\n role: z.enum(['owner', 'member']).describe('Your role in this project'),\n createdAt: timestamp,\n updatedAt: timestamp,\n};\n\nexport const ProjectOutputShape = { ...projectFields };\n\nexport const ListProjectsOutputShape = {\n projects: z.array(z.object(projectFields)).describe('List of projects'),\n total: z.number().describe('Total number of projects'),\n};\n\n// Flow output shapes\nconst flowFields = {\n id: flowId,\n name: z.string().describe('Flow name'),\n content: z\n .record(z.string(), z.unknown())\n .describe('Flow.Setup JSON content'),\n createdAt: timestamp,\n updatedAt: timestamp,\n deletedAt: z\n .string()\n .nullable()\n .optional()\n .describe('Deletion timestamp if soft-deleted'),\n};\n\nexport const FlowOutputShape = { ...flowFields };\n\nconst flowSummaryFields = {\n id: flowId,\n name: z.string().describe('Flow name'),\n createdAt: timestamp,\n updatedAt: timestamp,\n deletedAt: z\n .string()\n .nullable()\n .describe('Deletion timestamp if soft-deleted'),\n};\n\nexport const ListFlowsOutputShape = {\n flows: z\n .array(z.object(flowSummaryFields))\n .describe('List of flow summaries'),\n total: z.number().describe('Total number of flows'),\n};\n\n// Delete output shape (shared)\nexport const DeleteOutputShape = {\n success: z.literal(true).describe('Deletion succeeded'),\n};\n\n// Bundle Remote output shape\nexport const BundleRemoteOutputShape = {\n success: z.boolean().describe('Whether bundling succeeded'),\n bundle: z.string().describe('Compiled JavaScript bundle'),\n size: z.number().describe('Bundle size in bytes'),\n stats: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Bundle statistics from server'),\n};\n","import { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { SimulateOutputShape } from '../schemas/output.js';\n\nexport function registerSimulateTool(server: McpServer) {\n server.registerTool(\n 'simulate',\n {\n title: 'Simulate',\n description:\n 'Simulate events through a walkerOS flow without making real API calls. ' +\n 'Processes events through the full pipeline including transformers and destinations, ' +\n 'returning detailed results with logs and usage statistics.',\n inputSchema: schemas.SimulateInputShape,\n outputSchema: SimulateOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ configPath, event, flow, platform }) => {\n try {\n const { simulate } = await import('@walkeros/cli');\n\n // Parse event if JSON string\n let parsedEvent: unknown = event;\n if (event.startsWith('{') || event.startsWith('[')) {\n try {\n parsedEvent = JSON.parse(event);\n } catch {\n // Keep as string (file path or URL)\n }\n }\n\n const result = await simulate(configPath, parsedEvent, {\n json: true,\n flow,\n platform,\n });\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(result, null, 2),\n },\n ],\n structuredContent: result as unknown as Record<string, unknown>,\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true,\n };\n }\n },\n );\n}\n","import { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { PushOutputShape } from '../schemas/output.js';\n\nexport function registerPushTool(server: McpServer) {\n server.registerTool(\n 'push',\n {\n title: 'Push',\n description:\n 'Push a real event through a walkerOS flow to actual destinations. ' +\n 'WARNING: This makes real API calls to real endpoints. ' +\n 'Events will be sent to configured destinations (analytics, CRM, etc.).',\n inputSchema: schemas.PushInputShape,\n outputSchema: PushOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ configPath, event, flow, platform }) => {\n try {\n const { push } = await import('@walkeros/cli');\n\n // Parse event if JSON string\n let parsedEvent: unknown = event;\n if (event.startsWith('{') || event.startsWith('[')) {\n try {\n parsedEvent = JSON.parse(event);\n } catch {\n // Keep as string (file path or URL)\n }\n }\n\n const result = await push(configPath, parsedEvent, {\n json: true,\n flow,\n platform,\n });\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(result, null, 2),\n },\n ],\n structuredContent: result as unknown as Record<string, unknown>,\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n success: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true,\n };\n }\n },\n );\n}\n","import { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { ValidateOutputShape } from '../schemas/output.js';\n\nexport function registerValidateTool(server: McpServer) {\n server.registerTool(\n 'validate',\n {\n title: 'Validate',\n description:\n 'Validate walkerOS events, flow configurations, or mapping rules. ' +\n 'Accepts JSON strings, file paths, or URLs as input. ' +\n 'Returns validation results with errors, warnings, and details.',\n inputSchema: schemas.ValidateInputShape,\n outputSchema: ValidateOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ type, input, flow }) => {\n try {\n // Dynamic import to handle peer dependency\n const { validate } = await import('@walkeros/cli');\n\n // Parse input if it looks like JSON\n let parsedInput: unknown = input;\n if (input.startsWith('{') || input.startsWith('[')) {\n try {\n parsedInput = JSON.parse(input);\n } catch {\n // Keep as string (file path or URL)\n }\n }\n\n const result = await validate(type, parsedInput, { flow });\n\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify(result, null, 2),\n },\n ],\n structuredContent: result as unknown as Record<string, unknown>,\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n valid: false,\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true,\n };\n }\n },\n );\n}\n","import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerAuthTools(server: McpServer) {\n server.registerTool(\n 'whoami',\n {\n title: 'Who Am I',\n description:\n 'Verify your API token and see your identity. ' +\n 'Returns user ID, email, and project ID (if token is project-scoped). ' +\n 'Use this to confirm your token works and discover your project ID.',\n inputSchema: {},\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async () => {\n try {\n const { whoami } = await import('@walkeros/cli');\n const result = await whoami();\n return {\n content: [\n { type: 'text' as const, text: JSON.stringify(result, null, 2) },\n ],\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true,\n };\n }\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nfunction apiResult(result: unknown) {\n return {\n content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],\n };\n}\n\nfunction apiError(error: unknown) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true as const,\n };\n}\n\nexport function registerProjectTools(server: McpServer) {\n server.registerTool(\n 'list-projects',\n {\n title: 'List Projects',\n description:\n 'List all projects you have access to. Returns project IDs, names, and your role.',\n inputSchema: {},\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async () => {\n try {\n const { listProjects } = await import('@walkeros/cli');\n return apiResult(await listProjects());\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'get-project',\n {\n title: 'Get Project',\n description:\n 'Get details for a project. Uses WALKEROS_PROJECT_ID if projectId is omitted.',\n inputSchema: {\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ projectId }) => {\n try {\n const { getProject } = await import('@walkeros/cli');\n return apiResult(await getProject({ projectId }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'create-project',\n {\n title: 'Create Project',\n description: 'Create a new project.',\n inputSchema: {\n name: z.string().min(1).max(255).describe('Project name'),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ name }) => {\n try {\n const { createProject } = await import('@walkeros/cli');\n return apiResult(await createProject({ name }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'update-project',\n {\n title: 'Update Project',\n description:\n 'Update a project name. Uses WALKEROS_PROJECT_ID if projectId is omitted.',\n inputSchema: {\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n name: z.string().min(1).max(255).describe('New project name'),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ projectId, name }) => {\n try {\n const { updateProject } = await import('@walkeros/cli');\n return apiResult(await updateProject({ projectId, name }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'delete-project',\n {\n title: 'Delete Project',\n description:\n 'Soft-delete a project and all its flows. Uses WALKEROS_PROJECT_ID if projectId is omitted.',\n inputSchema: {\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ projectId }) => {\n try {\n const { deleteProject } = await import('@walkeros/cli');\n return apiResult(await deleteProject({ projectId }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nfunction apiResult(result: unknown) {\n return {\n content: [{ type: 'text' as const, text: JSON.stringify(result, null, 2) }],\n };\n}\n\nfunction apiError(error: unknown) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true as const,\n };\n}\n\nexport function registerFlowTools(server: McpServer) {\n server.registerTool(\n 'list-flows',\n {\n title: 'List Flows',\n description: 'List all flow configurations in a project.',\n inputSchema: {\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n sort: z\n .enum(['name', 'updated_at', 'created_at'])\n .optional()\n .describe('Sort field (default: updated_at)'),\n order: z\n .enum(['asc', 'desc'])\n .optional()\n .describe('Sort order (default: desc)'),\n includeDeleted: z\n .boolean()\n .optional()\n .describe('Include soft-deleted flows (default: false)'),\n },\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ projectId, sort, order, includeDeleted }) => {\n try {\n const { listFlows } = await import('@walkeros/cli');\n return apiResult(\n await listFlows({ projectId, sort, order, includeDeleted }),\n );\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'get-flow',\n {\n title: 'Get Flow',\n description:\n 'Get a flow configuration with its full content (Flow.Setup JSON).',\n inputSchema: {\n flowId: z.string().describe('Flow ID (cfg_...)'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ flowId, projectId }) => {\n try {\n const { getFlow } = await import('@walkeros/cli');\n return apiResult(await getFlow({ flowId, projectId }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'create-flow',\n {\n title: 'Create Flow',\n description: 'Create a new flow configuration in a project.',\n inputSchema: {\n name: z.string().min(1).max(255).describe('Flow name'),\n content: z\n .record(z.string(), z.unknown())\n .describe('Flow.Setup JSON content (must have version: 1)'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ name, content, projectId }) => {\n try {\n const { createFlow } = await import('@walkeros/cli');\n return apiResult(await createFlow({ name, content, projectId }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'update-flow',\n {\n title: 'Update Flow',\n description:\n 'Update a flow configuration name and/or content. Creates a version snapshot automatically.',\n inputSchema: {\n flowId: z.string().describe('Flow ID (cfg_...)'),\n name: z.string().min(1).max(255).optional().describe('New flow name'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('New Flow.Setup JSON content'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ flowId, name, content, projectId }) => {\n try {\n const { updateFlow } = await import('@walkeros/cli');\n return apiResult(\n await updateFlow({ flowId, name, content, projectId }),\n );\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'delete-flow',\n {\n title: 'Delete Flow',\n description: 'Soft-delete a flow configuration. Can be restored later.',\n inputSchema: {\n flowId: z.string().describe('Flow ID (cfg_...)'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ flowId, projectId }) => {\n try {\n const { deleteFlow } = await import('@walkeros/cli');\n return apiResult(await deleteFlow({ flowId, projectId }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n\n server.registerTool(\n 'duplicate-flow',\n {\n title: 'Duplicate Flow',\n description: 'Create a copy of an existing flow configuration.',\n inputSchema: {\n flowId: z.string().describe('Flow ID to duplicate (cfg_...)'),\n name: z\n .string()\n .optional()\n .describe('Name for the copy (defaults to \"Copy of ...\")'),\n projectId: z\n .string()\n .optional()\n .describe('Project ID (defaults to WALKEROS_PROJECT_ID)'),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ flowId, name, projectId }) => {\n try {\n const { duplicateFlow } = await import('@walkeros/cli');\n return apiResult(await duplicateFlow({ flowId, name, projectId }));\n } catch (error) {\n return apiError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { apiRequest } from '@walkeros/cli';\n\nexport function registerBundleRemoteTool(server: McpServer) {\n server.registerTool(\n 'bundle-remote',\n {\n title: 'Bundle Remote',\n description:\n 'Bundle a flow configuration into deployable JavaScript using the walkerOS cloud service. ' +\n 'Sends config JSON and receives a compiled .mjs bundle. No local build tools needed.',\n inputSchema: {\n content: z\n .record(z.string(), z.unknown())\n .describe('Flow.Setup JSON content (must have version: 1)'),\n },\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ content }) => {\n try {\n const response = (await apiRequest('/api/bundle', {\n method: 'POST',\n body: JSON.stringify({ flow: content }),\n responseFormat: 'raw',\n })) as Response;\n\n const js = await response.text();\n const statsHeader = response.headers.get('X-Bundle-Stats');\n const result: Record<string, unknown> = {\n success: true,\n bundle: js,\n size: js.length,\n };\n if (statsHeader) {\n try {\n result.stats = JSON.parse(statsHeader);\n } catch {}\n }\n\n return {\n content: [\n { type: 'text' as const, text: JSON.stringify(result, null, 2) },\n ],\n };\n } catch (error) {\n return {\n content: [\n {\n type: 'text' as const,\n text: JSON.stringify({\n error: error instanceof Error ? error.message : 'Unknown error',\n }),\n },\n ],\n isError: true,\n };\n }\n },\n );\n}\n"],"mappings":";;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;;;ACDrC,SAAS,eAAe;;;ACAxB,SAAS,SAAS;AAGlB,IAAM,YAAY,EAAE,OAAO,EAAE,SAAS,oBAAoB;AAC1D,IAAM,YAAY,EAAE,OAAO,EAAE,SAAS,uBAAuB;AAC7D,IAAM,SAAS,EAAE,OAAO,EAAE,SAAS,mBAAmB;AAG/C,IAAM,mBAAmB;AAAA,EAC9B,OAAO,EAAE,OAAO,EAAE,SAAS,eAAe;AAC5C;AAGO,IAAM,sBAAsB;AAAA,EACjC,OAAO,EAAE,QAAQ,EAAE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,EAAE;AAAA,UACjE;AAAA,QACF;AAAA,MACF,SAAS,OAAO;AACd,eAAO;AAAA,UACL,SAAS;AAAA,YACP;AAAA,cACE,MAAM;AAAA,cACN,MAAM,KAAK,UAAU;AAAA,gBACnB,OAAO,iBAAiB,QAAQ,MAAM,UAAU;AAAA,cAClD,CAAC;AAAA,YACH;AAAA,UACF;AAAA,UACA,SAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;ATlDA,IAAM,SAAS,IAAI,UAAU;AAAA,EAC3B,MAAM;AAAA,EACN,SAAS;AACX,CAAC;AAGD,mBAAmB,MAAM;AACzB,qBAAqB,MAAM;AAC3B,iBAAiB,MAAM;AACvB,qBAAqB,MAAM;AAG3B,kBAAkB,MAAM;AACxB,qBAAqB,MAAM;AAC3B,kBAAkB,MAAM;AACxB,yBAAyB,MAAM;AAE/B,eAAe,OAAO;AACpB,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAC9B,UAAQ,MAAM,sCAAsC;AACtD;AAEA,KAAK,EAAE,MAAM,CAAC,UAAU;AACtB,UAAQ,MAAM,+BAA+B,KAAK;AAClD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["server","schemas","server","schemas","schemas","server","schemas","schemas","server","schemas","server","z","server","projectId","z","apiResult","apiError","server","projectId","flowId","z","server"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@walkeros/mcp",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "MCP server for walkerOS - validate, bundle, and simulate analytics events locally, plus manage projects and flows via the walkerOS API",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"walkeros-mcp": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist/**",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsup --silent",
|
|
24
|
+
"dev": "jest --watchAll --colors",
|
|
25
|
+
"start": "node dist/index.js",
|
|
26
|
+
"test": "jest",
|
|
27
|
+
"lint": "tsc --noEmit && eslint \"**/*.ts*\"",
|
|
28
|
+
"clean": "rm -rf .turbo && rm -rf dist && rm -rf coverage",
|
|
29
|
+
"prepublishOnly": "npm run build",
|
|
30
|
+
"update": "npx npm-check-updates -u && npm update"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
34
|
+
"@walkeros/cli": "^1.3.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^20.0.0",
|
|
38
|
+
"@walkeros/config": "*"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"url": "git+https://github.com/elbwalker/walkerOS.git",
|
|
42
|
+
"directory": "packages/mcp"
|
|
43
|
+
},
|
|
44
|
+
"author": "elbwalker <hello@elbwalker.com>",
|
|
45
|
+
"homepage": "https://github.com/elbwalker/walkerOS#readme",
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/elbwalker/walkerOS/issues"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=18.0.0"
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"walkeros",
|
|
54
|
+
"mcp",
|
|
55
|
+
"model-context-protocol",
|
|
56
|
+
"analytics",
|
|
57
|
+
"event-tracking"
|
|
58
|
+
],
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
}
|
|
62
|
+
}
|