config
View npm configuration settings to check current package management setup. Use list to see all configs or get to retrieve specific key values.
Instructions
View npm configuration (read-only for safety)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action: list (show all config), get (get specific key) | |
| key | No | Config key to get (required for get action) |
Implementation Reference
- src/index.ts:931-953 (handler)Implementation of the "config" tool handler.
// ── npm config ── server.tool( "config", "View npm configuration (read-only for safety)", { action: z.enum(["list", "get"]).describe("Action: list (show all config), get (get specific key)"), key: z.string().optional().describe("Config key to get (required for get action)"), }, async ({ action, key }) => { const args = ["config", action]; if (action === "get" && key) args.push(key); if (action === "list") args.push("--json"); 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, }; } }, );