npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pandysp/claude-code-mcp

v2.2.0

Published

MCP server that runs Claude Code as a tool with session continuity

Readme

Claude Code MCP Server

npm CI

MCP server that runs Claude Code as a tool -- with session continuity.

Provides two tools via the Model Context Protocol:

  • claude_code -- Run Claude Code in one-shot mode with any prompt
  • claude_code_reply -- Continue a previous conversation by thread ID

Both tools parse structured JSON output from the CLI, returning session_id for threading and is_error for error detection. A 30-minute execution timeout prevents runaway processes.

Quick Start

npx @pandysp/claude-code-mcp@latest

Requires Node.js 20+ and the Claude CLI installed locally.

First-time setup

Accept the CLI permissions once before the MCP server can use them:

npm install -g @anthropic-ai/claude-code
claude --dangerously-skip-permissions

Configuration

Add to your MCP client config:

Claude Desktop / Cursor

{
  "mcpServers": {
    "claude-code-mcp": {
      "command": "npx",
      "args": ["-y", "@pandysp/claude-code-mcp@latest"]
    }
  }
}

Windsurf

{
  "mcpServers": {
    "claude-code-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@pandysp/claude-code-mcp@latest"]
    }
  }
}

OpenClaw (Docker)

When running inside a Docker container (e.g., as an OpenClaw MCP adapter server), use the container's node binary directly instead of npx:

{
  "command": "node",
  "args": ["/path/to/dist/server.js"]
}

Tools Reference

claude_code

Run Claude Code with a one-shot prompt.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | prompt | string | yes | The prompt to send to Claude Code | | workFolder | string | no | Absolute path to the working directory |

Returns the CLI result text. If the CLI outputs JSON with a session_id, the response includes structuredContent.threadId for use with claude_code_reply.

claude_code_reply

Continue a previous Claude Code conversation.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | threadId | string | yes | Session ID from a previous call | | prompt | string | yes | Follow-up prompt | | workFolder | string | no | Should match the original call's working directory |

Uses --resume <threadId> under the hood to maintain conversation context.

Environment Variables

| Variable | Default | Description | |----------|---------|-------------| | CLAUDE_CLI_NAME | claude | Override the CLI binary name or absolute path | | MCP_CLAUDE_DEBUG | false | Enable verbose debug logging to stderr |

CLAUDE_CLI_NAME supports simple names (looked up in PATH) or absolute paths. Relative paths are rejected.

Development

npm install
npm run build
npm run test:unit    # 100 unit tests, fully mocked
npm run dev          # dev mode with tsx

Attribution

Originally forked from @steipete/claude-code-mcp.

License

MIT