@imqueue/mcp 1.2.1 → 2.0.2

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/dist/index.js CHANGED
@@ -1,244 +1,19 @@
1
1
  #!/usr/bin/env node
2
- // @imqueue MCP server — exposes @imqueue docs search and service/client
3
- // scaffolding to AI coding agents (Claude Code, Cursor, …) over stdio.
4
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ // @imqueue MCP server — local (stdio) entry point. Exposes @imqueue docs search,
3
+ // scaffolding and CLI/fleet tools to AI coding agents (Claude Code, Cursor, …).
4
+ // The hosted (HTTP) entry lives in worker/worker.ts; both share ./server.ts.
5
5
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
- import { z } from "zod";
7
6
  import { createRequire } from "node:module";
8
- import { searchDocs, getDoc } from "./docs.js";
9
- import { renderPackages } from "./packages.js";
10
- import { scaffoldService, scaffoldClient } from "./scaffold.js";
7
+ import { createServer } from "./server.js";
11
8
  import { cliStatus, cliHelp, createService, generateClient, installCli, fleet, config, logs } from "./cli.js";
12
9
  // Read the version from package.json at runtime so it always matches the
13
10
  // published package (no hardcoded string to keep in sync).
14
11
  const require = createRequire(import.meta.url);
15
12
  const { version } = require("../package.json");
16
- const text = (t) => ({ content: [{ type: "text", text: t }] });
17
- const fail = (e) => ({
18
- content: [{ type: "text", text: `Error: ${e instanceof Error ? e.message : String(e)}` }],
19
- isError: true,
20
- });
21
- const methodSchema = z
22
- .object({
23
- name: z.string().describe("Method name"),
24
- description: z.string().optional().describe("What the method does"),
25
- params: z
26
- .array(z.object({
27
- name: z.string(),
28
- type: z.string().describe("TypeScript type, e.g. 'string' or 'number[]'"),
29
- description: z.string().optional(),
30
- }))
31
- .optional(),
32
- returns: z.string().optional().describe("TypeScript return type WITHOUT Promise<> — e.g. 'User' or 'string'"),
33
- })
34
- .strict();
35
- const server = new McpServer({ name: "imqueue", version });
36
- server.registerTool("search_docs", {
37
- title: "Search @imqueue documentation",
38
- description: "Search the official @imqueue docs (guides, tutorial, CLI manual, API reference, articles) and return the most relevant pages with their URLs. Use this first when asked how to do something in @imqueue, then get_doc to read a page in full.",
39
- inputSchema: {
40
- query: z.string().describe("What you want to find, e.g. 'expose a service method' or 'delayed jobs'"),
41
- limit: z.number().int().min(1).max(20).optional().describe("Max results (default 6)"),
42
- },
43
- }, async ({ query, limit }) => {
44
- try {
45
- const hits = await searchDocs(query, limit ?? 6);
46
- if (!hits.length)
47
- return text(`No matches for "${query}". Try broader terms or call list_packages.`);
48
- const body = hits
49
- .map((h) => `### ${h.title} _(${h.section})_\n${h.description}\n${h.url}`)
50
- .join("\n\n");
51
- return text(`${hits.length} result(s) for "${query}":\n\n${body}\n\nRead any page in full with get_doc(url).`);
52
- }
53
- catch (e) {
54
- return fail(e);
55
- }
56
- });
57
- server.registerTool("get_doc", {
58
- title: "Read an @imqueue doc page",
59
- description: "Fetch the full markdown of an @imqueue documentation page by its URL (as returned by search_docs). Returns plain markdown suitable for reading and quoting.",
60
- inputSchema: {
61
- url: z.string().describe("An imqueue.org page URL, e.g. https://imqueue.org/get-started/"),
62
- },
63
- }, async ({ url }) => {
64
- try {
65
- const doc = await getDoc(url);
66
- return text(`Source: ${doc.url}\n\n${doc.markdown}`);
67
- }
68
- catch (e) {
69
- return fail(e);
70
- }
71
- });
72
- server.registerTool("list_packages", {
73
- title: "List @imqueue packages",
74
- description: "Return the main @imqueue packages with a one-line summary and install command, so you can pick the right one.",
75
- inputSchema: {},
76
- }, async () => {
77
- try {
78
- return text(renderPackages());
79
- }
80
- catch (e) {
81
- return fail(e);
82
- }
83
- });
84
- server.registerTool("scaffold_service", {
85
- title: "Scaffold an @imqueue service",
86
- description: "Generate an idiomatic @imqueue/rpc service (an IMQService subclass with @expose()d, JSDoc-typed methods) plus a bootstrap that starts it. Provide the methods you want, or omit them for a starter template.",
87
- inputSchema: {
88
- name: z.string().describe("Service name, e.g. 'user' or 'UserService'"),
89
- methods: z.array(methodSchema).optional().describe("Methods to expose"),
90
- },
91
- }, async ({ name, methods }) => {
92
- try {
93
- return text(scaffoldService(name, methods));
94
- }
95
- catch (e) {
96
- return fail(e);
97
- }
98
- });
99
- server.registerTool("scaffold_client", {
100
- title: "Scaffold an @imqueue typed client",
101
- description: "Show how to generate and use the fully-typed client for an @imqueue service. @imqueue generates the real client from a running service (via `imq client generate`), so this returns that command plus an illustrative usage snippet.",
102
- inputSchema: {
103
- service: z.string().describe("The service to call, e.g. 'user' or 'UserService'"),
104
- methods: z.array(methodSchema).optional().describe("Known methods (used to shape the example call)"),
105
- },
106
- }, async ({ service, methods }) => {
107
- try {
108
- return text(scaffoldClient(service, methods));
109
- }
110
- catch (e) {
111
- return fail(e);
112
- }
113
- });
114
- // --- CLI-backed tools (require the `imq` binary on PATH) --------------------
115
- server.registerTool("cli_status", {
116
- title: "Check the @imqueue CLI",
117
- description: "Detect whether the `imq` CLI (@imqueue/cli) is installed locally and report its version. Call this before create_service/generate_client; if it's missing, fall back to scaffold_service/scaffold_client.",
118
- inputSchema: {},
119
- }, async () => {
120
- try {
121
- return text(await cliStatus());
122
- }
123
- catch (e) {
124
- return fail(e);
125
- }
126
- });
127
- server.registerTool("cli_help", {
128
- title: "Show @imqueue CLI help",
129
- description: "Run `imq [command] --help` and return the exact, version-accurate flags for a command (e.g. 'service create', 'client generate'). Use this to discover the flags to pass to create_service. No side effects.",
130
- inputSchema: {
131
- command: z.string().optional().describe("A subcommand, e.g. 'service create' (omit for top-level help)"),
132
- },
133
- }, async ({ command }) => {
134
- try {
135
- return text(await cliHelp(command));
136
- }
137
- catch (e) {
138
- return fail(e);
139
- }
140
- });
141
- server.registerTool("create_service", {
142
- title: "Create an @imqueue service with the CLI",
143
- description: "Scaffold a real, provider-wired @imqueue service via `imq service create`. Runs as a DRY-RUN by default (shows the plan, writes nothing). Set apply=true to actually create it — that writes files and may init git / configure CI / push to a remote, so only apply with the user's intent. Pass CLI flags (see cli_help) to avoid interactive prompts. Requires `imq` (see cli_status).",
144
- inputSchema: {
145
- name: z.string().describe("Service name, e.g. 'user'"),
146
- path: z.string().optional().describe("Target directory (optional)"),
147
- flags: z.array(z.string()).optional().describe("Extra `imq` flags, e.g. ['--vcs','github','--ci','github-actions'] or feature selection ['--packages','pg-prisma,validation,opentelemetry,gcp','-D']. Get exact flags from cli_help."),
148
- cwd: z.string().optional().describe("Working directory to run in (defaults to the server's cwd)"),
149
- apply: z.boolean().optional().describe("false/omitted = dry-run preview; true = actually create (writes files)"),
150
- },
151
- }, async ({ name, path, flags, cwd, apply }) => {
152
- try {
153
- return text(await createService({ name, path, flags, cwd, apply }));
154
- }
155
- catch (e) {
156
- return fail(e);
157
- }
158
- });
159
- server.registerTool("generate_client", {
160
- title: "Generate a typed client with the CLI",
161
- description: "Run `imq client generate <Service>` to emit the real, fully-typed client. The target service must be RUNNING (the CLI introspects the live service). Requires `imq` (see cli_status).",
162
- inputSchema: {
163
- service: z.string().describe("Service name to generate a client for, e.g. 'User' / 'UserService'"),
164
- path: z.string().optional().describe("Output directory (optional)"),
165
- cwd: z.string().optional().describe("Working directory to run in"),
166
- },
167
- }, async ({ service, path, cwd }) => {
168
- try {
169
- return text(await generateClient(service, path, cwd));
170
- }
171
- catch (e) {
172
- return fail(e);
173
- }
174
- });
175
- server.registerTool("cli_install", {
176
- title: "Install the @imqueue CLI",
177
- description: "Install @imqueue/cli globally via `npm install -g @imqueue/cli`. Use when cli_status reports it's missing. A global install may require a user-writable npm prefix or elevated permissions.",
178
- inputSchema: {
179
- version: z.string().optional().describe("npm version/tag to install (default 'latest')"),
180
- },
181
- }, async ({ version }) => {
182
- try {
183
- return text(await installCli(version));
184
- }
185
- catch (e) {
186
- return fail(e);
187
- }
188
- });
189
- server.registerTool("fleet", {
190
- title: "Control the local @imqueue services fleet",
191
- description: "Run `imq ctl <action>` over a directory of service repositories. `status` is read-only; `start`/`stop`/`restart` change running processes. Requires `imq` (see cli_status).",
192
- inputSchema: {
193
- action: z.enum(["start", "stop", "restart", "status"]).describe("What to do to the fleet"),
194
- path: z.string().optional().describe("Directory containing the service repositories (default '.')"),
195
- services: z.string().optional().describe("Comma-separated service names; omit to scan the path"),
196
- update: z.boolean().optional().describe("git pull each service before starting (start/restart)"),
197
- calm: z.boolean().optional().describe("Start services one at a time, waiting for each to be ready"),
198
- verbose: z.boolean().optional().describe("Verbose output"),
199
- cwd: z.string().optional().describe("Working directory to run in"),
200
- },
201
- }, async ({ action, path, services, update, calm, verbose, cwd }) => {
202
- try {
203
- return text(await fleet({ action, path, services, update, calm, verbose, cwd }));
204
- }
205
- catch (e) {
206
- return fail(e);
207
- }
208
- });
209
- server.registerTool("config", {
210
- title: "Manage @imqueue CLI configuration",
211
- description: "Run `imq config <action>`. `check` = is config initialized; `get [option]` = read a value (or list all); `set option value` = write a value (nested keys use a dot-path, e.g. 'ci.provider'); `init` = interactive setup (prefer `set` for automation — `init` will time out non-interactively). Requires `imq` (see cli_status).",
212
- inputSchema: {
213
- action: z.enum(["check", "get", "set", "init"]).describe("Config operation"),
214
- option: z.string().optional().describe("Config key (dot-path for nested), for get/set"),
215
- value: z.string().optional().describe("Value to set (required for `set`)"),
216
- cwd: z.string().optional().describe("Working directory to run in"),
217
- },
218
- }, async ({ action, option, value, cwd }) => {
219
- try {
220
- return text(await config({ action, option, value, cwd }));
221
- }
222
- catch (e) {
223
- return fail(e);
224
- }
225
- });
226
- server.registerTool("logs", {
227
- title: "Read or clean @imqueue fleet logs",
228
- description: "Work with logs of services started by `imq ctl`. action='dump' (default) returns the current combined logs and exits — it never follows/streams, and output is capped. action='clean' deletes collected logs. Requires `imq` (see cli_status).",
229
- inputSchema: {
230
- action: z.enum(["dump", "clean"]).optional().describe("dump = read current logs (default); clean = delete collected logs"),
231
- services: z.string().optional().describe("Comma-separated service names; omit to combine all"),
232
- prefix: z.boolean().optional().describe("Prefix each line with the service name (default true)"),
233
- cwd: z.string().optional().describe("Working directory to run in"),
234
- },
235
- }, async ({ action, services, prefix, cwd }) => {
236
- try {
237
- return text(await logs({ action, services, prefix, cwd }));
238
- }
239
- catch (e) {
240
- return fail(e);
241
- }
13
+ const server = createServer({
14
+ version,
15
+ mode: "local",
16
+ cli: { cliStatus, cliHelp, createService, generateClient, installCli, fleet, config, logs },
242
17
  });
243
18
  async function main() {
244
19
  const transport = new StdioServerTransport();
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,wEAAwE;AACxE,uEAAuE;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAmB,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE9G,yEAAyE;AACzE,2DAA2D;AAC3D,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;AAEtE,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAChF,MAAM,IAAI,GAAG,CAAC,CAAU,EAAE,EAA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,MAAM,EAAE,IAAI,EAAE;CAC5F,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,2DAA2D;IAC3D,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;AACxD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export type Mode = "local" | "remote";
3
+ /**
4
+ * The CLI-backed handlers, injected only in local mode. Declared explicitly (not
5
+ * `typeof import("./cli.js")`) so this shared module has NO type dependency on the
6
+ * node-only cli.ts — that keeps the edge/remote bundle and its type-check free of
7
+ * node:child_process. The local entry (index.ts) supplies the real functions and
8
+ * the compiler verifies they still match this shape.
9
+ */
10
+ export interface CliHandlers {
11
+ cliStatus(): Promise<string>;
12
+ cliHelp(command?: string): Promise<string>;
13
+ createService(opts: {
14
+ name: string;
15
+ path?: string;
16
+ flags?: string[];
17
+ cwd?: string;
18
+ apply?: boolean;
19
+ }): Promise<string>;
20
+ generateClient(service: string, path?: string, cwd?: string): Promise<string>;
21
+ installCli(version?: string): Promise<string>;
22
+ fleet(opts: {
23
+ action: "start" | "stop" | "restart" | "status";
24
+ path?: string;
25
+ services?: string;
26
+ update?: boolean;
27
+ calm?: boolean;
28
+ verbose?: boolean;
29
+ cwd?: string;
30
+ }): Promise<string>;
31
+ config(opts: {
32
+ action: "check" | "get" | "set" | "init";
33
+ option?: string;
34
+ value?: string;
35
+ cwd?: string;
36
+ }): Promise<string>;
37
+ logs(opts: {
38
+ action?: "dump" | "clean";
39
+ services?: string;
40
+ prefix?: boolean;
41
+ cwd?: string;
42
+ }): Promise<string>;
43
+ }
44
+ /** How to install the full local server — surfaced by the remote hand-off + install_locally. */
45
+ export declare const LOCAL_INSTALL: string;
46
+ /**
47
+ * Create a fully-configured @imqueue MCP server.
48
+ * @param version Version string to report (kept in sync with package.json by the caller).
49
+ * @param mode "local" (full) or "remote" (docs+scaffold, CLI tools hand off to local).
50
+ * @param cli CLI-backed handlers; required for the real tools in local mode.
51
+ */
52
+ export declare function createServer(opts: {
53
+ version: string;
54
+ mode: Mode;
55
+ cli?: CliHandlers;
56
+ }): McpServer;
package/dist/server.js ADDED
@@ -0,0 +1,310 @@
1
+ // Shared @imqueue MCP server factory. Every tool is registered here once and the
2
+ // server runs in one of two modes:
3
+ //
4
+ // * "local" — runs on the developer's machine (stdio entry: index.ts). The
5
+ // CLI-backed tools drive the real `imq` binary. Their handlers are
6
+ // INJECTED via `cli` so this module never imports node:child_process
7
+ // (keeps the remote/edge bundle clean).
8
+ // * "remote" — hosted over HTTP (worker/worker.ts, e.g. mcp.imqueue.org). Docs
9
+ // search + scaffolding work fully; the CLI/fleet tools can't touch
10
+ // the user's machine, so they return a "run me locally" hand-off —
11
+ // and, where it makes sense, the equivalent offline scaffold inline.
12
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
13
+ import { z } from "zod";
14
+ import { searchDocs, getDoc } from "./docs.js";
15
+ import { renderPackages } from "./packages.js";
16
+ import { scaffoldService, scaffoldClient } from "./scaffold.js";
17
+ const text = (t) => ({ content: [{ type: "text", text: t }] });
18
+ const fail = (e) => ({
19
+ content: [{ type: "text", text: `Error: ${e instanceof Error ? e.message : String(e)}` }],
20
+ isError: true,
21
+ });
22
+ const methodSchema = z
23
+ .object({
24
+ name: z.string().describe("Method name"),
25
+ description: z.string().optional().describe("What the method does"),
26
+ params: z
27
+ .array(z.object({
28
+ name: z.string(),
29
+ type: z.string().describe("TypeScript type, e.g. 'string' or 'number[]'"),
30
+ description: z.string().optional(),
31
+ }))
32
+ .optional(),
33
+ returns: z.string().optional().describe("TypeScript return type WITHOUT Promise<> — e.g. 'User' or 'string'"),
34
+ })
35
+ .strict();
36
+ /** How to install the full local server — surfaced by the remote hand-off + install_locally. */
37
+ export const LOCAL_INSTALL = [
38
+ "Install the full @imqueue MCP server locally — it runs via `npx`, no build step:",
39
+ "",
40
+ "• Claude Code:",
41
+ " `claude mcp add imqueue -- npx -y @imqueue/mcp`",
42
+ "",
43
+ "• Cursor / Cline / Windsurf / other clients — add to your MCP config:",
44
+ "```json",
45
+ '{ "mcpServers": { "imqueue": { "command": "npx", "args": ["-y", "@imqueue/mcp"] } } }',
46
+ "```",
47
+ ].join("\n");
48
+ /** Build a "this tool is local-only on the hosted server" response, optionally with an inline offline equivalent. */
49
+ const handoff = (tool, why, offlineEquivalent) => text(`\`${tool}\` runs on **your machine** ${why}, so it isn't available on the hosted (\`mcp.imqueue.org\`) server.\n\n` +
50
+ LOCAL_INSTALL +
51
+ (offlineEquivalent
52
+ ? `\n\n---\n\nMeanwhile, here's an offline equivalent you can use right now:\n\n${offlineEquivalent}`
53
+ : ""));
54
+ /**
55
+ * Create a fully-configured @imqueue MCP server.
56
+ * @param version Version string to report (kept in sync with package.json by the caller).
57
+ * @param mode "local" (full) or "remote" (docs+scaffold, CLI tools hand off to local).
58
+ * @param cli CLI-backed handlers; required for the real tools in local mode.
59
+ */
60
+ export function createServer(opts) {
61
+ const { version, mode, cli } = opts;
62
+ const server = new McpServer({ name: "imqueue", version });
63
+ const local = mode === "local" && !!cli;
64
+ // --- Stateless tools: identical in both modes ----------------------------
65
+ server.registerTool("search_docs", {
66
+ title: "Search @imqueue documentation",
67
+ description: "Search the official @imqueue docs (guides, tutorial, CLI manual, API reference, articles) and return the most relevant pages with their URLs. Use this first when asked how to do something in @imqueue, then get_doc to read a page in full.",
68
+ inputSchema: {
69
+ query: z.string().describe("What you want to find, e.g. 'expose a service method' or 'delayed jobs'"),
70
+ limit: z.number().int().min(1).max(20).optional().describe("Max results (default 6)"),
71
+ },
72
+ }, async ({ query, limit }) => {
73
+ try {
74
+ const hits = await searchDocs(query, limit ?? 6);
75
+ if (!hits.length)
76
+ return text(`No matches for "${query}". Try broader terms or call list_packages.`);
77
+ const body = hits.map((h) => `### ${h.title} _(${h.section})_\n${h.description}\n${h.url}`).join("\n\n");
78
+ return text(`${hits.length} result(s) for "${query}":\n\n${body}\n\nRead any page in full with get_doc(url).`);
79
+ }
80
+ catch (e) {
81
+ return fail(e);
82
+ }
83
+ });
84
+ server.registerTool("get_doc", {
85
+ title: "Read an @imqueue doc page",
86
+ description: "Fetch the full markdown of an @imqueue documentation page by its URL (as returned by search_docs). Returns plain markdown suitable for reading and quoting.",
87
+ inputSchema: {
88
+ url: z.string().describe("An imqueue.org page URL, e.g. https://imqueue.org/get-started/"),
89
+ },
90
+ }, async ({ url }) => {
91
+ try {
92
+ const doc = await getDoc(url);
93
+ return text(`Source: ${doc.url}\n\n${doc.markdown}`);
94
+ }
95
+ catch (e) {
96
+ return fail(e);
97
+ }
98
+ });
99
+ server.registerTool("list_packages", {
100
+ title: "List @imqueue packages",
101
+ description: "Return the main @imqueue packages with a one-line summary and install command, so you can pick the right one.",
102
+ inputSchema: {},
103
+ }, async () => {
104
+ try {
105
+ return text(renderPackages());
106
+ }
107
+ catch (e) {
108
+ return fail(e);
109
+ }
110
+ });
111
+ server.registerTool("scaffold_service", {
112
+ title: "Scaffold an @imqueue service",
113
+ description: "Generate an idiomatic @imqueue/rpc service (an IMQService subclass with @expose()d, JSDoc-typed methods) plus a bootstrap that starts it. Provide the methods you want, or omit them for a starter template.",
114
+ inputSchema: {
115
+ name: z.string().describe("Service name, e.g. 'user' or 'UserService'"),
116
+ methods: z.array(methodSchema).optional().describe("Methods to expose"),
117
+ },
118
+ }, async ({ name, methods }) => {
119
+ try {
120
+ return text(scaffoldService(name, methods));
121
+ }
122
+ catch (e) {
123
+ return fail(e);
124
+ }
125
+ });
126
+ server.registerTool("scaffold_client", {
127
+ title: "Scaffold an @imqueue typed client",
128
+ description: "Show how to generate and use the fully-typed client for an @imqueue service. @imqueue generates the real client from a running service (via `imq client generate`), so this returns that command plus an illustrative usage snippet.",
129
+ inputSchema: {
130
+ service: z.string().describe("The service to call, e.g. 'user' or 'UserService'"),
131
+ methods: z.array(methodSchema).optional().describe("Known methods (used to shape the example call)"),
132
+ },
133
+ }, async ({ service, methods }) => {
134
+ try {
135
+ return text(scaffoldClient(service, methods));
136
+ }
137
+ catch (e) {
138
+ return fail(e);
139
+ }
140
+ });
141
+ // --- CLI-backed tools ------------------------------------------------------
142
+ // In local mode they drive the real `imq`. In remote mode each returns a
143
+ // hand-off to the local install (with an inline scaffold where one exists).
144
+ server.registerTool("cli_status", {
145
+ title: "Check the @imqueue CLI",
146
+ description: "Detect whether the `imq` CLI (@imqueue/cli) is installed locally and report its version. Call this before create_service/generate_client; if it's missing, fall back to scaffold_service/scaffold_client.",
147
+ inputSchema: {},
148
+ }, async () => {
149
+ if (local) {
150
+ try {
151
+ return text(await cli.cliStatus());
152
+ }
153
+ catch (e) {
154
+ return fail(e);
155
+ }
156
+ }
157
+ return handoff("cli_status", "(it inspects the `imq` binary installed on your machine)");
158
+ });
159
+ server.registerTool("cli_help", {
160
+ title: "Show @imqueue CLI help",
161
+ description: "Run `imq [command] --help` and return the exact, version-accurate flags for a command (e.g. 'service create', 'client generate'). Use this to discover the flags to pass to create_service. No side effects.",
162
+ inputSchema: {
163
+ command: z.string().optional().describe("A subcommand, e.g. 'service create' (omit for top-level help)"),
164
+ },
165
+ }, async ({ command }) => {
166
+ if (local) {
167
+ try {
168
+ return text(await cli.cliHelp(command));
169
+ }
170
+ catch (e) {
171
+ return fail(e);
172
+ }
173
+ }
174
+ return handoff("cli_help", "(it shells out to your local `imq` for version-accurate flags)");
175
+ });
176
+ server.registerTool("create_service", {
177
+ title: "Create an @imqueue service with the CLI",
178
+ description: "Scaffold a real, provider-wired @imqueue service via `imq service create`. Runs as a DRY-RUN by default (shows the plan, writes nothing). Set apply=true to actually create it — that writes files and may init git / configure CI / push to a remote, so only apply with the user's intent. Pass CLI flags (see cli_help) to avoid interactive prompts. Requires `imq` (see cli_status). On the hosted server this returns an offline scaffold instead.",
179
+ inputSchema: {
180
+ name: z.string().describe("Service name, e.g. 'user'"),
181
+ path: z.string().optional().describe("Target directory (optional)"),
182
+ flags: z
183
+ .array(z.string())
184
+ .optional()
185
+ .describe("Extra `imq` flags, e.g. ['--vcs','github','--ci','github-actions'] or feature selection ['--packages','pg-prisma,validation,opentelemetry,gcp','-D']. Get exact flags from cli_help."),
186
+ cwd: z.string().optional().describe("Working directory to run in (defaults to the server's cwd)"),
187
+ apply: z.boolean().optional().describe("false/omitted = dry-run preview; true = actually create (writes files)"),
188
+ },
189
+ }, async ({ name, path, flags, cwd, apply }) => {
190
+ if (local) {
191
+ try {
192
+ return text(await cli.createService({ name, path, flags, cwd, apply }));
193
+ }
194
+ catch (e) {
195
+ return fail(e);
196
+ }
197
+ }
198
+ return handoff("create_service", "(it writes files into your project and can init git / configure CI / push to a remote)", scaffoldService(name));
199
+ });
200
+ server.registerTool("generate_client", {
201
+ title: "Generate a typed client with the CLI",
202
+ description: "Run `imq client generate <Service>` to emit the real, fully-typed client. The target service must be RUNNING (the CLI introspects the live service). Requires `imq` (see cli_status). On the hosted server this returns an offline client snippet instead.",
203
+ inputSchema: {
204
+ service: z.string().describe("Service name to generate a client for, e.g. 'User' / 'UserService'"),
205
+ path: z.string().optional().describe("Output directory (optional)"),
206
+ cwd: z.string().optional().describe("Working directory to run in"),
207
+ },
208
+ }, async ({ service, path, cwd }) => {
209
+ if (local) {
210
+ try {
211
+ return text(await cli.generateClient(service, path, cwd));
212
+ }
213
+ catch (e) {
214
+ return fail(e);
215
+ }
216
+ }
217
+ return handoff("generate_client", "(it introspects a service running on your machine to emit the real typed client)", scaffoldClient(service));
218
+ });
219
+ server.registerTool("cli_install", {
220
+ title: "Install the @imqueue CLI",
221
+ description: "Install @imqueue/cli globally via `npm install -g @imqueue/cli`. Use when cli_status reports it's missing. A global install may require a user-writable npm prefix or elevated permissions.",
222
+ inputSchema: {
223
+ version: z.string().optional().describe("npm version/tag to install (default 'latest')"),
224
+ },
225
+ }, async ({ version: v }) => {
226
+ if (local) {
227
+ try {
228
+ return text(await cli.installCli(v));
229
+ }
230
+ catch (e) {
231
+ return fail(e);
232
+ }
233
+ }
234
+ return handoff("cli_install", "(it installs the `imq` binary onto your machine with npm)");
235
+ });
236
+ server.registerTool("fleet", {
237
+ title: "Control the local @imqueue services fleet",
238
+ description: "Run `imq ctl <action>` over a directory of service repositories. `status` is read-only; `start`/`stop`/`restart` change running processes. Requires `imq` (see cli_status).",
239
+ inputSchema: {
240
+ action: z.enum(["start", "stop", "restart", "status"]).describe("What to do to the fleet"),
241
+ path: z.string().optional().describe("Directory containing the service repositories (default '.')"),
242
+ services: z.string().optional().describe("Comma-separated service names; omit to scan the path"),
243
+ update: z.boolean().optional().describe("git pull each service before starting (start/restart)"),
244
+ calm: z.boolean().optional().describe("Start services one at a time, waiting for each to be ready"),
245
+ verbose: z.boolean().optional().describe("Verbose output"),
246
+ cwd: z.string().optional().describe("Working directory to run in"),
247
+ },
248
+ }, async ({ action, path, services, update, calm, verbose, cwd }) => {
249
+ if (local) {
250
+ try {
251
+ return text(await cli.fleet({ action, path, services, update, calm, verbose, cwd }));
252
+ }
253
+ catch (e) {
254
+ return fail(e);
255
+ }
256
+ }
257
+ return handoff("fleet", "(it starts/stops and inspects @imqueue service processes running on your machine)");
258
+ });
259
+ server.registerTool("config", {
260
+ title: "Manage @imqueue CLI configuration",
261
+ description: "Run `imq config <action>`. `check` = is config initialized; `get [option]` = read a value (or list all); `set option value` = write a value (nested keys use a dot-path, e.g. 'ci.provider'); `init` = interactive setup (prefer `set` for automation — `init` will time out non-interactively). Requires `imq` (see cli_status).",
262
+ inputSchema: {
263
+ action: z.enum(["check", "get", "set", "init"]).describe("Config operation"),
264
+ option: z.string().optional().describe("Config key (dot-path for nested), for get/set"),
265
+ value: z.string().optional().describe("Value to set (required for `set`)"),
266
+ cwd: z.string().optional().describe("Working directory to run in"),
267
+ },
268
+ }, async ({ action, option, value, cwd }) => {
269
+ if (local) {
270
+ try {
271
+ return text(await cli.config({ action, option, value, cwd }));
272
+ }
273
+ catch (e) {
274
+ return fail(e);
275
+ }
276
+ }
277
+ return handoff("config", "(it reads/writes the `imq` CLI configuration on your machine)");
278
+ });
279
+ server.registerTool("logs", {
280
+ title: "Read or clean @imqueue fleet logs",
281
+ description: "Work with logs of services started by `imq ctl`. action='dump' (default) returns the current combined logs and exits — it never follows/streams, and output is capped. action='clean' deletes collected logs. Requires `imq` (see cli_status).",
282
+ inputSchema: {
283
+ action: z.enum(["dump", "clean"]).optional().describe("dump = read current logs (default); clean = delete collected logs"),
284
+ services: z.string().optional().describe("Comma-separated service names; omit to combine all"),
285
+ prefix: z.boolean().optional().describe("Prefix each line with the service name (default true)"),
286
+ cwd: z.string().optional().describe("Working directory to run in"),
287
+ },
288
+ }, async ({ action, services, prefix, cwd }) => {
289
+ if (local) {
290
+ try {
291
+ return text(await cli.logs({ action, services, prefix, cwd }));
292
+ }
293
+ catch (e) {
294
+ return fail(e);
295
+ }
296
+ }
297
+ return handoff("logs", "(it reads logs of @imqueue services running on your machine)");
298
+ });
299
+ // --- Remote-only helper ----------------------------------------------------
300
+ // A discoverable "how do I get the full thing" tool on the hosted server.
301
+ if (!local) {
302
+ server.registerTool("install_locally", {
303
+ title: "Install the full @imqueue MCP locally",
304
+ description: "Return the exact steps to install the full @imqueue MCP server on your machine (needed for the CLI/fleet tools, which act on your local project and services). The hosted server covers docs search and scaffolding; everything else runs locally.",
305
+ inputSchema: {},
306
+ }, async () => text(LOCAL_INSTALL));
307
+ }
308
+ return server;
309
+ }
310
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,m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CAAC,YAAY,CACjB,iBAAiB,EACjB;YACE,KAAK,EAAE,uCAAuC;YAC9C,WAAW,EACT,oPAAoP;YACtP,WAAW,EAAE,EAAE;SAChB,EACD,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAChC,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imqueue/mcp",
3
- "version": "1.2.1",
3
+ "version": "2.0.2",
4
4
  "mcpName": "org.imqueue/mcp",
5
5
  "description": "Model Context Protocol server for @imqueue — lets AI coding agents search the docs and scaffold typed services & clients.",
6
6
  "keywords": [
@@ -40,7 +40,11 @@
40
40
  "dev": "tsx src/index.ts",
41
41
  "smoke": "node scripts/smoke.mjs",
42
42
  "version": "node scripts/sync-version.mjs && git add server.json",
43
- "prepublishOnly": "npm run build"
43
+ "prepublishOnly": "npm run build",
44
+ "postpublish": "node scripts/publish-registry.mjs",
45
+ "typecheck:worker": "tsc --noEmit -p worker/tsconfig.json",
46
+ "dev:worker": "wrangler dev",
47
+ "deploy:worker": "wrangler deploy"
44
48
  },
45
49
  "dependencies": {
46
50
  "@modelcontextprotocol/sdk": "^1.12.0",
@@ -49,6 +53,7 @@
49
53
  "devDependencies": {
50
54
  "@types/node": "^22.0.0",
51
55
  "tsx": "^4.19.0",
52
- "typescript": "^5.6.0"
56
+ "typescript": "^5.6.0",
57
+ "wrangler": "^4.0.0"
53
58
  }
54
59
  }