🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@imqueue/mcp

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@imqueue/mcp - npm Package Compare versions

Comparing version
1.0.1
to
1.1.0
+47
dist/cli.d.ts
export interface CliResult {
ok: boolean;
code: number | null;
output: string;
}
/** Run `imq` with args in cwd. Never rejects — returns a structured result. */
export declare function runImq(args: string[], cwd?: string, timeoutMs?: number): Promise<CliResult>;
/** Install @imqueue/cli globally via npm. */
export declare function installCli(version?: string): Promise<string>;
/** Control the local services fleet: `imq ctl <start|stop|restart|status>`. */
export declare function fleet(opts: {
action: "start" | "stop" | "restart" | "status";
path?: string;
services?: string;
update?: boolean;
calm?: boolean;
verbose?: boolean;
cwd?: string;
}): Promise<string>;
/** Manage CLI configuration: `imq config <check|get|set|init>`. */
export declare function config(opts: {
action: "check" | "get" | "set" | "init";
option?: string;
value?: string;
cwd?: string;
}): Promise<string>;
/** Read (dump) or clean fleet logs: `imq log`. Never follows (that would hang). */
export declare function logs(opts: {
action?: "dump" | "clean";
services?: string;
prefix?: boolean;
cwd?: string;
}): Promise<string>;
/** Detect the CLI and its version. */
export declare function cliStatus(): Promise<string>;
/** Pass through `imq [command] --help` so the agent learns exact, current flags. */
export declare function cliHelp(command?: string): Promise<string>;
/** Preview or (with apply) run `imq service create`. */
export declare function createService(opts: {
name: string;
path?: string;
flags?: string[];
cwd?: string;
apply?: boolean;
}): Promise<string>;
/** Generate the real typed client from a running service. */
export declare function generateClient(service: string, path?: string, cwd?: string): Promise<string>;
// Bridge to the installed @imqueue/cli (`imq`). The MCP server runs locally, so
// when the developer has `imq` on PATH we can drive the real CLI instead of only
// emitting templates.
//
// Safety posture:
// * stdin is closed and every call is time-boxed, so an interactive prompt
// (a missing flag) fails fast instead of hanging the server.
// * `imq service create` runs with --dry-run UNLESS the caller explicitly opts
// in (apply: true) — an agent must not create repos / push to remotes silently.
import { execFile } from "node:child_process";
const NOT_FOUND = "The `imq` CLI was not found on PATH. Install it with `npm i -g @imqueue/cli`, " +
"or use scaffold_service/scaffold_client for offline code templates.";
/** Run any binary with args. Never rejects — returns a structured result. */
function exec(file, args, opts = {}) {
const { cwd, timeoutMs = 60_000, notFound = `\`${file}\` was not found on PATH.` } = opts;
return new Promise((resolve) => {
execFile(file, args, { cwd: cwd || process.cwd(), timeout: timeoutMs, encoding: "utf8", windowsHide: true }, (err, stdout, stderr) => {
const e = err;
if (e && e.code === "ENOENT") {
resolve({ ok: false, code: null, output: notFound });
return;
}
const out = `${stdout || ""}${stderr || ""}`.trim();
if (e && e.killed) {
resolve({ ok: false, code: null, output: `${file} timed out after ${timeoutMs}ms. If it was waiting for input, pass the required flags/values (see cli_help) instead.\n\n${out}` });
return;
}
const code = typeof e?.code === "number" ? e.code : e ? 1 : 0;
resolve({ ok: !e, code, output: out || "(no output)" });
});
});
}
/** Run `imq` with args in cwd. Never rejects — returns a structured result. */
export function runImq(args, cwd, timeoutMs = 60_000) {
return exec("imq", args, { cwd, timeoutMs, notFound: NOT_FOUND });
}
/** Install @imqueue/cli globally via npm. */
export async function installCli(version = "latest") {
const spec = `@imqueue/cli@${version}`;
const r = await exec("npm", ["install", "-g", spec], {
timeoutMs: 180_000,
notFound: "npm was not found on PATH.",
});
if (r.ok) {
return `Installed ${spec} globally. Run cli_status to confirm, then use create_service / generate_client / fleet / config.\n\n${r.output}`;
}
return `Failed to install ${spec} (npm exit ${r.code}). A global install may need a user-writable npm prefix (e.g. via nvm) or elevated permissions.\n\n${r.output}`;
}
/** Control the local services fleet: `imq ctl <start|stop|restart|status>`. */
export async function fleet(opts) {
const args = ["ctl", opts.action];
if (opts.path)
args.push("-p", opts.path);
if (opts.services)
args.push("-s", opts.services);
if (opts.update)
args.push("-u");
if (opts.calm)
args.push("-c");
if (opts.verbose)
args.push("-v");
const timeoutMs = opts.action === "status" ? 30_000 : 120_000;
const r = await runImq(args, opts.cwd, timeoutMs);
return `\`imq ${args.join(" ")}\`\n\n${r.output}`;
}
/** Manage CLI configuration: `imq config <check|get|set|init>`. */
export async function config(opts) {
const args = ["config", opts.action];
if (opts.action === "get" && opts.option)
args.push(opts.option);
if (opts.action === "set") {
if (!opts.option || opts.value === undefined) {
return "config set requires both `option` and `value` (e.g. option='ci.provider', value='github-actions'). Nested keys use a dot-path.";
}
args.push(opts.option, opts.value);
}
const r = await runImq(args, opts.cwd, 30_000);
return `\`imq ${args.join(" ")}\`\n\n${r.output}`;
}
const LOG_MAX = 20_000; // cap dumped log output so it can't flood the agent context
/** Read (dump) or clean fleet logs: `imq log`. Never follows (that would hang). */
export async function logs(opts) {
if ((opts.action ?? "dump") === "clean") {
const r = await runImq(["log", "--clean"], opts.cwd, 30_000);
return `\`imq log --clean\`\n\n${r.output}`;
}
const args = ["log"];
if (opts.services) {
args.push(...opts.services.split(",").map((s) => s.trim()).filter(Boolean));
}
args.push("--no-follow"); // always bounded — the streaming --follow default is unsafe here
if (opts.prefix === false)
args.push("--no-prefix");
const r = await runImq(args, opts.cwd, 30_000);
let out = r.output;
let note = "";
if (out.length > LOG_MAX) {
out = out.slice(-LOG_MAX);
note = ` (truncated to last ${LOG_MAX} chars)`;
}
return `\`imq ${args.join(" ")}\`${note}\n\n${out}`;
}
/** Detect the CLI and its version. */
export async function cliStatus() {
const r = await runImq(["--version"], undefined, 15_000);
if (!r.ok)
return r.output;
return `imq is available (version ${r.output}).`;
}
/** Pass through `imq [command] --help` so the agent learns exact, current flags. */
export async function cliHelp(command) {
const args = command ? [...command.split(/\s+/), "--help"] : ["--help"];
const r = await runImq(args, undefined, 15_000);
return r.output;
}
/** Preview or (with apply) run `imq service create`. */
export async function createService(opts) {
const args = ["service", "create", opts.name];
if (opts.path)
args.push(opts.path);
if (opts.flags?.length)
args.push(...opts.flags);
if (!opts.apply)
args.push("--dry-run");
const r = await runImq(args, opts.cwd, opts.apply ? 120_000 : 30_000);
const header = opts.apply
? "Ran `imq service create` (apply mode — files were written):"
: "Dry-run plan (nothing was written). Re-call with apply: true to create it for real:";
return `${header}\n\n\`imq ${args.join(" ")}\`\n\n${r.output}`;
}
/** Generate the real typed client from a running service. */
export async function generateClient(service, path, cwd) {
const args = ["client", "generate", service];
if (path)
args.push(path);
const r = await runImq(args, cwd, 90_000);
const note = r.ok
? "Generated the typed client."
: "Client generation needs the target service to be RUNNING (it introspects the live service). Start the service, then retry.";
return `${note}\n\n\`imq ${args.join(" ")}\`\n\n${r.output}`;
}
//# sourceMappingURL=cli.js.map
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,iFAAiF;AACjF,sBAAsB;AACtB,EAAE;AACF,kBAAkB;AAClB,6EAA6E;AAC7E,iEAAiE;AACjE,iFAAiF;AACjF,oFAAoF;AACpF,OAAO,EAAE,QAAQ,EAA0B,MAAM,oBAAoB,CAAC;AAQtE,MAAM,SAAS,GACb,gFAAgF;IAChF,qEAAqE,CAAC;AAExE,6EAA6E;AAC7E,SAAS,IAAI,CACX,IAAY,EACZ,IAAc,EACd,OAAgE,EAAE;IAElE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,MAAM,EAAE,QAAQ,GAAG,KAAK,IAAI,2BAA2B,EAAE,GAAG,IAAI,CAAC;IAC1F,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,QAAQ,CACN,IAAI,EACJ,IAAI,EACJ,EAAE,GAAG,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,EACtF,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACtB,MAAM,CAAC,GAAG,GAAwD,CAAC;YACnE,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC7B,OAAO,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CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE;QACf,CAAC,CAAC,6BAA6B;QAC/B,CAAC,CAAC,4HAA4H,CAAC;IACjI,OAAO,GAAG,IAAI,aAAa,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,CAAC;AAC/D,CAAC"}
+130
-0

@@ -11,2 +11,3 @@ #!/usr/bin/env node

import { scaffoldService, scaffoldClient } from "./scaffold.js";
import { cliStatus, cliHelp, createService, generateClient, installCli, fleet, config, logs } from "./cli.js";
// Read the version from package.json at runtime so it always matches the

@@ -114,2 +115,131 @@ // published package (no hardcoded string to keep in sync).

});
// --- CLI-backed tools (require the `imq` binary on PATH) --------------------
server.registerTool("cli_status", {
title: "Check the @imqueue CLI",
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.",
inputSchema: {},
}, async () => {
try {
return text(await cliStatus());
}
catch (e) {
return fail(e);
}
});
server.registerTool("cli_help", {
title: "Show @imqueue CLI help",
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.",
inputSchema: {
command: z.string().optional().describe("A subcommand, e.g. 'service create' (omit for top-level help)"),
},
}, async ({ command }) => {
try {
return text(await cliHelp(command));
}
catch (e) {
return fail(e);
}
});
server.registerTool("create_service", {
title: "Create an @imqueue service with the CLI",
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).",
inputSchema: {
name: z.string().describe("Service name, e.g. 'user'"),
path: z.string().optional().describe("Target directory (optional)"),
flags: z.array(z.string()).optional().describe("Extra `imq` flags, e.g. ['--vcs','github','--ci','github-actions']. Get exact flags from cli_help."),
cwd: z.string().optional().describe("Working directory to run in (defaults to the server's cwd)"),
apply: z.boolean().optional().describe("false/omitted = dry-run preview; true = actually create (writes files)"),
},
}, async ({ name, path, flags, cwd, apply }) => {
try {
return text(await createService({ name, path, flags, cwd, apply }));
}
catch (e) {
return fail(e);
}
});
server.registerTool("generate_client", {
title: "Generate a typed client with the CLI",
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).",
inputSchema: {
service: z.string().describe("Service name to generate a client for, e.g. 'User' / 'UserService'"),
path: z.string().optional().describe("Output directory (optional)"),
cwd: z.string().optional().describe("Working directory to run in"),
},
}, async ({ service, path, cwd }) => {
try {
return text(await generateClient(service, path, cwd));
}
catch (e) {
return fail(e);
}
});
server.registerTool("cli_install", {
title: "Install the @imqueue CLI",
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.",
inputSchema: {
version: z.string().optional().describe("npm version/tag to install (default 'latest')"),
},
}, async ({ version }) => {
try {
return text(await installCli(version));
}
catch (e) {
return fail(e);
}
});
server.registerTool("fleet", {
title: "Control the local @imqueue services fleet",
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).",
inputSchema: {
action: z.enum(["start", "stop", "restart", "status"]).describe("What to do to the fleet"),
path: z.string().optional().describe("Directory containing the service repositories (default '.')"),
services: z.string().optional().describe("Comma-separated service names; omit to scan the path"),
update: z.boolean().optional().describe("git pull each service before starting (start/restart)"),
calm: z.boolean().optional().describe("Start services one at a time, waiting for each to be ready"),
verbose: z.boolean().optional().describe("Verbose output"),
cwd: z.string().optional().describe("Working directory to run in"),
},
}, async ({ action, path, services, update, calm, verbose, cwd }) => {
try {
return text(await fleet({ action, path, services, update, calm, verbose, cwd }));
}
catch (e) {
return fail(e);
}
});
server.registerTool("config", {
title: "Manage @imqueue CLI configuration",
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).",
inputSchema: {
action: z.enum(["check", "get", "set", "init"]).describe("Config operation"),
option: z.string().optional().describe("Config key (dot-path for nested), for get/set"),
value: z.string().optional().describe("Value to set (required for `set`)"),
cwd: z.string().optional().describe("Working directory to run in"),
},
}, async ({ action, option, value, cwd }) => {
try {
return text(await config({ action, option, value, cwd }));
}
catch (e) {
return fail(e);
}
});
server.registerTool("logs", {
title: "Read or clean @imqueue fleet logs",
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).",
inputSchema: {
action: z.enum(["dump", "clean"]).optional().describe("dump = read current logs (default); clean = delete collected logs"),
services: z.string().optional().describe("Comma-separated service names; omit to combine all"),
prefix: z.boolean().optional().describe("Prefix each line with the service name (default true)"),
cwd: z.string().optional().describe("Working directory to run in"),
},
}, async ({ action, services, prefix, cwd }) => {
try {
return text(await logs({ action, services, prefix, cwd }));
}
catch (e) {
return fail(e);
}
});
async function main() {

@@ -116,0 +246,0 @@ const transport = new StdioServerTransport();

+1
-1

@@ -1,1 +0,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,EAA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,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"}
{
"name": "@imqueue/mcp",
"version": "1.0.1",
"version": "1.1.0",
"description": "Model Context Protocol server for @imqueue — lets AI coding agents search the docs and scaffold typed services & clients.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -12,5 +12,22 @@ # @imqueue/mcp

| `list_packages` | List the main @imqueue packages with install commands. |
| `scaffold_service` | Generate an `IMQService` subclass with `@expose()`d, JSDoc-typed methods + a bootstrap. |
| `scaffold_client` | Show how to generate and use the fully-typed client for a service. |
| `scaffold_service` | Generate an `IMQService` subclass with `@expose()`d, JSDoc-typed methods + a bootstrap (offline, no CLI needed). |
| `scaffold_client` | Show how to generate and use the fully-typed client for a service (offline). |
### CLI-backed tools (require `@imqueue/cli` on PATH)
When the `imq` CLI is installed locally, these drive the **real** CLI:
| Tool | What it does |
|---|---|
| `cli_status` | Detect `imq` and report its version. |
| `cli_install` | Install `@imqueue/cli` globally (`npm i -g @imqueue/cli`) when it's missing. |
| `cli_help` | `imq <command> --help` — exact, version-accurate flags (no side effects). |
| `create_service` | `imq service create` — **dry-run by default** (writes nothing); pass `apply: true` to actually create the project. |
| `generate_client` | `imq client generate <Service>` — the real typed client (the service must be running). |
| `fleet` | `imq ctl <start\|stop\|restart\|status>` — manage a directory of service repos. `status` is read-only. |
| `config` | `imq config <check\|get\|set\|init>` — read/write CLI configuration (`set` for automation; `init` is interactive). |
| `logs` | `imq log` — `dump` current fleet logs (never follows; capped) or `clean` them. |
Calls run with stdin closed and a timeout, so a missing-flag prompt fails fast instead of hanging. If `imq` isn't installed, run `cli_install` or use the offline `scaffold_*` tools.
Docs are fetched live from imqueue.org's machine-readable feeds (`/llms.txt`, per-page `…/index.md` mirrors), so the server never ships stale content. It only ever fetches `imqueue.org`.

@@ -17,0 +34,0 @@

+24
-2

@@ -12,6 +12,10 @@ # @imqueue/mcp — design spec

Two capabilities, five tools:
Three capabilities, thirteen tools:
- **Docs access** — `search_docs`, `get_doc`, `list_packages`
- **Scaffolding** — `scaffold_service`, `scaffold_client`
- **Offline scaffolding** — `scaffold_service`, `scaffold_client` (templates, no deps)
- **CLI bridge** — `cli_status`, `cli_install`, `cli_help`, `create_service`,
`generate_client`, `fleet` (`imq ctl`), `config` (`imq config`), `logs` (`imq log`)
(drive the installed `imq` binary — install it, create projects, generate clients,
manage the local fleet and CLI configuration)

@@ -71,2 +75,20 @@ ## 2. Architecture

### CLI bridge — `cli_status`, `cli_help`, `create_service`, `generate_client`
The server runs locally, so when `@imqueue/cli` is on PATH it can drive the **real**
`imq` (see `src/cli.ts`). Safety posture:
- Every call runs `imq` with **stdin closed and a timeout**, so an interactive prompt
(a missing flag) fails fast with guidance rather than hanging the server.
- `create_service` runs `imq service create … --dry-run` **by default** (writes
nothing); a real run requires an explicit `apply: true` — an agent must never
create repos / push to remotes silently. `cli_help` surfaces the exact flags to
pass so the run is non-interactive.
- `generate_client` runs `imq client generate` (the service must be running).
- `cli_install` runs `npm install -g @imqueue/cli` to bootstrap the CLI when absent.
- `fleet` wraps `imq ctl <start|stop|restart|status>` (status is read-only; the
others change running processes).
- `config` wraps `imq config <check|get|set|init>` (get/check read-only; set writes a
single value; init is interactive so automation should prefer set).
- If `imq` is absent, the tools return an install hint and the offline `scaffold_*`
tools remain available.
## 4. Input schemas (zod)

@@ -73,0 +95,0 @@