Skip to main content
Glama

link

Symlink local npm packages for development by connecting directory paths to package names, enabling real-time testing and iteration without publishing.

Instructions

Symlink a local package for development

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the package directory
packageNoPackage name to link (omit to link current dir globally)

Implementation Reference

  • Implementation of the "link" tool, which runs `npm link` in the specified directory, optionally linking a specific package.
    server.tool(
      "link",
      "Symlink a local package for development",
      {
        path: z.string().describe("Absolute path to the package directory"),
        package: z.string().optional().describe("Package name to link (omit to link current dir globally)"),
      },
      async ({ path, package: pkg }) => {
        const args = ["link"];
        if (pkg) args.push(pkg);
        try {
          const { stdout, stderr } = await run(args, path);
          return { content: [{ type: "text", text: stdout + stderr }] };
        } catch (e: any) {
          return {
            content: [{ type: "text", text: `Error: ${e.stderr || e.message}` }],
            isError: true,
          };
        }
      },
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mikusnuz/npm-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server