NPM Plus Documentation

Comprehensive guide to using the NPM Plus MCP server for advanced JavaScript package management in AI editors.

What is NPM Plus?

NPM Plus is a Model Context Protocol (MCP) server that provides powerful JavaScript package management capabilities directly within AI-powered editors like Claude, Windsurf, VS Code, and Cursor.

🚀 Quick Facts

  • 15+ Tools for comprehensive package management
  • Multi-Package Manager support (NPM, Yarn, pnpm)
  • Security-First with vulnerability scanning
  • Performance Analysis with bundle size checking
  • Global Hosting at api.npmplus.dev

Installation

NPM Plus can be used in two ways: via NPX (recommended for best performance) or as a hosted service. Simply add the configuration to your AI editor.

NPX Installation (Recommended)

Use NPX to automatically install and run the latest version:

{
  "mcpServers": {
    "npmplus-mcp": {
      "command": "npx",
      "args": ["-y", "npmplus-mcp-server"]
    }
  }
}

Hosted Service

Use our globally hosted MCP server (rate limited):

{
  "mcpServers": {
    "npmplus-mcp": {
      "serverUrl": "https://api.npmplus.dev/mcp"
    }
  }
}

Self-Hosting

If you prefer to host your own instance:

# Clone the repository
git clone https://github.com/shacharsol/js-package-manager-mcp.git
cd js-package-manager-mcp

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm start

Configuration

Configure NPM Plus in your AI editor by adding the MCP server configuration.

Configuration Location

Editor Configuration File Location
Claude Desktop claude_desktop_config.json macOS: ~/Library/Application Support/Claude/
Windows: %APPDATA%\Claude\
Windsurf .windsurfrc or mcp_config.json Project root directory
.windsurfrc: NPX install
mcp_config.json: HTTP transport
Cursor .cursorrules or settings Project root or global settings

Environment Variables

For self-hosted instances, you can configure the following environment variables:

# Port configuration
PORT=3000

# Cache settings
CACHE_TTL=300

# Rate limiting
RATE_LIMIT_REQUESTS=1000
RATE_LIMIT_WINDOW=3600

Editor Setup

Detailed setup instructions for each supported editor.

Claude Desktop Setup

Step 1: Locate Configuration File

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Step 2: Add Configuration

Open the file in a text editor and add:

{
  "mcpServers": {
    "npmplus-mcp": {
      "command": "npx",
      "args": ["-y", "npmplus-mcp-server"]
    }
  }
}

Step 3: Restart Claude Desktop

Close and reopen Claude Desktop to load the new configuration.

Step 4: Test

Ask Claude: "Search for React testing libraries"

Windsurf Setup

Method 1: NPX Installation (Recommended)

In your project root directory, create a .windsurfrc file:

{
  "mcp": {
    "servers": {
      "npmplus-mcp": {
        "command": "npx",
        "args": ["-y", "npmplus-mcp-server"],
        "disabled": false
      }
    }
  }
}

Method 2: HTTP Transport

In your project root directory, create a mcp_config.json file:

{
  "mcpServers": {
    "npmplus-mcp": {
      "serverUrl": "https://api.npmplus.dev/mcp"
    }
  }
}

Step 2: Reload Windsurf

Restart Windsurf or reload the window. The MCP server will be automatically loaded.

Step 3: Test

Use the AI chat and ask: "Install express and cors packages"

💡 Configuration Options

NPX Method (.windsurfrc): Local execution with command/args - full features, no rate limits, better performance (recommended)

HTTP Transport (mcp_config.json): Hosted service with serverUrl - quick setup, rate limited, network dependent

Cursor Setup

Method 1: MCP Settings

  1. Go to Cursor → Settings → Extensions
  2. Look for MCP or Model Context Protocol settings
  3. Add the server configuration
  4. Restart Cursor

NPX Version (Recommended)

{
  "mcpServers": {
    "npmplus-mcp": {
      "command": "npx",
      "args": ["-y", "npmplus-mcp-server"]
    }
  }
}

⚠️ HTTP Transport (Not Recommended for Cursor)

❌ Known Issues with HTTP Transport in Cursor:
• Frequently causes "Loading tools" errors
• Connection timeouts and instability
• Reduced functionality and reliability
Cursor users should stick with NPX method only
{
  "mcpServers": {
    "npmplus-mcp": {
      "serverUrl": "https://api.npmplus.dev/mcp"
    }
  }
}

Method 2: .cursorrules File

Create a .cursorrules file in your project root:

# NPM Plus MCP Server Configuration

This project uses the NPM Plus MCP server for package management.

IMPORTANT FOR CURSOR: Use NPX method ONLY!
HTTP transport causes "Loading tools" errors in Cursor.

Configuration: {"command": "npx", "args": ["-y", "npmplus-mcp-server"]}

Available commands:
- Search for packages
- Install/update/remove packages  
- Security auditing
- Bundle size analysis
- Dependency management

Ask me about JavaScript packages and I'll use the MCP server to help!

Step 3: Test

Ask Cursor: "What's the bundle size of lodash?"

Cline Extension Setup (Complete Guide)

📋 Prerequisites

  • VS Code version 1.102 or later (for full MCP support)
  • Node.js installed on your system
  • Cline extension by saoudrizwan from VS Code marketplace

Step 1: Install Cline Extension

  1. Open VS Code
  2. Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
  3. Search for "Cline" by saoudrizwan
  4. Click Install

Step 2: Configure AI Model

Visit app.cline.bot to set up your AI model provider.

Step 3: Setup NPM Plus MCP Server

Method 1: Automatic Setup (Recommended)

In Cline chat, simply ask:

"add a tool for JavaScript package management using npmplus-mcp-server"

Cline will automatically configure the MCP server for you!

Method 2: Manual Cline Configuration
  1. In Cline interface: Click "MCP Servers" → "Configure MCP Servers"
  2. Add to cline_mcp_settings.json:
{
  "mcpServers": {
    "npmplus-mcp": {
      "command": "npx",
      "args": ["-y", "npmplus-mcp-server"]
    }
  }
}
Method 3: VS Code Native MCP (Advanced)

For VS Code 1.102+ with native MCP support:

  • Create .vscode/mcp.json in your project root
  • Use Command Palette: "MCP: Add Server"
  • Use the same JSON configuration as above

Step 4: Usage

Natural Language (Agent Mode)

Tools appear automatically when Cline detects package management needs:

"Search for React testing libraries"
"Check security vulnerabilities in my project"
"What's the bundle size of lodash?"
Explicit Tool Usage

For direct tool invocation:

"Use npmplus-mcp to search for react packages"
"With NPM Plus, audit my dependencies"
"@npmplus-mcp find testing libraries"

Step 5: Troubleshooting

Common Issues & Solutions
  • Server not appearing: Check Cline's "Installed" servers tab for status
  • Connection issues: Use restart button next to MCP server entry
  • No tool output: Click "Show Output" to view server logs
  • Timeout errors: Adjust timeout settings (30 seconds to 1 hour)
  • NPX not found: Ensure Node.js and npm are properly installed
Security Notes
  • MCP servers run with your local user permissions
  • Only install MCP servers from trusted sources
  • Review server configuration before enabling
  • NPM Plus only accesses npm registry and package.json files
Test Your Setup

Try this quick test: "Show me popular authentication libraries"

You should see Cline automatically use the npmplus-mcp tools to search and display results.

VS Code Native MCP Setup

📋 Requirements

  • VS Code version 1.102 or later
  • Node.js installed on your system
  • Native MCP support or compatible extension

Method 1: Using Command Palette (Recommended)

  1. Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
  2. Search for "MCP: Add Server"
  3. Follow the prompts to add NPM Plus server
  4. Use this configuration:
{
  "command": "npx",
  "args": ["-y", "npmplus-mcp-server"]
}

Method 2: Manual Configuration File

Create .vscode/mcp.json in your project root:

{
  "mcpServers": {
    "npmplus-mcp": {
      "command": "npx",
      "args": ["-y", "npmplus-mcp-server"]
    }
  }
}

Method 3: Global Settings

Add to your VS Code settings.json:

{
  "mcp.servers": {
    "npmplus-mcp": {
      "command": "npx",
      "args": ["-y", "npmplus-mcp-server"]
    }
  }
}

Step 3: Reload VS Code

Reload the window (Ctrl+R / Cmd+R) or restart VS Code to activate the MCP server.

Step 4: Verify Setup

Check VS Code's output panel for MCP server status. Look for:

  • MCP server initialization messages
  • NPM Plus connection confirmation
  • Available tools list

Usage with AI Extensions

NPM Plus works with any VS Code AI extension that supports MCP:

  • Cline: Use "@npmplus-mcp" prefix
  • Continue: Natural language queries
  • GitHub Copilot Chat: Ask about packages
  • Other MCP-compatible extensions
⚠️ Important Notes
  • Native MCP support is still evolving in VS Code
  • Some features may require specific extensions
  • For the best experience, consider using Cline extension
  • Check VS Code marketplace for latest MCP-compatible tools
Test Your Setup

Try asking any MCP-compatible AI extension: "What's the latest version of React?"

The extension should use NPM Plus to provide real-time package information.

Tools Reference

Complete reference for all available NPM Plus tools.

🔍 Search & Discovery

search_packages

Search the npm registry for packages with advanced filtering options.

Parameters:
  • query (string, required) - Search query
  • limit (number, optional) - Maximum results (1-100, default: 25)
  • from (number, optional) - Offset for pagination (default: 0)
Example:
"Search for React testing libraries with limit 10"

package_info

Get detailed information about a specific package.

Parameters:
  • packageName (string, required) - Package name
  • version (string, optional) - Specific version

📦 Package Management

install_packages

Install npm packages in a project.

Parameters:
  • packages (array, required) - Package names
  • cwd (string, optional) - Working directory
  • dev (boolean, optional) - Install as dev dependencies
  • global (boolean, optional) - Install globally

update_packages

Update packages to their latest versions.

Parameters:
  • packages (array, optional) - Specific packages to update
  • cwd (string, optional) - Working directory

🔒 Security & Auditing

audit_dependencies

Audit project dependencies for security vulnerabilities.

Parameters:
  • cwd (string, optional) - Working directory
  • fix (boolean, optional) - Attempt to fix vulnerabilities
  • force (boolean, optional) - Force fixes including breaking changes
  • production (boolean, optional) - Only audit production dependencies

Examples

Common usage patterns and examples.

Basic Package Management

Search and Install a Package

User: "Search for React testing libraries and install the most popular one as a dev dependency"

AI Response: The AI will use search_packages to find React testing libraries, then use install_packages with the dev: true option.

Security Auditing

Check for Vulnerabilities

User: "Audit my project dependencies for security issues"

AI Response: The AI will use audit_dependencies to scan for vulnerabilities and provide a detailed report.

Performance Analysis

Analyze Bundle Size

User: "Check the bundle size of lodash and suggest lighter alternatives"

AI Response: The AI will use check_bundle_size and potentially search_packages to find lighter alternatives.

Troubleshooting

Common issues and solutions.

Connection Issues

MCP Server Not Found

Problem: Editor cannot connect to NPM Plus MCP server

Solution:

  • Verify the configuration file is in the correct location
  • For Windsurf HTTP transport: Use mcp_config.json with "serverUrl": "https://api.npmplus.dev/mcp"
  • For Windsurf NPX: Use .windsurfrc with "command": "npx" and "args": ["-y", "npmplus-mcp-server"]
  • For Cursor: Use NPX method ONLY - HTTP transport causes connection issues
  • For other editors: Use appropriate config format with "serverUrl": "https://api.npmplus.dev/mcp" for HTTP transport
  • Restart your editor after adding the configuration
  • Check your internet connection (HTTP transport only)

Cursor "Loading tools" Error

Problem: Cursor shows "Loading tools" indefinitely or fails to load MCP tools

Solution:

  • Switch to NPX method immediately - HTTP transport is known to cause this issue
  • Remove any HTTP transport configuration (serverUrl)
  • Use the recommended NPX configuration: {"command": "npx", "args": ["-y", "npmplus-mcp-server"]}
  • Restart Cursor completely after changing configuration
  • Verify NPX is installed and working: npx --version
✅ Why NPX works better for Cursor: Local execution eliminates network issues and provides more stable MCP connections.

Cline Extension Issues

Problem: Cline doesn't recognize or use NPM Plus MCP server

Solution:

  • Check MCP server status: Look in Cline's "Installed" or "MCP Servers" tab
  • Restart MCP server: Click the restart button next to npmplus-mcp entry
  • View server logs: Click "Show Output" to see detailed error messages
  • Verify configuration: Ensure cline_mcp_settings.json has correct syntax
  • Try automatic setup: Ask Cline to "add a tool for JavaScript package management"
  • Check VS Code version: Ensure you have VS Code 1.102+ for full MCP support
  • Restart VS Code: Completely close and reopen VS Code
💡 Cline-specific tips:
  • Use explicit prompts: "Use npmplus-mcp to search for packages"
  • Agent mode works better for automatic tool detection
  • Try "@npmplus-mcp" prefix for direct tool invocation

Rate Limiting

Too Many Requests Error

Problem: Receiving rate limit errors

Solution:

  • Wait a few minutes before making more requests
  • Consider self-hosting for higher limits
  • Use more specific queries to reduce API calls

Package Manager Detection

Wrong Package Manager Used

Problem: NPM Plus is using the wrong package manager

Solution:

  • Ensure the correct lock file exists (package-lock.json, yarn.lock, pnpm-lock.yaml)
  • Add a packageManager field to your package.json
  • Use the cwd parameter to specify the correct directory

API Reference

Direct API endpoints for advanced usage.

Base URL

https://api.npmplus.dev

Endpoints

GET /health

Health check endpoint

{
  "status": "healthy",
  "service": "npm-plus",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

POST /mcp

Main MCP protocol endpoint

Headers:

  • Content-Type: application/json

Body: MCP protocol messages

Rate Limits

  • Requests: 1000 per hour per IP
  • Concurrent: 5 simultaneous requests
  • Timeout: 30 seconds per request