dist-tag
Manage npm package distribution tags to organize versions, control releases, and define aliases for specific package versions.
Instructions
Manage distribution tags
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform | |
| package | Yes | Package name (for add: pkg@version) | |
| tag | No | Tag name (required for add/rm) |
Implementation Reference
- src/index.ts:233-254 (handler)The implementation of the 'dist-tag' tool using the MCP server tool registration, handling distribution tag management for npm packages.
server.tool( "dist-tag", "Manage distribution tags", { action: z.enum(["ls", "add", "rm"]).describe("Action to perform"), package: z.string().describe("Package name (for add: pkg@version)"), tag: z.string().optional().describe("Tag name (required for add/rm)"), }, async ({ action, package: pkg, tag }) => { const args = ["dist-tag", action, pkg]; if (tag && (action === "add" || action === "rm")) args.push(tag); try { const { stdout } = await run(args); return { content: [{ type: "text", text: stdout }] }; } catch (e: any) { return { content: [{ type: "text", text: `Error: ${e.stderr || e.message}` }], isError: true, }; } }, );