aiprox-workflows-mcp 1.0.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/LICENSE +21 -0
- package/README.md +158 -0
- package/dist/index.js +443 -0
- package/glama.json +4 -0
- package/package.json +56 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 LPX Digital Group LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# aiprox-workflows-mcp
|
|
2
|
+
|
|
3
|
+
<a href="https://glama.ai/mcp/servers/unixlamadev-spec/aiprox-workflows-mcp">
|
|
4
|
+
<img width="380" height="200" src="https://glama.ai/mcp/servers/unixlamadev-spec/aiprox-workflows-mcp/badge" alt="AIProx Workflows MCP Server" />
|
|
5
|
+
</a>
|
|
6
|
+
|
|
7
|
+
MCP server for [AIProx Workflows](https://aiprox.dev/workflows) — create and run multi-agent pipelines from Claude Desktop. Chain AI agents into scheduled workflows. Pay per execution in sats.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx aiprox-workflows-mcp
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## What AIProx Workflows Is
|
|
16
|
+
|
|
17
|
+
AIProx is an agent registry with a built-in workflow engine. You chain agents by capability into pipelines — each step passes its result to the next. Workflows can run on demand or on a schedule. Execution costs are deducted from your Lightning spend token in sats. No accounts, no monthly subscriptions.
|
|
18
|
+
|
|
19
|
+
**Available agent capabilities:** web-search, sentiment-analysis, scraping, data-analysis, translation, vision, code-execution, email, market-data, token-analysis
|
|
20
|
+
|
|
21
|
+
## Setup
|
|
22
|
+
|
|
23
|
+
### Claude Desktop
|
|
24
|
+
|
|
25
|
+
Add to your `claude_desktop_config.json`:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"mcpServers": {
|
|
30
|
+
"aiprox-workflows": {
|
|
31
|
+
"command": "npx",
|
|
32
|
+
"args": ["aiprox-workflows-mcp"],
|
|
33
|
+
"env": {
|
|
34
|
+
"AIPROX_SPEND_TOKEN": "lnpx_your_token_here"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Get a spend token at [lightningprox.com](https://lightningprox.com).
|
|
42
|
+
|
|
43
|
+
### Cursor
|
|
44
|
+
|
|
45
|
+
Add to Cursor MCP settings with the same JSON above.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Tools
|
|
50
|
+
|
|
51
|
+
### `create_workflow`
|
|
52
|
+
|
|
53
|
+
Create a new multi-agent pipeline.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
Create a workflow named "daily-intel" that:
|
|
57
|
+
1. Searches for the latest AI news
|
|
58
|
+
2. Analyzes sentiment
|
|
59
|
+
3. Emails me a daily summary
|
|
60
|
+
Schedule it @daily
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### `run_workflow`
|
|
64
|
+
|
|
65
|
+
Trigger a workflow by ID.
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Run workflow wf_abc123
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### `list_workflows`
|
|
72
|
+
|
|
73
|
+
List all your workflows and their status.
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
List my workflows
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### `get_run_history`
|
|
80
|
+
|
|
81
|
+
Get past execution results and sats spent.
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
Show run history for workflow wf_abc123
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### `delete_workflow`
|
|
88
|
+
|
|
89
|
+
Delete a workflow (also cancels scheduled runs).
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Delete workflow wf_abc123
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### `run_template`
|
|
96
|
+
|
|
97
|
+
Run a pre-built template by name. Creates the workflow and runs it immediately.
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
Run the news-digest template and email results to me@example.com
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Available templates:**
|
|
104
|
+
|
|
105
|
+
| Template | Agents | Cost |
|
|
106
|
+
|---|---|---|
|
|
107
|
+
| `news-digest` | search-bot → sentiment-bot → email-bot | ~150 sats |
|
|
108
|
+
| `token-scanner` | data-spider → isitarug → email-bot | ~120 sats |
|
|
109
|
+
| `competitive-intel` | search-bot → doc-miner → sentiment-bot → email-bot | ~200 sats |
|
|
110
|
+
| `multilingual-content` | data-spider → doc-miner → polyglot | ~180 sats |
|
|
111
|
+
| `site-audit` | vision-bot → code-auditor → doc-miner | ~220 sats |
|
|
112
|
+
| `polymarket-signals` | market-oracle → sentiment-bot → email-bot | ~160 sats |
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Example Conversation
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
You: Run the news-digest template and email results to alice@example.com
|
|
120
|
+
|
|
121
|
+
Claude: I'll run the Daily Bitcoin News Digest template now.
|
|
122
|
+
|
|
123
|
+
[calls run_template with template="news-digest", notify_email="alice@example.com"]
|
|
124
|
+
|
|
125
|
+
🚀 Template "news-digest" running
|
|
126
|
+
|
|
127
|
+
Template: Daily Bitcoin News Digest
|
|
128
|
+
Steps: web-search → sentiment-analysis → email
|
|
129
|
+
|
|
130
|
+
Run ID: run_xyz789
|
|
131
|
+
Status: running
|
|
132
|
+
Sats spent: 147 sats
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Environment Variables
|
|
138
|
+
|
|
139
|
+
| Variable | Required | Description |
|
|
140
|
+
|---|---|---|
|
|
141
|
+
| `AIPROX_SPEND_TOKEN` | ✅ | Lightning spend token (`lnpx_...`) |
|
|
142
|
+
| `AIPROX_URL` | ❌ | Override API URL (default: `https://aiprox.dev`) |
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Pricing
|
|
147
|
+
|
|
148
|
+
50–220 sats per workflow run depending on agents used and step count. No monthly fee.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Links
|
|
153
|
+
|
|
154
|
+
- Dashboard: [aiprox.dev/workflows](https://aiprox.dev/workflows)
|
|
155
|
+
- Templates: [aiprox.dev/templates](https://aiprox.dev/templates)
|
|
156
|
+
- Registry: [aiprox.dev/registry.html](https://aiprox.dev/registry.html)
|
|
157
|
+
- Spend tokens: [lightningprox.com](https://lightningprox.com)
|
|
158
|
+
- npm SDK: [aiprox-workflows](https://www.npmjs.com/package/aiprox-workflows)
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* AIProx Workflows MCP Server
|
|
5
|
+
* Create and run multi-agent workflows from Claude Desktop.
|
|
6
|
+
* Pay per execution in sats via Lightning spend token.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
10
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
11
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
12
|
+
const AIPROX_URL = process.env.AIPROX_URL || "https://aiprox.dev";
|
|
13
|
+
const SPEND_TOKEN = process.env.AIPROX_SPEND_TOKEN || "";
|
|
14
|
+
if (!SPEND_TOKEN) {
|
|
15
|
+
console.error("❌ AIPROX_SPEND_TOKEN environment variable is required");
|
|
16
|
+
console.error(" Set it to your Lightning spend token (lnpx_...)");
|
|
17
|
+
console.error(" Get a token at: https://lightningprox.com");
|
|
18
|
+
console.error(" Example: AIPROX_SPEND_TOKEN=lnpx_... npx aiprox-workflows-mcp");
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
// Pre-built templates — Claude can reference these by name
|
|
22
|
+
const TEMPLATES = {
|
|
23
|
+
"news-digest": {
|
|
24
|
+
name: "Daily Bitcoin News Digest",
|
|
25
|
+
steps: [
|
|
26
|
+
{ capability: "web-search", input: "Search for the latest Bitcoin news and developments today. Get the top 5-10 stories." },
|
|
27
|
+
{ capability: "sentiment-analysis", input: "$step1.result — Analyze sentiment and summarize key themes from these Bitcoin news stories." },
|
|
28
|
+
{ capability: "email", input: "$step2.result — Format as a daily Bitcoin news digest email and send." },
|
|
29
|
+
],
|
|
30
|
+
schedule: "@daily",
|
|
31
|
+
},
|
|
32
|
+
"token-scanner": {
|
|
33
|
+
name: "Token Safety Scanner",
|
|
34
|
+
steps: [
|
|
35
|
+
{ capability: "scraping", input: "Scrape token data and on-chain metrics for risk analysis." },
|
|
36
|
+
{ capability: "data-analysis", input: "$step1.result — Analyze for rug pull signals, liquidity risks, and red flags." },
|
|
37
|
+
{ capability: "email", input: "$step2.result — Send token safety report to email." },
|
|
38
|
+
],
|
|
39
|
+
schedule: "",
|
|
40
|
+
},
|
|
41
|
+
"competitive-intel": {
|
|
42
|
+
name: "Competitive Intelligence Brief",
|
|
43
|
+
steps: [
|
|
44
|
+
{ capability: "web-search", input: "Research the company: news, funding rounds, product launches, and market position." },
|
|
45
|
+
{ capability: "data-analysis", input: "$step1.result — Extract key facts, financials, and strategic moves." },
|
|
46
|
+
{ capability: "sentiment-analysis", input: "$step2.result — Analyze market sentiment and competitive positioning." },
|
|
47
|
+
{ capability: "email", input: "$step3.result — Format as a competitive intelligence brief and send." },
|
|
48
|
+
],
|
|
49
|
+
schedule: "@daily",
|
|
50
|
+
},
|
|
51
|
+
"multilingual-content": {
|
|
52
|
+
name: "Multilingual Content Pipeline",
|
|
53
|
+
steps: [
|
|
54
|
+
{ capability: "scraping", input: "Scrape and extract the main content from the target URL." },
|
|
55
|
+
{ capability: "data-analysis", input: "$step1.result — Summarize the key points and main message of this content." },
|
|
56
|
+
{ capability: "translation", input: "$step2.result — Translate this summary to the target language." },
|
|
57
|
+
],
|
|
58
|
+
schedule: "",
|
|
59
|
+
},
|
|
60
|
+
"site-audit": {
|
|
61
|
+
name: "Visual Site Audit",
|
|
62
|
+
steps: [
|
|
63
|
+
{ capability: "vision", input: "Analyze this webpage for design quality, visual hierarchy, and UX issues." },
|
|
64
|
+
{ capability: "code-execution", input: "$step1.result — Audit code structure, accessibility, and technical issues." },
|
|
65
|
+
{ capability: "data-analysis", input: "$step2.result — Compile a comprehensive site audit with actionable recommendations." },
|
|
66
|
+
],
|
|
67
|
+
schedule: "",
|
|
68
|
+
},
|
|
69
|
+
"polymarket-signals": {
|
|
70
|
+
name: "Polymarket Signal Digest",
|
|
71
|
+
steps: [
|
|
72
|
+
{ capability: "data-analysis", input: "Fetch and analyze the latest Polymarket prediction market signals, top markets by volume, and notable probability shifts." },
|
|
73
|
+
{ capability: "sentiment-analysis", input: "$step1.result — Identify key trends and trading signals from these prediction markets." },
|
|
74
|
+
{ capability: "email", input: "$step2.result — Format as a daily Polymarket signal digest and send." },
|
|
75
|
+
],
|
|
76
|
+
schedule: "@daily",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
// ============================================================================
|
|
80
|
+
// TOOL DEFINITIONS
|
|
81
|
+
// ============================================================================
|
|
82
|
+
const tools = [
|
|
83
|
+
{
|
|
84
|
+
name: "create_workflow",
|
|
85
|
+
description: "Create a new AIProx workflow — a multi-agent pipeline that chains AI agent steps. " +
|
|
86
|
+
"Each step specifies a capability and input. Use $step1.result, $step2.result etc. to chain outputs. " +
|
|
87
|
+
"Returns a workflow_id you can use to run or manage the workflow.",
|
|
88
|
+
inputSchema: {
|
|
89
|
+
type: "object",
|
|
90
|
+
properties: {
|
|
91
|
+
name: {
|
|
92
|
+
type: "string",
|
|
93
|
+
description: "Workflow name (e.g. 'daily-intel', 'token-scanner')",
|
|
94
|
+
},
|
|
95
|
+
steps: {
|
|
96
|
+
type: "array",
|
|
97
|
+
description: "Ordered list of agent steps",
|
|
98
|
+
items: {
|
|
99
|
+
type: "object",
|
|
100
|
+
properties: {
|
|
101
|
+
capability: {
|
|
102
|
+
type: "string",
|
|
103
|
+
description: "Agent capability: web-search | sentiment-analysis | scraping | data-analysis | translation | vision | code-execution | email | market-data | token-analysis",
|
|
104
|
+
},
|
|
105
|
+
input: {
|
|
106
|
+
type: "string",
|
|
107
|
+
description: "Task input. Use $step1.result, $step2.result etc. to chain from previous steps.",
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
required: ["capability", "input"],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
schedule: {
|
|
114
|
+
type: "string",
|
|
115
|
+
description: "Optional cron schedule: @hourly, @daily, @weekly, or cron expression like '0 9 * * *'",
|
|
116
|
+
},
|
|
117
|
+
notify_email: {
|
|
118
|
+
type: "string",
|
|
119
|
+
description: "Optional email address to notify after each run",
|
|
120
|
+
},
|
|
121
|
+
webhook_url: {
|
|
122
|
+
type: "string",
|
|
123
|
+
description: "Optional webhook URL to POST results to after each run",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
required: ["name", "steps"],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "run_workflow",
|
|
131
|
+
description: "Trigger an existing AIProx workflow by ID. Returns run status and receipt.",
|
|
132
|
+
inputSchema: {
|
|
133
|
+
type: "object",
|
|
134
|
+
properties: {
|
|
135
|
+
workflow_id: {
|
|
136
|
+
type: "string",
|
|
137
|
+
description: "The workflow ID to run (e.g. 'wf_abc123')",
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
required: ["workflow_id"],
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "list_workflows",
|
|
145
|
+
description: "List all workflows associated with your spend token.",
|
|
146
|
+
inputSchema: {
|
|
147
|
+
type: "object",
|
|
148
|
+
properties: {},
|
|
149
|
+
required: [],
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "get_run_history",
|
|
154
|
+
description: "Get the run history for a specific workflow, including past execution results and sats spent.",
|
|
155
|
+
inputSchema: {
|
|
156
|
+
type: "object",
|
|
157
|
+
properties: {
|
|
158
|
+
workflow_id: {
|
|
159
|
+
type: "string",
|
|
160
|
+
description: "The workflow ID to get run history for",
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
required: ["workflow_id"],
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "delete_workflow",
|
|
168
|
+
description: "Delete an AIProx workflow by ID. This also cancels any scheduled runs.",
|
|
169
|
+
inputSchema: {
|
|
170
|
+
type: "object",
|
|
171
|
+
properties: {
|
|
172
|
+
workflow_id: {
|
|
173
|
+
type: "string",
|
|
174
|
+
description: "The workflow ID to delete",
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
required: ["workflow_id"],
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "run_template",
|
|
182
|
+
description: "Run a pre-built workflow template by name. Creates the workflow and triggers it immediately. " +
|
|
183
|
+
"Available templates: news-digest, token-scanner, competitive-intel, multilingual-content, site-audit, polymarket-signals",
|
|
184
|
+
inputSchema: {
|
|
185
|
+
type: "object",
|
|
186
|
+
properties: {
|
|
187
|
+
template: {
|
|
188
|
+
type: "string",
|
|
189
|
+
description: "Template name: news-digest | token-scanner | competitive-intel | multilingual-content | site-audit | polymarket-signals",
|
|
190
|
+
},
|
|
191
|
+
notify_email: {
|
|
192
|
+
type: "string",
|
|
193
|
+
description: "Optional email address to receive results",
|
|
194
|
+
},
|
|
195
|
+
schedule: {
|
|
196
|
+
type: "string",
|
|
197
|
+
description: "Optional schedule override (e.g. '@daily'). Defaults to template's built-in schedule.",
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
required: ["template"],
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
];
|
|
204
|
+
// ============================================================================
|
|
205
|
+
// API HELPERS
|
|
206
|
+
// ============================================================================
|
|
207
|
+
async function apiPost(path, body) {
|
|
208
|
+
const res = await fetch(`${AIPROX_URL}${path}`, {
|
|
209
|
+
method: "POST",
|
|
210
|
+
headers: {
|
|
211
|
+
"Content-Type": "application/json",
|
|
212
|
+
"X-Spend-Token": SPEND_TOKEN,
|
|
213
|
+
},
|
|
214
|
+
body: JSON.stringify({ ...body, spend_token: SPEND_TOKEN }),
|
|
215
|
+
});
|
|
216
|
+
if (!res.ok) {
|
|
217
|
+
const text = await res.text();
|
|
218
|
+
let msg = text;
|
|
219
|
+
try {
|
|
220
|
+
msg = JSON.parse(text).error || text;
|
|
221
|
+
}
|
|
222
|
+
catch { }
|
|
223
|
+
if (res.status === 402)
|
|
224
|
+
throw new Error(`Insufficient balance. Top up at lightningprox.com`);
|
|
225
|
+
if (res.status === 401)
|
|
226
|
+
throw new Error(`Invalid spend token. Get one at lightningprox.com`);
|
|
227
|
+
throw new Error(`AIProx API error ${res.status}: ${msg}`);
|
|
228
|
+
}
|
|
229
|
+
return res.json();
|
|
230
|
+
}
|
|
231
|
+
async function apiGet(path) {
|
|
232
|
+
const res = await fetch(`${AIPROX_URL}${path}`, {
|
|
233
|
+
headers: { "X-Spend-Token": SPEND_TOKEN },
|
|
234
|
+
});
|
|
235
|
+
if (!res.ok) {
|
|
236
|
+
const text = await res.text();
|
|
237
|
+
let msg = text;
|
|
238
|
+
try {
|
|
239
|
+
msg = JSON.parse(text).error || text;
|
|
240
|
+
}
|
|
241
|
+
catch { }
|
|
242
|
+
throw new Error(`AIProx API error ${res.status}: ${msg}`);
|
|
243
|
+
}
|
|
244
|
+
return res.json();
|
|
245
|
+
}
|
|
246
|
+
async function apiDelete(path) {
|
|
247
|
+
const res = await fetch(`${AIPROX_URL}${path}`, {
|
|
248
|
+
method: "DELETE",
|
|
249
|
+
headers: { "X-Spend-Token": SPEND_TOKEN },
|
|
250
|
+
});
|
|
251
|
+
if (!res.ok) {
|
|
252
|
+
const text = await res.text();
|
|
253
|
+
let msg = text;
|
|
254
|
+
try {
|
|
255
|
+
msg = JSON.parse(text).error || text;
|
|
256
|
+
}
|
|
257
|
+
catch { }
|
|
258
|
+
throw new Error(`AIProx API error ${res.status}: ${msg}`);
|
|
259
|
+
}
|
|
260
|
+
return res.json();
|
|
261
|
+
}
|
|
262
|
+
function formatWorkflow(w) {
|
|
263
|
+
return [
|
|
264
|
+
`ID: ${w.workflow_id || w.id}`,
|
|
265
|
+
`Name: ${w.name}`,
|
|
266
|
+
`Steps: ${w.steps_count ?? "?"}`,
|
|
267
|
+
`Schedule: ${w.schedule || "manual"}`,
|
|
268
|
+
`Status: ${w.status || "?"}`,
|
|
269
|
+
w.last_run_at ? `Last run: ${w.last_run_at}` : null,
|
|
270
|
+
w.next_run_at ? `Next run: ${w.next_run_at}` : null,
|
|
271
|
+
].filter(Boolean).join("\n");
|
|
272
|
+
}
|
|
273
|
+
function formatRun(r) {
|
|
274
|
+
const agents = Array.isArray(r.agents_used) ? r.agents_used.join(", ") : (r.agents_used || "—");
|
|
275
|
+
return [
|
|
276
|
+
`Run ID: ${r.run_id || r.id}`,
|
|
277
|
+
`Status: ${r.status}`,
|
|
278
|
+
`Sats spent: ${r.sats_spent != null ? r.sats_spent + " sats" : "—"}`,
|
|
279
|
+
`Agents: ${agents}`,
|
|
280
|
+
r.result ? `\nResult preview:\n${String(r.result).slice(0, 400)}` : null,
|
|
281
|
+
].filter(Boolean).join("\n");
|
|
282
|
+
}
|
|
283
|
+
// ============================================================================
|
|
284
|
+
// MCP SERVER
|
|
285
|
+
// ============================================================================
|
|
286
|
+
const server = new index_js_1.Server({ name: "aiprox-workflows", version: "1.0.0" }, { capabilities: { tools: {} } });
|
|
287
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({ tools }));
|
|
288
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
289
|
+
const { name, arguments: args } = request.params;
|
|
290
|
+
try {
|
|
291
|
+
switch (name) {
|
|
292
|
+
case "create_workflow": {
|
|
293
|
+
const { name: wfName, steps, schedule, notify_email, webhook_url } = args;
|
|
294
|
+
const payload = {
|
|
295
|
+
name: wfName,
|
|
296
|
+
steps: steps.map((s, i) => ({ step: i + 1, ...s })),
|
|
297
|
+
};
|
|
298
|
+
if (schedule)
|
|
299
|
+
payload.schedule = schedule;
|
|
300
|
+
if (notify_email)
|
|
301
|
+
payload.notify_email = notify_email;
|
|
302
|
+
if (webhook_url)
|
|
303
|
+
payload.webhook_url = webhook_url;
|
|
304
|
+
const result = await apiPost("/api/workflows", payload);
|
|
305
|
+
const id = result.workflow_id || result.id;
|
|
306
|
+
return {
|
|
307
|
+
content: [{
|
|
308
|
+
type: "text",
|
|
309
|
+
text: [
|
|
310
|
+
`✅ Workflow created`,
|
|
311
|
+
``,
|
|
312
|
+
formatWorkflow(result),
|
|
313
|
+
``,
|
|
314
|
+
`Run it: use run_workflow with workflow_id="${id}"`,
|
|
315
|
+
`Dashboard: https://aiprox.dev/workflows`,
|
|
316
|
+
].join("\n"),
|
|
317
|
+
}],
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
case "run_workflow": {
|
|
321
|
+
const { workflow_id } = args;
|
|
322
|
+
const result = await apiPost(`/api/workflows/${workflow_id}/run`, {});
|
|
323
|
+
return {
|
|
324
|
+
content: [{
|
|
325
|
+
type: "text",
|
|
326
|
+
text: [
|
|
327
|
+
`⚡ Workflow triggered`,
|
|
328
|
+
``,
|
|
329
|
+
formatRun(result),
|
|
330
|
+
].join("\n"),
|
|
331
|
+
}],
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
case "list_workflows": {
|
|
335
|
+
const data = await apiGet("/api/workflows");
|
|
336
|
+
const list = data.workflows || data || [];
|
|
337
|
+
if (!list.length) {
|
|
338
|
+
return {
|
|
339
|
+
content: [{
|
|
340
|
+
type: "text",
|
|
341
|
+
text: "No workflows found. Create one with create_workflow.\n\nBrowse templates: https://aiprox.dev/templates",
|
|
342
|
+
}],
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
return {
|
|
346
|
+
content: [{
|
|
347
|
+
type: "text",
|
|
348
|
+
text: [
|
|
349
|
+
`📋 Your Workflows (${list.length})`,
|
|
350
|
+
``,
|
|
351
|
+
list.map(formatWorkflow).join("\n\n---\n\n"),
|
|
352
|
+
``,
|
|
353
|
+
`Dashboard: https://aiprox.dev/workflows`,
|
|
354
|
+
].join("\n"),
|
|
355
|
+
}],
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
case "get_run_history": {
|
|
359
|
+
const { workflow_id } = args;
|
|
360
|
+
const data = await apiGet(`/api/workflows/${workflow_id}/runs`);
|
|
361
|
+
const runs = data.runs || data || [];
|
|
362
|
+
if (!runs.length) {
|
|
363
|
+
return {
|
|
364
|
+
content: [{ type: "text", text: `No runs found for workflow ${workflow_id}.` }],
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
return {
|
|
368
|
+
content: [{
|
|
369
|
+
type: "text",
|
|
370
|
+
text: [
|
|
371
|
+
`📊 Run History for ${workflow_id} (${runs.length} runs)`,
|
|
372
|
+
``,
|
|
373
|
+
runs.slice(0, 5).map(formatRun).join("\n\n---\n\n"),
|
|
374
|
+
].join("\n"),
|
|
375
|
+
}],
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
case "delete_workflow": {
|
|
379
|
+
const { workflow_id } = args;
|
|
380
|
+
await apiDelete(`/api/workflows/${workflow_id}`);
|
|
381
|
+
return {
|
|
382
|
+
content: [{
|
|
383
|
+
type: "text",
|
|
384
|
+
text: `🗑️ Workflow ${workflow_id} deleted successfully.`,
|
|
385
|
+
}],
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
case "run_template": {
|
|
389
|
+
const { template, notify_email, schedule: scheduleOverride } = args;
|
|
390
|
+
const tpl = TEMPLATES[template];
|
|
391
|
+
if (!tpl) {
|
|
392
|
+
const available = Object.keys(TEMPLATES).join(", ");
|
|
393
|
+
throw new Error(`Unknown template "${template}". Available: ${available}`);
|
|
394
|
+
}
|
|
395
|
+
const payload = {
|
|
396
|
+
name: tpl.name,
|
|
397
|
+
steps: tpl.steps.map((s, i) => ({ step: i + 1, ...s })),
|
|
398
|
+
schedule: scheduleOverride || tpl.schedule || undefined,
|
|
399
|
+
};
|
|
400
|
+
if (notify_email)
|
|
401
|
+
payload.notify_email = notify_email;
|
|
402
|
+
const created = await apiPost("/api/workflows", payload);
|
|
403
|
+
const workflowId = created.workflow_id || created.id;
|
|
404
|
+
const runResult = await apiPost(`/api/workflows/${workflowId}/run`, {});
|
|
405
|
+
return {
|
|
406
|
+
content: [{
|
|
407
|
+
type: "text",
|
|
408
|
+
text: [
|
|
409
|
+
`🚀 Template "${template}" running`,
|
|
410
|
+
``,
|
|
411
|
+
`Template: ${tpl.name}`,
|
|
412
|
+
`Steps: ${tpl.steps.map(s => s.capability).join(" → ")}`,
|
|
413
|
+
``,
|
|
414
|
+
formatRun(runResult),
|
|
415
|
+
``,
|
|
416
|
+
`View all templates: https://aiprox.dev/templates`,
|
|
417
|
+
].join("\n"),
|
|
418
|
+
}],
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
default:
|
|
422
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
catch (error) {
|
|
426
|
+
return {
|
|
427
|
+
content: [{ type: "text", text: `❌ Error: ${error.message}` }],
|
|
428
|
+
isError: true,
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
// ============================================================================
|
|
433
|
+
// START
|
|
434
|
+
// ============================================================================
|
|
435
|
+
async function main() {
|
|
436
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
437
|
+
await server.connect(transport);
|
|
438
|
+
console.error(`✅ AIProx Workflows MCP Server running | Token: ${SPEND_TOKEN.slice(0, 8)}...`);
|
|
439
|
+
}
|
|
440
|
+
main().catch((err) => {
|
|
441
|
+
console.error("Fatal error:", err);
|
|
442
|
+
process.exit(1);
|
|
443
|
+
});
|
package/glama.json
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "aiprox-workflows-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for AIProx Workflows — create and run multi-agent pipelines from Claude Desktop. Pay per execution in sats.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"aiprox-workflows-mcp": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"dev": "ts-node src/index.ts",
|
|
12
|
+
"start": "node dist/index.js",
|
|
13
|
+
"prepare": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"mcp",
|
|
17
|
+
"aiprox",
|
|
18
|
+
"workflows",
|
|
19
|
+
"agents",
|
|
20
|
+
"ai",
|
|
21
|
+
"automation",
|
|
22
|
+
"bitcoin",
|
|
23
|
+
"lightning",
|
|
24
|
+
"sats",
|
|
25
|
+
"multi-agent",
|
|
26
|
+
"orchestration",
|
|
27
|
+
"model-context-protocol"
|
|
28
|
+
],
|
|
29
|
+
"author": "LPX Digital Group LLC",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/unixlamadev-spec/aiprox-workflows-mcp"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://aiprox.dev/workflows",
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/unixlamadev-spec/aiprox-workflows-mcp/issues"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^20.0.0",
|
|
44
|
+
"typescript": "^5.0.0",
|
|
45
|
+
"ts-node": "^10.9.0"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=18.0.0"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"dist/",
|
|
52
|
+
"README.md",
|
|
53
|
+
"LICENSE",
|
|
54
|
+
"glama.json"
|
|
55
|
+
]
|
|
56
|
+
}
|