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

@wpgaurav/wp-mcp

v0.1.8

Published

WordPress MCP Server — expose any WordPress site's REST API as MCP tools with auto-discovery of custom plugin endpoints

Readme

wp-mcp

A TypeScript MCP server that exposes any WordPress site's REST API as MCP tools. Hand-crafted tools for core endpoints plus auto-discovery of custom plugin endpoints (WooCommerce, ACF, Yoast, any plugin).

Features

  • 37 core tools for posts, pages, media, categories, tags, comments, plugins, themes, users, settings, menus, search, and site health
  • Auto-discovery engine that scans /wp-json/ and generates tools for any plugin's REST API endpoints
  • Both transports: stdio (default for Claude Code/Desktop) and HTTP (StreamableHTTP)
  • Re-scan on demand via wp_discover_routes after installing new plugins
  • Single site, Basic Auth via Application Passwords

Prerequisites

Quick Start

npx @wpgaurav/wp-mcp setup

This interactive wizard will:

  1. Ask for your WordPress URL, username, and Application Password
  2. Test the connection
  3. Write the config to Claude Desktop and/or Claude Code automatically

That's it. Restart Claude and your WordPress tools are ready.

Manual Installation

# Run directly with npx
npx @wpgaurav/wp-mcp

# Or install globally
npm install -g @wpgaurav/wp-mcp

Configuration

Set environment variables:

| Variable | Required | Default | Description | |----------|----------|---------|-------------| | WP_URL | Yes | — | WordPress site URL (no trailing slash) | | WP_USERNAME | Yes | — | WordPress username | | WP_APP_PASSWORD | Yes | — | Application Password | | WP_MCP_TRANSPORT | No | stdio | stdio or http | | WP_MCP_PORT | No | 3000 | HTTP transport port | | WP_MCP_HOST | No | 127.0.0.1 | HTTP transport bind address | | WP_MCP_DISCOVER | No | true | Auto-discover custom endpoints | | WP_MCP_MAX_TOOLS | No | 128 | Maximum total tools (core + discovered) |

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "wordpress": {
      "command": "npx",
      "args": ["@wpgaurav/wp-mcp"],
      "env": {
        "WP_URL": "https://example.com",
        "WP_USERNAME": "admin",
        "WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx"
      }
    }
  }
}

Claude Code

{
  "mcpServers": {
    "wordpress": {
      "command": "npx",
      "args": ["@wpgaurav/wp-mcp"],
      "env": {
        "WP_URL": "https://example.com",
        "WP_USERNAME": "admin",
        "WP_APP_PASSWORD": "xxxx xxxx xxxx xxxx"
      }
    }
  }
}

HTTP Transport

WP_URL=https://example.com \
WP_USERNAME=admin \
WP_APP_PASSWORD="xxxx xxxx xxxx xxxx" \
WP_MCP_TRANSPORT=http \
npx @wpgaurav/wp-mcp

The server listens on http://127.0.0.1:3000/mcp with StreamableHTTP.

Core Tools

Content (Tier 1)

| Tool | Description | |------|-------------| | wp_posts_list | List posts with filtering and pagination | | wp_posts_get | Get a single post by ID | | wp_posts_create | Create a new post | | wp_posts_update | Update an existing post | | wp_posts_delete | Delete a post | | wp_pages_list | List pages | | wp_pages_get | Get a single page by ID | | wp_pages_create | Create a new page | | wp_pages_update | Update an existing page | | wp_pages_delete | Delete a page | | wp_media_list | List media library items | | wp_media_get | Get a media item by ID | | wp_media_upload | Upload media from a URL | | wp_media_delete | Delete a media item | | wp_categories_list | List categories | | wp_categories_create | Create a category | | wp_tags_list | List tags | | wp_tags_create | Create a tag | | wp_comments_list | List comments | | wp_comments_create | Create a comment |

Management (Tier 2)

| Tool | Description | |------|-------------| | wp_plugins_list | List installed plugins | | wp_plugins_get | Get plugin details | | wp_plugins_activate | Activate a plugin | | wp_plugins_deactivate | Deactivate a plugin | | wp_themes_list | List installed themes | | wp_themes_activate | Activate a theme | | wp_users_list | List users | | wp_users_get | Get a user by ID | | wp_users_create | Create a new user | | wp_users_me | Get the authenticated user | | wp_settings_get | Get site settings | | wp_settings_update | Update site settings |

Advanced (Tier 3)

| Tool | Description | |------|-------------| | wp_menus_list | List navigation menus | | wp_menu_items_list | List menu items | | wp_search | Search across all content | | wp_site_health | Get site health status |

Meta

| Tool | Description | |------|-------------| | wp_discover_routes | Re-scan the site for new REST API endpoints |

Auto-Discovery

On startup (when WP_MCP_DISCOVER=true), the server fetches /wp-json/ and automatically generates MCP tools for every custom plugin endpoint it finds. Core wp/v2 routes are skipped since they're already covered by hand-crafted tools.

Example: WooCommerce

If WooCommerce is installed, these tools appear automatically:

| Tool | Endpoint | |------|----------| | wc_products_list | GET /wc/v3/products | | wc_products_get | GET /wc/v3/products/{id} | | wc_products_create | POST /wc/v3/products | | wc_orders_list | GET /wc/v3/orders | | wc_orders_notes_list | GET /wc/v3/orders/{id}/notes |

Naming Convention

{namespace_prefix}_{resource}_{action}

GET  /wc/v3/products          -> wc_products_list
GET  /wc/v3/products/{id}     -> wc_products_get
POST /wc/v3/products          -> wc_products_create
GET  /acf/v1/posts/{id}       -> acf_posts_get
GET  /yoast/v1/indexables     -> yoast_indexables_list

Re-scanning After Plugin Install

Use the wp_discover_routes tool to re-scan the site after installing or activating a new plugin:

wp_discover_routes({ namespace_filter: "wc/v3" })

Development

git clone https://github.com/wpgaurav/wp-mcp.git
cd wp-mcp
npm install
npm run typecheck
npm test
npm run build

Library Usage

import { createWpMcpServer, loadConfig } from "@wpgaurav/wp-mcp";

const config = loadConfig({
  wpUrl: "https://example.com",
  wpUsername: "admin",
  wpAppPassword: "xxxx xxxx xxxx xxxx",
});

const { server, client, registry } = await createWpMcpServer(config);

License

MIT