Skip to main content
Glama

install

Registers this MCP server into an IDE's configuration files for Claude, Cursor, Codex, Gemini, or Windsurf.

Instructions

Register this kit-mcp server into an IDE's MCP config (Claude/Cursor/Codex/Gemini/Windsurf).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYes
targetNoIDE id. Use action=targets to list.
scopeNoDefault: user
nameNoServer name in the IDE config. Default: kit
viaNoHow the IDE will invoke the server. Default: local (this clone)
pkgNonpm package name (only with via=npx). Default: @luanpdd/kit-mcp
forceNoOverwrite existing entry with same name
projectRootNo

Implementation Reference

  • Tool registration: 'install' tool is defined with name, description, and inputSchema (action, target, scope, name, via, pkg, force, projectRoot).
      {
        name: 'install',
        description: 'Register this kit-mcp server into an IDE\'s MCP config (Claude/Cursor/Codex/Gemini/Windsurf).',
        inputSchema: {
          type: 'object',
          properties: {
            action:      { type: 'string', enum: ['targets', 'install', 'dry-run'] },
            target:      { type: 'string', description: 'IDE id. Use action=targets to list.' },
            scope:       { type: 'string', enum: ['user', 'project'], description: 'Default: user' },
            name:        { type: 'string', description: 'Server name in the IDE config. Default: kit' },
            via:         { type: 'string', enum: ['local', 'npx', 'global'], description: 'How the IDE will invoke the server. Default: local (this clone)' },
            pkg:         { type: 'string', description: 'npm package name (only with via=npx). Default: @luanpdd/kit-mcp' },
            force:       { type: 'boolean', description: 'Overwrite existing entry with same name' },
            projectRoot: { type: 'string' },
          },
          required: ['action'],
        },
      },
    ];
  • Handler function 'handleInstall' dispatches by action: 'targets' calls listInstallTargets(), 'install' and 'dry-run' call installMcp() from install.js.
    async function handleInstall(args) {
      switch (args.action) {
        case 'targets':  return listInstallTargets();
        case 'install':  return installMcp(args.target, { scope: args.scope, name: args.name, via: args.via, pkg: args.pkg, force: args.force, projectRoot: args.projectRoot });
        case 'dry-run':  return installMcp(args.target, { scope: args.scope, name: args.name, via: args.via, pkg: args.pkg, force: args.force, projectRoot: args.projectRoot, dryRun: true });
        default: return { error: `Unknown action: ${args.action}` };
      }
    }
  • Core handler 'installMcp' resolves target config, builds server entry, resolves config path, then delegates to mergeJson() or appendToml() based on the target's strategy.
    export async function installMcp(targetId, opts = {}) {
      const target = getTarget(targetId);
      if (!target.mcpConfig) {
        return { ok: false, target: targetId, reason: `${target.label} has no MCP config integration in registry.` };
      }
    
      const scope   = opts.scope ?? 'user'; // 'user' | 'project'
      const name    = opts.name  ?? 'kit';
      const dryRun  = !!opts.dryRun;
      const force   = !!opts.force;
    
      const entry = buildServerEntry(opts);
      const configPath = resolveConfigPath(target.mcpConfig, scope, opts.projectRoot);
      if (!configPath) {
        return { ok: false, target: targetId, reason: `Could not resolve config path for scope=${scope}.` };
      }
    
      if (target.mcpConfig.strategy === 'merge-mcpServers-json') {
        return await mergeJson(configPath, target.mcpConfig.userKey ?? 'mcpServers', name, entry, { dryRun, force, target: targetId });
      }
      if (target.mcpConfig.strategy === 'append-toml-snippet') {
        return await appendToml(configPath, name, entry, { dryRun, force, target: targetId });
      }
      return { ok: false, target: targetId, reason: `Unknown strategy: ${target.mcpConfig.strategy}` };
    }
  • Helper 'buildServerEntry' constructs the command/args for the MCP server entry based on via mode (local, npx, or global).
    function buildServerEntry(opts) {
      // Three modes:
      //   via=local (default) — point at this clone's bin/mcp.js with the running node
      //   via=npx             — `npx -y @luanpdd/kit-mcp` (portable, works on any machine after publish)
      //   via=global          — `kit-mcp` (assumes user has `npm install -g @luanpdd/kit-mcp`)
      // Override anything with explicit --command / --args.
      const via = opts.via ?? 'local';
      let command, args;
    
      if (via === 'npx') {
        command = 'npx';
        args = ['-y', opts.pkg ?? '@luanpdd/kit-mcp'];
      } else if (via === 'global') {
        command = 'kit-mcp';
        args = [];
      } else {
        command = process.execPath;
        args = [path.join(REPO_ROOT, 'bin', 'mcp.js')];
      }
    
      return {
        command: opts.command ?? command,
        args:    opts.args    ?? args,
        env:     opts.env     ?? {},
      };
    }
  • Helper 'mergeJson' reads/parses a JSON config file, merges the MCP server entry under the specified key, and writes back (or returns a preview in dry-run mode).
    async function mergeJson(filePath, key, name, entry, { dryRun, force, target }) {
      let json = {};
      try {
        const raw = await fs.readFile(filePath, 'utf8');
        json = JSON.parse(raw);
      } catch (e) {
        if (e.code !== 'ENOENT') {
          return { ok: false, target, reason: `Failed to parse existing config at ${filePath}: ${e.message}` };
        }
      }
      json[key] ??= {};
      if (json[key][name] && !force) {
        return {
          ok: false, target, configPath: filePath,
          reason: `An MCP server named "${name}" already exists in ${filePath}. Re-run with --force to replace, or pass --name <other>.`,
        };
      }
      json[key][name] = entry;
    
      if (dryRun) {
        return { ok: true, target, configPath: filePath, dryRun: true, preview: json };
      }
      await fs.mkdir(path.dirname(filePath), { recursive: true });
      await fs.writeFile(filePath, JSON.stringify(json, null, 2) + '\n', 'utf8');
      return { ok: true, target, configPath: filePath, name, entry };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not disclose behavioral traits like file modifications, side effects (e.g., overwriting existing config), or necessary permissions. The presence of a 'force' parameter hints at overwrite behavior, but the description does not clarify it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence that is front-loaded with the core action and resource. It contains no filler and earns its place by concisely conveying the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the absence of annotations and an output schema, the description is too brief. It omits return values, error handling, prerequisites (e.g., existing IDE config), and the effect of different actions (install, dry-run, targets). The tool has 8 parameters, yet the description provides insufficient context for safe use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already covers 75% of parameters with descriptions and enums. The description adds minimal semantic value only by framing the operation as registration; it does not explain parameter details beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly specifies the verb 'Register' and the resource 'this kit-mcp server into an IDE's MCP config', listing supported IDEs (Claude/Cursor/Codex/Gemini/Windsurf). This distinguishes it from sibling tools which handle other server operations like forensics, gates, or sync.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description states what the tool does but provides no explicit guidance on when to use it versus alternatives, such as when to use a different tool for updating or removing config entries. It implicitly assumes the user wants to perform an initial installation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/luanpdd/kit-mcp'

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