# npm_command

Run npm commands (install, test, build, etc)

Agent View of the PolicyLayer registry record for `npm_command`. HTML page: https://policylayer.com/tools/agentics-ai-code-mcp/npm-command

## Facts

- Tool: `npm_command`
- Server: Code MCP Server (`agentics-ai/code-mcp`) — https://policylayer.com/tools/agentics-ai-code-mcp.md
- Homepage: https://github.com/agentics-ai/code-mcp
- Risk category: Execute (High risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Rate-limited

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "npm_command",
    "arguments": {}
  }
}
```

## Why npm_command is rated High

npm commands trigger external operations whose effects depend on arguments. While 'test' and 'build' are relatively contained, 'install' modifies the project state by downloading and integrating dependencies. More critically, npm scripts can execute arbitrary shell commands defined in package.json, making this a code execution tool.

From the tool's own definition: "Tool description states 'Run npm commands' which are executable operations. npm commands can install packages (modifying dependencies), run scripts (arbitrary code execution), and build projects."

## Use case

AI agents invoke npm_command to trigger actions in Code MCP Server. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Code MCP Server:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "npm_command": {
      "limits": [
        {
          "counter": "npm_command_rate",
          "window": "minute",
          "max": 10,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Code MCP Server (72)

- `delete_file` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/delete-file.md
- `docker_cleanup` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/docker-cleanup.md
- `docker_containers` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/docker-containers.md
- `remove_allowed_command` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/remove-allowed-command.md
- `rollback_session` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/rollback-session.md
- `docker_build` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-build.md
- `docker_compose` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-compose.md
- `docker_images` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-images.md
- `docker_networks` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-networks.md
- `docker_run` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-run.md
- `docker_system` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-system.md
- `docker_volumes` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-volumes.md
- `git_push` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/git-push.md
- `install_dependencies` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/install-dependencies.md
- `pip_install` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/pip-install.md
- `run_command` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-command.md
- `run_custom_tool` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-custom-tool.md
- `run_javascript` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-javascript.md
- `run_python` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-python.md
- `run_tests` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-tests.md
- `secure_run_command` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/secure-run-command.md
- `secure_run_command_sequence` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/secure-run-command-sequence.md
- `start_coding_session` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/start-coding-session.md
- `start_server` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/start-server.md
- `stop_server` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/stop-server.md
- `end_coding_session` — Other — https://policylayer.com/tools/agentics-ai-code-mcp/end-coding-session.md
- `analyze_code` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/analyze-code.md
- `analyze_file_differences` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/analyze-file-differences.md
- `compare_commits` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/compare-commits.md
- `compare_files` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/compare-files.md
- …and 42 more: https://policylayer.com/tools/agentics-ai-code-mcp.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=agentics-ai-code-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/agentics-ai-code-mcp
