taskflow-mcp-core 0.1.6
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 +951 -0
- package/dist/mcp/jsonrpc.d.ts +54 -0
- package/dist/mcp/jsonrpc.d.ts.map +1 -0
- package/dist/mcp/jsonrpc.js +118 -0
- package/dist/mcp/jsonrpc.js.map +1 -0
- package/dist/mcp/server.d.ts +38 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +538 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/svg.d.ts +52 -0
- package/dist/mcp/svg.d.ts.map +1 -0
- package/dist/mcp/svg.js +312 -0
- package/dist/mcp/svg.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal, dependency-free stdio JSON-RPC 2.0 transport for an MCP server.
|
|
3
|
+
*
|
|
4
|
+
* taskflow-core ships ZERO runtime dependencies (a core selling point), so we do
|
|
5
|
+
* NOT pull in `@modelcontextprotocol/sdk`. MCP's stdio transport is just
|
|
6
|
+
* newline-delimited JSON-RPC 2.0 over stdin/stdout — small enough to implement
|
|
7
|
+
* on Node built-ins. This module handles framing + dispatch only; the MCP
|
|
8
|
+
* method semantics live in server.ts.
|
|
9
|
+
*
|
|
10
|
+
* Wire format: one JSON object per line on stdin (a request or notification),
|
|
11
|
+
* one JSON object per line on stdout (a response). Notifications (no `id`) get
|
|
12
|
+
* no response. Anything we can't parse is answered with a JSON-RPC parse error
|
|
13
|
+
* when an id is recoverable, else dropped (never crash the loop).
|
|
14
|
+
*/
|
|
15
|
+
export interface JsonRpcRequest {
|
|
16
|
+
jsonrpc: "2.0";
|
|
17
|
+
id?: string | number | null;
|
|
18
|
+
method: string;
|
|
19
|
+
params?: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface JsonRpcError {
|
|
22
|
+
code: number;
|
|
23
|
+
message: string;
|
|
24
|
+
data?: unknown;
|
|
25
|
+
}
|
|
26
|
+
/** Standard JSON-RPC / MCP error codes we use. */
|
|
27
|
+
export declare const RPC: {
|
|
28
|
+
readonly PARSE_ERROR: -32700;
|
|
29
|
+
readonly INVALID_REQUEST: -32600;
|
|
30
|
+
readonly METHOD_NOT_FOUND: -32601;
|
|
31
|
+
readonly INVALID_PARAMS: -32602;
|
|
32
|
+
readonly INTERNAL_ERROR: -32603;
|
|
33
|
+
};
|
|
34
|
+
/** Thrown by a handler to return a structured JSON-RPC error to the client. */
|
|
35
|
+
export declare class RpcError extends Error {
|
|
36
|
+
code: number;
|
|
37
|
+
data?: unknown;
|
|
38
|
+
constructor(code: number, message: string, data?: unknown);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A method handler. Return a JSON-serializable result, or throw `RpcError` for
|
|
42
|
+
* a structured failure. Returning `undefined` for a request (has id) sends
|
|
43
|
+
* `result: null`; for a notification it is ignored.
|
|
44
|
+
*/
|
|
45
|
+
export type RpcHandler = (params: unknown) => Promise<unknown> | unknown;
|
|
46
|
+
/**
|
|
47
|
+
* Run a JSON-RPC stdio loop over the given streams (defaults to process
|
|
48
|
+
* stdin/stdout). Resolves when the input stream ends (client disconnect).
|
|
49
|
+
*/
|
|
50
|
+
export declare function serveStdio(handlers: Record<string, RpcHandler>, io?: {
|
|
51
|
+
input?: NodeJS.ReadableStream;
|
|
52
|
+
output?: NodeJS.WritableStream;
|
|
53
|
+
}): Promise<void>;
|
|
54
|
+
//# sourceMappingURL=jsonrpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonrpc.d.ts","sourceRoot":"","sources":["../../src/mcp/jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED,kDAAkD;AAClD,eAAO,MAAM,GAAG;;;;;;CAMN,CAAC;AAEX,+EAA+E;AAC/E,qBAAa,QAAS,SAAQ,KAAK;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;gBACH,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO;CAMzD;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;AAEzE;;;GAGG;AACH,wBAAgB,UAAU,CACzB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACpC,EAAE,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAA;CAAO,GACxE,OAAO,CAAC,IAAI,CAAC,CA+Ef"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal, dependency-free stdio JSON-RPC 2.0 transport for an MCP server.
|
|
3
|
+
*
|
|
4
|
+
* taskflow-core ships ZERO runtime dependencies (a core selling point), so we do
|
|
5
|
+
* NOT pull in `@modelcontextprotocol/sdk`. MCP's stdio transport is just
|
|
6
|
+
* newline-delimited JSON-RPC 2.0 over stdin/stdout — small enough to implement
|
|
7
|
+
* on Node built-ins. This module handles framing + dispatch only; the MCP
|
|
8
|
+
* method semantics live in server.ts.
|
|
9
|
+
*
|
|
10
|
+
* Wire format: one JSON object per line on stdin (a request or notification),
|
|
11
|
+
* one JSON object per line on stdout (a response). Notifications (no `id`) get
|
|
12
|
+
* no response. Anything we can't parse is answered with a JSON-RPC parse error
|
|
13
|
+
* when an id is recoverable, else dropped (never crash the loop).
|
|
14
|
+
*/
|
|
15
|
+
/** Standard JSON-RPC / MCP error codes we use. */
|
|
16
|
+
export const RPC = {
|
|
17
|
+
PARSE_ERROR: -32700,
|
|
18
|
+
INVALID_REQUEST: -32600,
|
|
19
|
+
METHOD_NOT_FOUND: -32601,
|
|
20
|
+
INVALID_PARAMS: -32602,
|
|
21
|
+
INTERNAL_ERROR: -32603,
|
|
22
|
+
};
|
|
23
|
+
/** Thrown by a handler to return a structured JSON-RPC error to the client. */
|
|
24
|
+
export class RpcError extends Error {
|
|
25
|
+
code;
|
|
26
|
+
data;
|
|
27
|
+
constructor(code, message, data) {
|
|
28
|
+
super(message);
|
|
29
|
+
this.name = "RpcError";
|
|
30
|
+
this.code = code;
|
|
31
|
+
this.data = data;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Run a JSON-RPC stdio loop over the given streams (defaults to process
|
|
36
|
+
* stdin/stdout). Resolves when the input stream ends (client disconnect).
|
|
37
|
+
*/
|
|
38
|
+
export function serveStdio(handlers, io = {}) {
|
|
39
|
+
const input = io.input ?? process.stdin;
|
|
40
|
+
const output = io.output ?? process.stdout;
|
|
41
|
+
const write = (obj) => {
|
|
42
|
+
output.write(JSON.stringify(obj) + "\n");
|
|
43
|
+
};
|
|
44
|
+
const respondOk = (id, result) => {
|
|
45
|
+
write({ jsonrpc: "2.0", id, result: result === undefined ? null : result });
|
|
46
|
+
};
|
|
47
|
+
const respondErr = (id, err) => {
|
|
48
|
+
write({ jsonrpc: "2.0", id, error: err });
|
|
49
|
+
};
|
|
50
|
+
const handleLine = async (line) => {
|
|
51
|
+
const trimmed = line.trim();
|
|
52
|
+
if (!trimmed)
|
|
53
|
+
return;
|
|
54
|
+
let msg;
|
|
55
|
+
try {
|
|
56
|
+
msg = JSON.parse(trimmed);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// No recoverable id — per JSON-RPC, a parse error uses id:null.
|
|
60
|
+
respondErr(null, { code: RPC.PARSE_ERROR, message: "Parse error" });
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const isNotification = msg.id === undefined || msg.id === null;
|
|
64
|
+
const id = (msg.id ?? null);
|
|
65
|
+
if (msg.jsonrpc !== "2.0" || typeof msg.method !== "string") {
|
|
66
|
+
if (!isNotification)
|
|
67
|
+
respondErr(id, { code: RPC.INVALID_REQUEST, message: "Invalid Request" });
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const handler = handlers[msg.method];
|
|
71
|
+
if (!handler) {
|
|
72
|
+
// Unknown notifications are silently ignored (e.g. notifications/*).
|
|
73
|
+
if (!isNotification)
|
|
74
|
+
respondErr(id, { code: RPC.METHOD_NOT_FOUND, message: `Method not found: ${msg.method}` });
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
const result = await handler(msg.params);
|
|
79
|
+
if (!isNotification)
|
|
80
|
+
respondOk(id, result);
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
if (isNotification)
|
|
84
|
+
return; // can't report errors for notifications
|
|
85
|
+
if (e instanceof RpcError) {
|
|
86
|
+
respondErr(id, { code: e.code, message: e.message, data: e.data });
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
90
|
+
respondErr(id, { code: RPC.INTERNAL_ERROR, message });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
return new Promise((resolve) => {
|
|
95
|
+
let buffer = "";
|
|
96
|
+
// Serialize line handling so responses are emitted in request order even
|
|
97
|
+
// when handlers are async (MCP clients tolerate interleaving, but ordered
|
|
98
|
+
// output is simpler to reason about and test).
|
|
99
|
+
let chain = Promise.resolve();
|
|
100
|
+
input.on("data", (data) => {
|
|
101
|
+
buffer += data.toString();
|
|
102
|
+
let i;
|
|
103
|
+
while ((i = buffer.indexOf("\n")) >= 0) {
|
|
104
|
+
const line = buffer.slice(0, i);
|
|
105
|
+
buffer = buffer.slice(i + 1);
|
|
106
|
+
chain = chain.then(() => handleLine(line));
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
input.on("end", () => {
|
|
110
|
+
chain = chain.then(() => {
|
|
111
|
+
if (buffer.trim())
|
|
112
|
+
return handleLine(buffer);
|
|
113
|
+
}).then(() => resolve());
|
|
114
|
+
});
|
|
115
|
+
input.on("close", () => resolve());
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=jsonrpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonrpc.js","sourceRoot":"","sources":["../../src/mcp/jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAeH,kDAAkD;AAClD,MAAM,CAAC,MAAM,GAAG,GAAG;IAClB,WAAW,EAAE,CAAC,KAAK;IACnB,eAAe,EAAE,CAAC,KAAK;IACvB,gBAAgB,EAAE,CAAC,KAAK;IACxB,cAAc,EAAE,CAAC,KAAK;IACtB,cAAc,EAAE,CAAC,KAAK;CACb,CAAC;AAEX,+EAA+E;AAC/E,MAAM,OAAO,QAAS,SAAQ,KAAK;IAClC,IAAI,CAAS;IACb,IAAI,CAAW;IACf,YAAY,IAAY,EAAE,OAAe,EAAE,IAAc;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CACD;AASD;;;GAGG;AACH,MAAM,UAAU,UAAU,CACzB,QAAoC,EACpC,KAAwE,EAAE;IAE1E,MAAM,KAAK,GAA0B,EAAE,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC;IA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 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* taskflow as an MCP server (host-neutral core).
|
|
3
|
+
*
|
|
4
|
+
* Exposes the taskflow engine as MCP tools so an MCP host (Codex, Claude Code,
|
|
5
|
+
* or any MCP client) can declare and run verifiable task DAGs from inside its
|
|
6
|
+
* own session. Each host adapter binds this server to its own `SubagentRunner`
|
|
7
|
+
* (codex → `codex exec` subagents, claude → `claude -p` subagents), so the
|
|
8
|
+
* whole thing closes the loop with no pi process required.
|
|
9
|
+
*
|
|
10
|
+
* Protocol: MCP over stdio, JSON-RPC 2.0 (newline-delimited). Implemented on the
|
|
11
|
+
* dependency-free transport in ./jsonrpc.ts — taskflow-core keeps its zero-
|
|
12
|
+
* runtime-deps guarantee; we do NOT use @modelcontextprotocol/sdk.
|
|
13
|
+
*
|
|
14
|
+
* This module is intentionally NOT in the barrel (index.ts) — hosts import it
|
|
15
|
+
* via the `taskflow-mcp` package (it is NOT re-exported from taskflow-core.
|
|
16
|
+
*
|
|
17
|
+
* Tools exposed:
|
|
18
|
+
* - taskflow_run : run an inline or saved flow, return the final output
|
|
19
|
+
* - taskflow_list : list saved flows discoverable in this cwd
|
|
20
|
+
* - taskflow_show : show a saved flow's definition
|
|
21
|
+
* - taskflow_verify : statically verify a flow (no execution)
|
|
22
|
+
* - taskflow_compile : render a flow as a DAG diagram (SVG image) + status line
|
|
23
|
+
* - taskflow_peek : inspect a stored run's intermediate phase output
|
|
24
|
+
*/
|
|
25
|
+
import { type RpcHandler } from "./jsonrpc.ts";
|
|
26
|
+
import type { SubagentRunner, AgentConfig } from "taskflow-core";
|
|
27
|
+
/**
|
|
28
|
+
* Build the per-call tool handlers. `cwd` is the directory the server was
|
|
29
|
+
* launched in (where saved flows + agents are discovered, and where subagents
|
|
30
|
+
* run). `runner` is the host's SubagentRunner (codex/claude) — each phase's
|
|
31
|
+
* subagent executes through it.
|
|
32
|
+
*/
|
|
33
|
+
export declare function makeToolHandlers(cwd: string, runner: SubagentRunner<AgentConfig>): Record<string, (args: Record<string, unknown>) => Promise<unknown>>;
|
|
34
|
+
/** Build the full MCP method dispatch table (protocol + tools). */
|
|
35
|
+
export declare function makeMcpHandlers(cwd: string, runner: SubagentRunner<AgentConfig>): Record<string, RpcHandler>;
|
|
36
|
+
/** Start the stdio MCP server. Resolves when the client disconnects. */
|
|
37
|
+
export declare function startMcpServer(runner: SubagentRunner<AgentConfig>, cwd?: string): Promise<void>;
|
|
38
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AA+B1E,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA8PjE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,CAAC,WAAW,CAAC,GACjC,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,CAuOrE;AAED,mEAAmE;AACnE,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CA2B5G;AAED,wEAAwE;AACxE,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,CAAC,WAAW,CAAC,EAAE,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9G"}
|