@cyanheads/workflows-mcp-server 0.1.4 → 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/AGENTS.md +381 -0
- package/CLAUDE.md +14 -8
- package/Dockerfile +20 -9
- package/LICENSE +1 -1
- package/README.md +20 -7
- package/changelog/0.2.x/0.2.0.md +20 -0
- package/changelog/0.3.x/0.3.0.md +40 -0
- package/changelog/template.md +60 -19
- package/dist/mcp-server/tools/definitions/index.d.ts +80 -49
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/index.js +9 -1
- package/dist/mcp-server/tools/definitions/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/workflow-create-temp.tool.js +5 -5
- package/dist/mcp-server/tools/definitions/workflow-create-temp.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/workflow-create.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/workflow-create.tool.js +7 -6
- package/dist/mcp-server/tools/definitions/workflow-create.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/workflow-delete.tool.d.ts +35 -0
- package/dist/mcp-server/tools/definitions/workflow-delete.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/workflow-delete.tool.js +112 -0
- package/dist/mcp-server/tools/definitions/workflow-delete.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/workflow-get.tool.d.ts +1 -1
- package/dist/mcp-server/tools/definitions/workflow-get.tool.js +6 -6
- package/dist/mcp-server/tools/definitions/workflow-get.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/workflow-list.tool.d.ts +4 -1
- package/dist/mcp-server/tools/definitions/workflow-list.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/workflow-list.tool.js +38 -10
- package/dist/mcp-server/tools/definitions/workflow-list.tool.js.map +1 -1
- package/dist/services/workflow-index/workflow-index-service.d.ts +16 -0
- package/dist/services/workflow-index/workflow-index-service.d.ts.map +1 -1
- package/dist/services/workflow-index/workflow-index-service.js +28 -0
- package/dist/services/workflow-index/workflow-index-service.js.map +1 -1
- package/package.json +19 -16
- package/server.json +3 -3
package/AGENTS.md
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
# Agent Protocol
|
|
2
|
+
|
|
3
|
+
**Server:** @cyanheads/workflows-mcp-server
|
|
4
|
+
**Version:** 0.3.0
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.12.3`
|
|
6
|
+
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
|
|
8
|
+
**Zod:** ^4.4.3
|
|
9
|
+
|
|
10
|
+
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## What's Next?
|
|
15
|
+
|
|
16
|
+
When the user asks what's next or needs direction, suggest options based on the current project state. Common next steps:
|
|
17
|
+
|
|
18
|
+
1. **Re-run the `setup` skill** — ensures CLAUDE.md, skills, structure, and metadata are populated and up to date with the current codebase
|
|
19
|
+
2. **Run the `design-mcp-server` skill** — if the tool/resource surface hasn't been mapped yet, work through domain design
|
|
20
|
+
3. **Add tools/resources/prompts** — scaffold new definitions using the `add-tool`, `add-app-tool`, `add-resource`, `add-prompt` skills
|
|
21
|
+
4. **Add services** — scaffold domain service integrations using the `add-service` skill
|
|
22
|
+
5. **Add tests** — scaffold tests for existing definitions using the `add-test` skill
|
|
23
|
+
6. **Field-test definitions** — exercise tools/resources/prompts with real inputs using the `field-test` skill, get a report of issues and pain points
|
|
24
|
+
7. **Run `devcheck`** — lint, format, typecheck, and security audit
|
|
25
|
+
8. **Run the `security-pass` skill** — audit handlers for MCP-specific security gaps: output injection, scope blast radius, input sinks, tenant isolation
|
|
26
|
+
9. **Run the `polish-docs-meta` skill** — finalize README, CHANGELOG, metadata, and agent protocol for shipping
|
|
27
|
+
10. **Run the `maintenance` skill** — investigate changelogs, adopt upstream changes, and sync skills after `bun update --latest`
|
|
28
|
+
|
|
29
|
+
Tailor suggestions to what's actually missing or stale — don't recite the full list every time.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Core Rules
|
|
34
|
+
|
|
35
|
+
- **Logic throws, framework catches.** Tool/resource handlers are pure — throw on failure, no `try/catch`. Plain `Error` is fine; the framework catches, classifies, and formats. Use error factories (`notFound()`, `validationError()`, etc.) when the error code matters.
|
|
36
|
+
- **Use `ctx.log`** for request-scoped logging. No `console` calls.
|
|
37
|
+
- **Use `ctx.state`** for tenant-scoped storage. Never access persistence directly.
|
|
38
|
+
- **Need caller input?** Return `ctx.requestInput(...)`; the handler is re-entered with answers in `ctx.inputs`. Never await input mid-handler.
|
|
39
|
+
- **Secrets in env vars only** — never hardcoded.
|
|
40
|
+
- **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed and close it. Do both — a comment without a close leaves stale issues open; a close without a comment leaves no record of what shipped. The comment is for future readers — state the concrete changes, not the conversation that produced them.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Patterns
|
|
45
|
+
|
|
46
|
+
### Tool
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
50
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
51
|
+
import { getWorkflowIndexService } from '@/services/workflow-index/workflow-index-service.js';
|
|
52
|
+
|
|
53
|
+
export const workflowList = tool('workflow_list', {
|
|
54
|
+
description: 'List all permanent workflows in the index. Supports optional filtering by category and tags (AND match).',
|
|
55
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
|
|
56
|
+
input: z.object({
|
|
57
|
+
category: z.string().optional().describe('Filter by category (case-insensitive substring).'),
|
|
58
|
+
tags: z.array(z.string()).optional().describe('Filter to workflows that have ALL of these tags.'),
|
|
59
|
+
includeTools: z.boolean().optional().describe('When true, include unique server/tool pairs per workflow.'),
|
|
60
|
+
}),
|
|
61
|
+
output: z.object({
|
|
62
|
+
workflows: z.array(z.object({ name: z.string().describe('Workflow name.'), /* ... */ })).describe('Matching workflows.'),
|
|
63
|
+
totalCount: z.number().describe('Total number of matching workflows.'),
|
|
64
|
+
}),
|
|
65
|
+
errors: [
|
|
66
|
+
{ reason: 'index_unavailable', code: JsonRpcErrorCode.ServiceUnavailable,
|
|
67
|
+
when: 'The workflow index has not finished building yet.',
|
|
68
|
+
recovery: 'Retry after the server has finished initializing its workflow index.' },
|
|
69
|
+
],
|
|
70
|
+
handler(input, ctx) {
|
|
71
|
+
const svc = getWorkflowIndexService();
|
|
72
|
+
if (!svc.ready) throw ctx.fail('index_unavailable', 'Index not ready', ctx.recoveryFor('index_unavailable'));
|
|
73
|
+
// ... filter and return results
|
|
74
|
+
return { workflows: [], totalCount: 0 };
|
|
75
|
+
},
|
|
76
|
+
format: (result) => [{ type: 'text', text: `**Total:** ${result.totalCount}` }],
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Server config
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
// src/config/server-config.ts — lazy-parsed, separate from framework config
|
|
84
|
+
import { z } from '@cyanheads/mcp-ts-core';
|
|
85
|
+
import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
|
|
86
|
+
|
|
87
|
+
const ServerConfigSchema = z.object({
|
|
88
|
+
workflowsDir: z
|
|
89
|
+
.string()
|
|
90
|
+
.default('./workflows-yaml')
|
|
91
|
+
.describe('Absolute or relative path to the workflows root directory'),
|
|
92
|
+
globalInstructionsPath: z
|
|
93
|
+
.string()
|
|
94
|
+
.default('')
|
|
95
|
+
.describe('Path to the global instructions markdown file. Empty string means derive from WORKFLOWS_DIR.'),
|
|
96
|
+
watcherDebounceMs: z.coerce
|
|
97
|
+
.number()
|
|
98
|
+
.default(500)
|
|
99
|
+
.describe('Milliseconds to debounce filesystem change events before rebuilding the index'),
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
let _config: z.infer<typeof ServerConfigSchema> | undefined;
|
|
103
|
+
export function getServerConfig() {
|
|
104
|
+
_config ??= parseEnvConfig(ServerConfigSchema, {
|
|
105
|
+
workflowsDir: 'WORKFLOWS_DIR',
|
|
106
|
+
globalInstructionsPath: 'GLOBAL_INSTRUCTIONS_PATH',
|
|
107
|
+
watcherDebounceMs: 'WATCHER_DEBOUNCE_MS',
|
|
108
|
+
});
|
|
109
|
+
return _config;
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
`parseEnvConfig` maps Zod schema paths → env var names so errors name the variable (`WORKFLOWS_DIR`) not the path (`workflowsDir`). Throws `ConfigurationError`, which the framework prints as a clean startup banner.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Context
|
|
118
|
+
|
|
119
|
+
Handlers receive a unified `ctx` object. Key properties:
|
|
120
|
+
|
|
121
|
+
| Property | Description |
|
|
122
|
+
|:---------|:------------|
|
|
123
|
+
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
|
|
124
|
+
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. |
|
|
125
|
+
| `ctx.enrich` | Success-path agent context that reaches both `structuredContent` and `content[]` when the definition declares an `enrichment` block. |
|
|
126
|
+
| `ctx.signal` | `AbortSignal` for cancellation. |
|
|
127
|
+
| `ctx.requestId` | Unique request ID. |
|
|
128
|
+
| `ctx.tenantId` | Tenant ID from JWT or `'default'` for stdio. |
|
|
129
|
+
| `ctx.fail` | Typed error factory for declared error contracts — `ctx.fail('reason', msg, ctx.recoveryFor('reason'))`. |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Errors
|
|
134
|
+
|
|
135
|
+
Handlers throw — the framework catches, classifies, and formats.
|
|
136
|
+
|
|
137
|
+
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) and is the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override it explicitly when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
errors: [
|
|
141
|
+
{ reason: 'no_match', code: JsonRpcErrorCode.NotFound,
|
|
142
|
+
when: 'No item matched the query',
|
|
143
|
+
recovery: 'Broaden the query or check the spelling and try again.' },
|
|
144
|
+
],
|
|
145
|
+
async handler(input, ctx) {
|
|
146
|
+
const item = await db.find(input.id);
|
|
147
|
+
if (!item) throw ctx.fail('no_match', `No item ${input.id}`);
|
|
148
|
+
return item;
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Declare contracts inline on each tool.** The contract is part of the tool's public surface — one file should give the full picture. Don't extract a shared `errors[]` constant; per-tool repetition is the intended cost of locality.
|
|
153
|
+
|
|
154
|
+
**Fallback (no contract entry fits):** throw via factories or plain `Error`.
|
|
155
|
+
|
|
156
|
+
```ts
|
|
157
|
+
// Error factories — explicit code
|
|
158
|
+
import { notFound, serviceUnavailable } from '@cyanheads/mcp-ts-core/errors';
|
|
159
|
+
throw notFound('Item not found', { itemId });
|
|
160
|
+
throw serviceUnavailable('API unavailable', { url }, { cause: err });
|
|
161
|
+
|
|
162
|
+
// Plain Error — framework auto-classifies from message patterns
|
|
163
|
+
throw new Error('Item not found'); // → NotFound
|
|
164
|
+
throw new Error('Invalid query format'); // → ValidationError
|
|
165
|
+
|
|
166
|
+
// McpError — when no factory exists for the code
|
|
167
|
+
import { McpError, JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
168
|
+
throw new McpError(JsonRpcErrorCode.DatabaseError, 'Connection failed', { pool: 'primary' });
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
See framework CLAUDE.md and the `api-errors` skill for the full auto-classification table, all available factories, and the contract reference.
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Structure
|
|
176
|
+
|
|
177
|
+
```text
|
|
178
|
+
src/
|
|
179
|
+
index.ts # createApp() entry point — registers tools, inits WorkflowIndexService
|
|
180
|
+
config/
|
|
181
|
+
server-config.ts # Server-specific env vars (WORKFLOWS_DIR, GLOBAL_INSTRUCTIONS_PATH, WATCHER_DEBOUNCE_MS)
|
|
182
|
+
services/
|
|
183
|
+
workflow-index/
|
|
184
|
+
workflow-index-service.ts # WorkflowIndexService — index build, watcher, semver lookup, write helpers
|
|
185
|
+
types.ts # ParsedWorkflow, WorkflowEntry, WorkflowIndex types
|
|
186
|
+
mcp-server/
|
|
187
|
+
tools/definitions/
|
|
188
|
+
workflow-list.tool.ts # workflow_list — list permanent workflows with filters
|
|
189
|
+
workflow-get.tool.ts # workflow_get — retrieve full workflow + global instructions
|
|
190
|
+
workflow-create.tool.ts # workflow_create — write permanent workflow YAML
|
|
191
|
+
workflow-create-temp.tool.ts # workflow_create_temp — write temporary workflow
|
|
192
|
+
index.ts # Barrel export
|
|
193
|
+
workflows-yaml/ # Workflow library root (configurable via WORKFLOWS_DIR)
|
|
194
|
+
categories/ # Permanent workflows organized by category
|
|
195
|
+
temp/ # Temporary workflows (gitignored)
|
|
196
|
+
global_instructions.md # Global instructions injected into every workflow_get response
|
|
197
|
+
_index.json # Auto-generated snapshot (gitignored)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Naming
|
|
203
|
+
|
|
204
|
+
| What | Convention | Example |
|
|
205
|
+
|:-----|:-----------|:--------|
|
|
206
|
+
| Files | kebab-case with suffix | `search-docs.tool.ts` |
|
|
207
|
+
| Tool/resource/prompt names | snake_case | `search_docs` |
|
|
208
|
+
| Directories | kebab-case | `src/services/doc-search/` |
|
|
209
|
+
| Descriptions | Single string or template literal, no `+` concatenation | `'Search items by query and filter.'` |
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Skills
|
|
214
|
+
|
|
215
|
+
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry.
|
|
216
|
+
|
|
217
|
+
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
|
|
218
|
+
|
|
219
|
+
Available skills:
|
|
220
|
+
|
|
221
|
+
| Skill | Purpose |
|
|
222
|
+
|:------|:--------|
|
|
223
|
+
| `setup` | Post-init project orientation |
|
|
224
|
+
| `design-mcp-server` | Design tool surface, resources, and services for a new server |
|
|
225
|
+
| `add-tool` | Scaffold a new tool definition |
|
|
226
|
+
| `add-app-tool` | Scaffold an MCP App tool + paired UI resource |
|
|
227
|
+
| `add-resource` | Scaffold a new resource definition |
|
|
228
|
+
| `add-prompt` | Scaffold a new prompt definition |
|
|
229
|
+
| `add-service` | Scaffold a new service integration |
|
|
230
|
+
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
231
|
+
| `add-export` | Add or evolve a public framework export without leaking internal module paths |
|
|
232
|
+
| `add-provider` | Add a provider integration with config, lifecycle, errors, and tests |
|
|
233
|
+
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
234
|
+
| `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
|
|
235
|
+
| `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
|
|
236
|
+
| `code-simplifier` | Post-session cleanup against `git diff` — modernize syntax, consolidate duplication, align with the codebase |
|
|
237
|
+
| `devcheck` | Lint, format, typecheck, audit |
|
|
238
|
+
| `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
|
|
239
|
+
| `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
|
|
240
|
+
| `release-and-publish` | Push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
|
|
241
|
+
| `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
|
|
242
|
+
| `orchestrations` | Chain task skills into a gated multi-phase pipeline when sub-agents are available |
|
|
243
|
+
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
244
|
+
| `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
|
|
245
|
+
| `api-auth` | Auth modes, scopes, JWT/OAuth |
|
|
246
|
+
| `api-canvas` | DataCanvas: register tabular data, run SQL, export, plus the `spillover()` helper for big result sets — Tier 3 opt-in |
|
|
247
|
+
| `api-config` | AppConfig, parseConfig, env vars |
|
|
248
|
+
| `api-context` | Context interface, logger, state, and multi-round-trip input |
|
|
249
|
+
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
250
|
+
| `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
|
|
251
|
+
| `api-mirror` | MirrorService for a persistent, self-refreshing local mirror of a bulk upstream dataset |
|
|
252
|
+
| `api-services` | LLM, Speech, Graph services |
|
|
253
|
+
| `api-testing` | createMockContext, fixtures, fetch mocks, and definition contract tests |
|
|
254
|
+
| `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
|
|
255
|
+
| `api-telemetry` | OTel catalog: spans, metrics, completion logs, env config, cardinality rules |
|
|
256
|
+
| `api-workers` | Cloudflare Workers runtime |
|
|
257
|
+
|
|
258
|
+
When you complete a skill's checklist, check the boxes and add a completion timestamp at the end (e.g., `Completed: 2026-03-11`).
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Commands
|
|
263
|
+
|
|
264
|
+
| Command | Purpose |
|
|
265
|
+
|:--------|:--------|
|
|
266
|
+
| `bun run build` | Compile TypeScript |
|
|
267
|
+
| `bun run rebuild` | Clean + build |
|
|
268
|
+
| `bun run clean` | Remove build artifacts |
|
|
269
|
+
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
270
|
+
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, re-audit. Use when `devcheck` flags a transitive advisory — stale lockfile can mask already-patched deps. If advisory survives, it's real. |
|
|
271
|
+
| `bun run tree` | Generate directory structure doc |
|
|
272
|
+
| `bun run format` | Auto-fix formatting |
|
|
273
|
+
| `bun run test` | Run tests |
|
|
274
|
+
| `bun run start:stdio` | Production mode (stdio) |
|
|
275
|
+
| `bun run start:http` | Production mode (HTTP) |
|
|
276
|
+
| `bun run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
|
|
277
|
+
| `bun run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
|
|
278
|
+
| `bun run bundle` | Build and pack as `.mcpb` for one-click Claude Desktop install |
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Bundling
|
|
283
|
+
|
|
284
|
+
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
|
|
285
|
+
|
|
286
|
+
**Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match.
|
|
287
|
+
|
|
288
|
+
**README install badges.** Drop these into the project README to give users one-click install paths. Fill in `<OWNER>` / `<REPO>` / `<PACKAGE_NAME>` and encode the per-server config. Cursor + VS Code badges assume the server is published to npm; Claude Desktop downloads the `.mcpb` directly so npm publishing isn't required.
|
|
289
|
+
|
|
290
|
+
| Client | Mechanism |
|
|
291
|
+
|:-------|:----------|
|
|
292
|
+
| Claude Desktop | Browser downloads the `.mcpb` from the latest GitHub Release; OS file handler routes it to Claude Desktop, which opens the install dialog. No deep-link URL scheme yet — this is the canonical path. |
|
|
293
|
+
| Cursor | Official `https://cursor.com/en/install-mcp` endpoint with base64 JSON config. |
|
|
294
|
+
| VS Code / Insiders | Official `vscode:mcp/install?...` deep link, wrapped in `https://vscode.dev/redirect?url=` so GitHub-rendered markdown doesn't strip the non-HTTP scheme. |
|
|
295
|
+
| Claude Code / Codex | CLI only (`claude mcp add` / `codex mcp add`); no URL scheme. |
|
|
296
|
+
|
|
297
|
+
```markdown
|
|
298
|
+
[](https://github.com/<OWNER>/<REPO>/releases/latest/download/<PACKAGE_NAME>.mcpb)
|
|
299
|
+
[](https://cursor.com/en/install-mcp?name=<PACKAGE_NAME>&config=<BASE64_CONFIG>)
|
|
300
|
+
[](https://vscode.dev/redirect?url=vscode:mcp/install?<URLENCODED_JSON>)
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Both install links route through HTTPS endpoints (`cursor.com/en/install-mcp` and `vscode.dev/redirect`) — GitHub-rendered markdown strips non-HTTP URL schemes from anchors, so a raw `cursor://` or `vscode:` link won't click through from github.com.
|
|
304
|
+
|
|
305
|
+
Generate the encoded configs (replace `<PACKAGE_NAME>` and add env vars for any required API keys):
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# Cursor: base64-encoded JSON. Split command/args, add env when keys are needed.
|
|
309
|
+
echo -n '{"command":"npx","args":["-y","<PACKAGE_NAME>"],"env":{"API_KEY":"your-api-key"}}' | base64
|
|
310
|
+
# Without env (no required keys):
|
|
311
|
+
echo -n '{"command":"npx","args":["-y","<PACKAGE_NAME>"]}' | base64
|
|
312
|
+
|
|
313
|
+
# VS Code: URL-encoded JSON. Same shape plus a `name` field.
|
|
314
|
+
node -p 'encodeURIComponent(JSON.stringify({name:"<SHORT_NAME>",command:"npx",args:["-y","<PACKAGE_NAME>"],env:{API_KEY:"your-api-key"}}))'
|
|
315
|
+
# Without env:
|
|
316
|
+
node -p 'encodeURIComponent(JSON.stringify({name:"<SHORT_NAME>",command:"npx",args:["-y","<PACKAGE_NAME>"]}))'
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Both clients use the same `{command, args, env}` shape (matching `mcp.json` schema). VS Code adds a top-level `name` field. Omit `env` entirely when no API keys are needed — don't include empty objects or framework-only vars like `MCP_TRANSPORT_TYPE`.
|
|
320
|
+
|
|
321
|
+
The Claude Desktop badge requires the bundle to ship with a stable filename — `bun run bundle` outputs `dist/<PACKAGE_NAME>.mcpb`, and `release-and-publish` attaches that file to the GitHub Release. `releases/latest/download/<PACKAGE_NAME>.mcpb` then redirects to the most recent release.
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Changelog
|
|
326
|
+
|
|
327
|
+
Directory-based, grouped by minor series via the `.x` semver-wildcard convention. Source of truth: `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.1.x/0.1.0.md`) — one file per release, shipped in the npm package. At release, author the per-version file with a concrete version and date, then run `bun run changelog:build` to regenerate the rollup. `changelog/template.md` is a **pristine format reference** — never edited or moved; read it for the frontmatter + section layout when scaffolding. `CHANGELOG.md` is a **navigation index** (header + link + summary per version), regenerated by `bun run changelog:build` — devcheck hard-fails on drift; never hand-edit it.
|
|
328
|
+
|
|
329
|
+
Each per-version file opens with YAML frontmatter:
|
|
330
|
+
|
|
331
|
+
```markdown
|
|
332
|
+
---
|
|
333
|
+
summary: "One-line headline, ≤350 chars" # required — powers the rollup index
|
|
334
|
+
breaking: false # optional — true flags breaking changes
|
|
335
|
+
security: false # optional — true flags security fixes
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
# 0.1.0 — YYYY-MM-DD
|
|
339
|
+
...
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section. When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
|
|
343
|
+
|
|
344
|
+
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
|
|
345
|
+
|
|
346
|
+
**Section order** (Keep a Changelog): Added, Changed, Deprecated, Removed, Fixed, Security. Include only sections with entries — don't ship empty headers.
|
|
347
|
+
|
|
348
|
+
**Tag annotations** render as GitHub Release bodies via `--notes-from-tag`. They must be structured markdown — never a flat comma-separated string. Subject omits the version number (GitHub prepends it). See `changelog/template.md` for the full format reference.
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## Imports
|
|
353
|
+
|
|
354
|
+
```ts
|
|
355
|
+
// Framework — z is re-exported, no separate zod import needed
|
|
356
|
+
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
357
|
+
import { McpError, JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
358
|
+
|
|
359
|
+
// Server's own code — via path alias
|
|
360
|
+
import { getMyService } from '@/services/my-domain/my-service.js';
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
## Checklist
|
|
366
|
+
|
|
367
|
+
- [ ] Zod schemas: all fields have `.describe()`, only JSON-Schema-serializable types (no `z.custom()`, `z.date()`, `z.transform()`, `z.bigint()`, `z.symbol()`, `z.void()`, `z.map()`, `z.set()`, `z.function()`, `z.nan()`)
|
|
368
|
+
- [ ] Optional nested objects: handler guards for empty inner values from form-based clients (`if (input.obj?.field && ...)`, not just `if (input.obj)`). When regex/length constraints matter, use `z.union([z.literal(''), z.string().regex(...).describe(...)])` — literal variants are exempt from `describe-on-fields`.
|
|
369
|
+
- [ ] JSDoc `@fileoverview` + `@module` on every file
|
|
370
|
+
- [ ] `ctx.log` for logging, `ctx.state` for storage
|
|
371
|
+
- [ ] Handlers throw on failure — error factories or plain `Error`, no try/catch
|
|
372
|
+
- [ ] `format()` renders all data the LLM needs — different clients forward different surfaces (Claude Code → `structuredContent`, Claude Desktop → `content[]`); both must carry the same data
|
|
373
|
+
- [ ] If wrapping external API: raw/domain/output schemas reviewed against real upstream sparsity/nullability before finalizing required vs optional fields
|
|
374
|
+
- [ ] If wrapping external API: normalization and `format()` preserve uncertainty; do not fabricate facts from missing upstream data
|
|
375
|
+
- [ ] If wrapping external API: tests include at least one sparse payload case with omitted upstream fields
|
|
376
|
+
- [ ] Registered in `createApp()` arrays (directly or via barrel exports)
|
|
377
|
+
- [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
|
|
378
|
+
- [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = package name; `interface.shortDescription` from `package.json` description
|
|
379
|
+
- [ ] `.codex-plugin/mcp.json` updated — server name key matches `package.json` name; env vars added for any required API keys
|
|
380
|
+
- [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; inline `mcpServers` entry with server name key, env vars for any required API keys
|
|
381
|
+
- [ ] `bun run devcheck` passes
|
package/CLAUDE.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** @cyanheads/workflows-mcp-server
|
|
4
|
-
**Version:** 0.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.
|
|
4
|
+
**Version:** 0.3.0
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.12.3`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
|
|
8
8
|
**Zod:** ^4.4.3
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
@@ -35,7 +35,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
35
35
|
- **Logic throws, framework catches.** Tool/resource handlers are pure — throw on failure, no `try/catch`. Plain `Error` is fine; the framework catches, classifies, and formats. Use error factories (`notFound()`, `validationError()`, etc.) when the error code matters.
|
|
36
36
|
- **Use `ctx.log`** for request-scoped logging. No `console` calls.
|
|
37
37
|
- **Use `ctx.state`** for tenant-scoped storage. Never access persistence directly.
|
|
38
|
-
- **
|
|
38
|
+
- **Need caller input?** Return `ctx.requestInput(...)`; the handler is re-entered with answers in `ctx.inputs`. Never await input mid-handler.
|
|
39
39
|
- **Secrets in env vars only** — never hardcoded.
|
|
40
40
|
- **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed and close it. Do both — a comment without a close leaves stale issues open; a close without a comment leaves no record of what shipped. The comment is for future readers — state the concrete changes, not the conversation that produced them.
|
|
41
41
|
|
|
@@ -121,6 +121,8 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
121
121
|
| Property | Description |
|
|
122
122
|
|:---------|:------------|
|
|
123
123
|
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
|
|
124
|
+
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. |
|
|
125
|
+
| `ctx.enrich` | Success-path agent context that reaches both `structuredContent` and `content[]` when the definition declares an `enrichment` block. |
|
|
124
126
|
| `ctx.signal` | `AbortSignal` for cancellation. |
|
|
125
127
|
| `ctx.requestId` | Unique request ID. |
|
|
126
128
|
| `ctx.tenantId` | Tenant ID from JWT or `'default'` for stdio. |
|
|
@@ -132,7 +134,7 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
132
134
|
|
|
133
135
|
Handlers throw — the framework catches, classifies, and formats.
|
|
134
136
|
|
|
135
|
-
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required
|
|
137
|
+
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) and is the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override it explicitly when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
|
|
136
138
|
|
|
137
139
|
```ts
|
|
138
140
|
errors: [
|
|
@@ -210,7 +212,7 @@ workflows-yaml/ # Workflow library root (configurable vi
|
|
|
210
212
|
|
|
211
213
|
## Skills
|
|
212
214
|
|
|
213
|
-
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool.
|
|
215
|
+
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry.
|
|
214
216
|
|
|
215
217
|
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
|
|
216
218
|
|
|
@@ -226,6 +228,8 @@ Available skills:
|
|
|
226
228
|
| `add-prompt` | Scaffold a new prompt definition |
|
|
227
229
|
| `add-service` | Scaffold a new service integration |
|
|
228
230
|
| `add-test` | Scaffold test file for a tool, resource, or service |
|
|
231
|
+
| `add-export` | Add or evolve a public framework export without leaking internal module paths |
|
|
232
|
+
| `add-provider` | Add a provider integration with config, lifecycle, errors, and tests |
|
|
229
233
|
| `field-test` | Exercise tools/resources/prompts with real inputs, verify behavior, report issues |
|
|
230
234
|
| `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
|
|
231
235
|
| `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
|
|
@@ -235,16 +239,18 @@ Available skills:
|
|
|
235
239
|
| `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
|
|
236
240
|
| `release-and-publish` | Push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
|
|
237
241
|
| `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
|
|
242
|
+
| `orchestrations` | Chain task skills into a gated multi-phase pipeline when sub-agents are available |
|
|
238
243
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
239
244
|
| `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
|
|
240
245
|
| `api-auth` | Auth modes, scopes, JWT/OAuth |
|
|
241
246
|
| `api-canvas` | DataCanvas: register tabular data, run SQL, export, plus the `spillover()` helper for big result sets — Tier 3 opt-in |
|
|
242
247
|
| `api-config` | AppConfig, parseConfig, env vars |
|
|
243
|
-
| `api-context` | Context interface, logger, state,
|
|
248
|
+
| `api-context` | Context interface, logger, state, and multi-round-trip input |
|
|
244
249
|
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
245
250
|
| `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
|
|
251
|
+
| `api-mirror` | MirrorService for a persistent, self-refreshing local mirror of a bulk upstream dataset |
|
|
246
252
|
| `api-services` | LLM, Speech, Graph services |
|
|
247
|
-
| `api-testing` | createMockContext,
|
|
253
|
+
| `api-testing` | createMockContext, fixtures, fetch mocks, and definition contract tests |
|
|
248
254
|
| `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
|
|
249
255
|
| `api-telemetry` | OTel catalog: spans, metrics, completion logs, env config, cardinality rules |
|
|
250
256
|
| `api-workers` | Cloudflare Workers runtime |
|
package/Dockerfile
CHANGED
|
@@ -4,15 +4,17 @@
|
|
|
4
4
|
# This stage installs all dependencies (including dev), builds the TypeScript
|
|
5
5
|
# source code into JavaScript, and prepares the production assets.
|
|
6
6
|
# ==============================================================================
|
|
7
|
-
FROM oven/bun:1.
|
|
7
|
+
FROM --platform=$BUILDPLATFORM oven/bun:1.4.0 AS build
|
|
8
8
|
|
|
9
9
|
WORKDIR /usr/src/app
|
|
10
10
|
|
|
11
11
|
# Copy dependency manifests for optimized layer caching
|
|
12
12
|
COPY package.json bun.lock ./
|
|
13
13
|
|
|
14
|
-
# Install all dependencies (including dev dependencies for building)
|
|
15
|
-
|
|
14
|
+
# Install all dependencies (including dev dependencies for building).
|
|
15
|
+
# The BuildKit cache mount persists Bun's global package cache across builds.
|
|
16
|
+
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
17
|
+
bun install --frozen-lockfile --ignore-scripts
|
|
16
18
|
|
|
17
19
|
# Copy the rest of the source code
|
|
18
20
|
COPY . .
|
|
@@ -28,7 +30,7 @@ RUN bun run build
|
|
|
28
30
|
# application. It uses a slim base image and only includes production
|
|
29
31
|
# dependencies and build artifacts.
|
|
30
32
|
# ==============================================================================
|
|
31
|
-
FROM oven/bun:1.
|
|
33
|
+
FROM oven/bun:1.4.0-slim AS production
|
|
32
34
|
|
|
33
35
|
WORKDIR /usr/src/app
|
|
34
36
|
|
|
@@ -37,24 +39,30 @@ WORKDIR /usr/src/app
|
|
|
37
39
|
ENV NODE_ENV=production
|
|
38
40
|
|
|
39
41
|
# OCI image metadata (https://github.com/opencontainers/image-spec/blob/main/annotations.md)
|
|
40
|
-
|
|
42
|
+
ARG APP_VERSION
|
|
43
|
+
LABEL org.opencontainers.image.title="workflows-mcp-server"
|
|
41
44
|
LABEL org.opencontainers.image.description="Store, query, and create YAML workflow playbooks for LLM agents via MCP."
|
|
42
45
|
LABEL org.opencontainers.image.source="https://github.com/cyanheads/workflows-mcp-server"
|
|
43
46
|
LABEL org.opencontainers.image.licenses="Apache-2.0"
|
|
47
|
+
LABEL org.opencontainers.image.version="${APP_VERSION}"
|
|
48
|
+
LABEL io.modelcontextprotocol.server.name="io.github.cyanheads/workflows-mcp-server"
|
|
44
49
|
|
|
45
50
|
# Copy dependency manifests
|
|
46
51
|
COPY package.json bun.lock ./
|
|
47
52
|
|
|
48
53
|
# Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
|
|
49
|
-
# that are not needed in the final production image.
|
|
50
|
-
|
|
54
|
+
# that are not needed in the final production image. `--omit=peer` drops the
|
|
55
|
+
# framework's optional service/test tiers; runtime imports remain direct deps.
|
|
56
|
+
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
57
|
+
bun install --production --omit=peer --frozen-lockfile --ignore-scripts
|
|
51
58
|
|
|
52
59
|
# Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
|
|
53
60
|
# These are not bundled by default to keep the base image lean. Enable at build time
|
|
54
61
|
# with: docker build --build-arg OTEL_ENABLED=true
|
|
55
62
|
ARG OTEL_ENABLED=true
|
|
56
|
-
RUN
|
|
57
|
-
|
|
63
|
+
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
64
|
+
if [ "$OTEL_ENABLED" = "true" ]; then \
|
|
65
|
+
bun add --omit=dev --omit=peer --ignore-scripts @hono/otel \
|
|
58
66
|
@opentelemetry/instrumentation-http \
|
|
59
67
|
@opentelemetry/exporter-metrics-otlp-http \
|
|
60
68
|
@opentelemetry/exporter-trace-otlp-http \
|
|
@@ -95,5 +103,8 @@ ENV MCP_FORCE_CONSOLE_LOGGING="true"
|
|
|
95
103
|
# Expose the port the server listens on
|
|
96
104
|
EXPOSE ${MCP_HTTP_PORT}
|
|
97
105
|
|
|
106
|
+
# Health check using a bun-native fetch (slim image ships no curl/wget)
|
|
107
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD bun -e "fetch('http://localhost:'+(process.env.MCP_HTTP_PORT??'3010')+'/healthz').then((r)=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
|
|
108
|
+
|
|
98
109
|
# The command to start the server
|
|
99
110
|
CMD ["bun", "run", "dist/index.js"]
|
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@ Apache License
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2026 Casey Hand @cyanheads
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<h1>@cyanheads/workflows-mcp-server</h1>
|
|
3
3
|
<p><b>Store, query, and create YAML workflow playbooks for LLM agents via MCP. STDIO or Streamable HTTP.</b>
|
|
4
|
-
<div>
|
|
4
|
+
<div>5 Tools</div>
|
|
5
5
|
</p>
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/workflows-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/workflows-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -23,23 +23,26 @@
|
|
|
23
23
|
|
|
24
24
|
## Tools
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Five tools covering the full workflow library lifecycle — discovery, retrieval, creation, and deletion for both permanent and temporary workflows:
|
|
27
27
|
|
|
28
28
|
| Tool | Description |
|
|
29
29
|
|:-----|:------------|
|
|
30
|
-
| `workflow_list` | List all permanent workflows in the index, with optional category and tag filters. |
|
|
30
|
+
| `workflow_list` | List all permanent workflows in the index, with optional keyword, category, and tag filters. |
|
|
31
31
|
| `workflow_get` | Retrieve a complete workflow definition by name, with global instructions prepended. |
|
|
32
32
|
| `workflow_create` | Write a new permanent workflow YAML to the library. |
|
|
33
33
|
| `workflow_create_temp` | Write a temporary one-shot workflow, indexed but excluded from list results. |
|
|
34
|
+
| `workflow_delete` | Permanently remove a permanent workflow by name and optional version. |
|
|
34
35
|
|
|
35
36
|
### `workflow_list`
|
|
36
37
|
|
|
37
38
|
List permanent workflows from the in-memory index.
|
|
38
39
|
|
|
40
|
+
- Optional keyword `query` filter (case-insensitive substring across workflow name and description)
|
|
39
41
|
- Optional category filter (case-insensitive substring match)
|
|
40
42
|
- Optional tag filter (AND match — all listed tags must be present)
|
|
41
43
|
- Set `includeTools: true` to surface the unique `server/tool` pairs used across each workflow's steps
|
|
42
44
|
- Temporary workflows are excluded; results sorted by name then version descending
|
|
45
|
+
- Empty results echo the applied filters with a hint to broaden
|
|
43
46
|
|
|
44
47
|
---
|
|
45
48
|
|
|
@@ -59,7 +62,7 @@ Retrieve a complete workflow by name, including the global instructions document
|
|
|
59
62
|
|
|
60
63
|
Write a new permanent workflow to the library.
|
|
61
64
|
|
|
62
|
-
- Workflow stored at `categories/<slugified-category>/<slugified-name>-workflow.yaml`
|
|
65
|
+
- Workflow stored at `categories/<slugified-category>/<slugified-name>-<slugified-version>-workflow.yaml` — one file per `name@version`, so multiple versions coexist
|
|
63
66
|
- Rejects if `name@version` already exists — bump the version to create a new revision
|
|
64
67
|
- Server stamps `created_date` and `last_updated_date` automatically
|
|
65
68
|
- Index and snapshot rebuilt after write; filesystem watcher also fires (idempotent, debounced)
|
|
@@ -76,6 +79,16 @@ Write a throwaway workflow to the `temp/` directory.
|
|
|
76
79
|
|
|
77
80
|
---
|
|
78
81
|
|
|
82
|
+
### `workflow_delete`
|
|
83
|
+
|
|
84
|
+
Permanently remove a permanent workflow from the library.
|
|
85
|
+
|
|
86
|
+
- Semver-aware: omit `version` to delete the highest available match; specify a version to target one exactly
|
|
87
|
+
- Only permanent workflows can be deleted — temporary workflows are rejected (they expire on their own)
|
|
88
|
+
- Irreversible: the file is removed and the workflow no longer appears in `workflow_list` or `workflow_get`
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
79
92
|
## Features
|
|
80
93
|
|
|
81
94
|
Built on [`@cyanheads/mcp-ts-core`](https://www.npmjs.com/package/@cyanheads/mcp-ts-core):
|
|
@@ -100,7 +113,7 @@ Agent-friendly output:
|
|
|
100
113
|
|
|
101
114
|
- `workflow_get` always includes `globalInstructions` alongside the workflow — no second call needed
|
|
102
115
|
- Discriminated `source` field (`permanent` | `temp`) on every `workflow_get` response
|
|
103
|
-
- Typed error contracts with structured `reason` codes (`not_found`, `version_not_found`, `already_exists`, `index_unavailable`) so callers can branch on error type rather than parsing messages
|
|
116
|
+
- Typed error contracts with structured `reason` codes (`not_found`, `version_not_found`, `already_exists`, `temp_not_allowed`, `index_unavailable`) so callers can branch on error type rather than parsing messages
|
|
104
117
|
- `workflow_list` with `includeTools: true` surfaces all MCP server/tool dependencies at a glance
|
|
105
118
|
|
|
106
119
|
---
|
|
@@ -178,7 +191,7 @@ The repository ships a `workflows-yaml/` directory with example workflows organi
|
|
|
178
191
|
|
|
179
192
|
### Prerequisites
|
|
180
193
|
|
|
181
|
-
- [Bun v1.3.
|
|
194
|
+
- [Bun v1.3.0](https://bun.sh/) or higher (or Node.js v24+).
|
|
182
195
|
- A local directory containing YAML workflow files (or use the bundled `workflows-yaml/` seed).
|
|
183
196
|
|
|
184
197
|
### Installation
|