Labsco
AiondaDotCom logo

MCP WordPress Server

from AiondaDotCom

A server for integrating with the WordPress REST API.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedAccount requiredAdvanced setup

MCP WordPress Server

A comprehensive Model Context Protocol (MCP) server for WordPress management through the WordPress REST API v2. Completely written in TypeScript for maximum type safety and better developer experience.

๐Ÿš€ Features

  • 54 WordPress Management Tools across 8 categories
  • 100% TypeScript - Complete type safety and IntelliSense
  • Modern ES Modules - Optimized for performance
  • Interactive Setup Wizard - Easy configuration
  • Comprehensive Testing - Complete test suite
  • Flexible Authentication - Supports App Passwords, JWT, Basic Auth
  • Debug & Monitoring - Structured logging and error tracking

๐Ÿ›  Build System

TypeScript Build

# Compile
npm run build

# Watch mode
npm run build:watch

# Type checking
npm run typecheck

Development

# Development mode with debug output
npm run dev

# Check status
npm run status

# Re-run setup
npm run setup

๐Ÿ” Authentication

  1. WordPress Admin โ†’ Users โ†’ Profile
  2. Scroll to Application Passwords
  3. Enter name (e.g., "MCP WordPress Server")
  4. Click Add New Application Password
  5. Copy generated password (format: xxxx xxxx xxxx xxxx xxxx xxxx)

Alternative Authentication Methods

# JWT Authentication (requires JWT plugin)
WORDPRESS_AUTH_METHOD=jwt
WORDPRESS_JWT_SECRET=your-jwt-secret

# Basic Authentication (not recommended for production)
WORDPRESS_AUTH_METHOD=basic
WORDPRESS_PASSWORD=your-actual-password

# API Key Authentication (requires API Key plugin)
WORDPRESS_AUTH_METHOD=api-key
WORDPRESS_API_KEY=your-api-key

๐Ÿ“‹ Available Tools (54 Tools)

๐Ÿ“ Posts (6 Tools)

  • wp_list_posts - List and filter blog posts
  • wp_get_post - Get specific post
  • wp_create_post - Create new posts
  • wp_update_post - Edit posts
  • wp_delete_post - Delete posts
  • wp_get_post_revisions - Get post revisions

๐Ÿ“„ Pages (6 Tools)

  • wp_list_pages - List pages
  • wp_get_page - Get specific page
  • wp_create_page - Create new pages
  • wp_update_page - Edit pages
  • wp_delete_page - Delete pages
  • wp_get_page_revisions - Get page revisions

๐Ÿ–ผ๏ธ Media (6 Tools)

  • wp_list_media - Browse media library
  • wp_get_media - Get media details
  • wp_upload_media - Upload files
  • wp_update_media - Edit media metadata
  • wp_delete_media - Delete media
  • wp_get_media_sizes - Get available image sizes

๐Ÿ‘ฅ Users (6 Tools)

  • wp_list_users - List users
  • wp_get_user - Get user details
  • wp_create_user - Create new users
  • wp_update_user - Edit user profiles
  • wp_delete_user - Delete users
  • wp_get_current_user - Get current user

๐Ÿ’ฌ Comments (7 Tools)

  • wp_list_comments - List comments
  • wp_get_comment - Get comment details
  • wp_create_comment - Create new comments
  • wp_update_comment - Edit comments
  • wp_delete_comment - Delete comments
  • wp_approve_comment - Approve comments
  • wp_spam_comment - Mark comments as spam

๐Ÿท๏ธ Taxonomies (10 Tools)

  • wp_list_categories - List categories
  • wp_get_category - Get category details
  • wp_create_category - Create new categories
  • wp_update_category - Edit categories
  • wp_delete_category - Delete categories
  • wp_list_tags - List tags
  • wp_get_tag - Get tag details
  • wp_create_tag - Create new tags
  • wp_update_tag - Edit tags
  • wp_delete_tag - Delete tags

โš™๏ธ Site Management (7 Tools)

  • wp_get_site_settings - Get site settings
  • wp_update_site_settings - Update site settings
  • wp_get_site_stats - Get site statistics
  • wp_search_site - Site-wide search
  • wp_get_application_passwords - List app passwords
  • wp_create_application_password - Create new app passwords
  • wp_delete_application_password - Delete app passwords

๐Ÿ” Authentication (6 Tools)

  • wp_test_auth - Test authentication
  • wp_get_auth_status - Get authentication status
  • wp_start_oauth_flow - Start OAuth flow
  • wp_complete_oauth_flow - Complete OAuth flow
  • wp_refresh_oauth_token - Refresh OAuth token
  • wp_switch_auth_method - Switch authentication method

๐Ÿงช Testing

# Run all tests
npm test

# Tests with coverage
npm run test:coverage

# Quick tests
npm run test:fast

# MCP integration tests
npm run test:mcp

# Tool integration tests
npm run test:tools

# Tests in watch mode
npm run test:watch

๐Ÿ“Š Status & Monitoring

# Check connection status
npm run status

# Debug mode
DEBUG=true npm run dev

# Lint code
npm run lint

# Auto-fix linting errors
npm run lint:fix

๐Ÿ— Project Structure

mcp-wordpress/
โ”œโ”€โ”€ src/                     # TypeScript source code
โ”‚   โ”œโ”€โ”€ index.ts            # Main MCP server
โ”‚   โ”œโ”€โ”€ server.ts           # Server compatibility
โ”‚   โ”œโ”€โ”€ types/              # TypeScript definitions
โ”‚   โ”‚   โ”œโ”€โ”€ wordpress.ts    # WordPress API types
โ”‚   โ”‚   โ”œโ”€โ”€ mcp.ts         # MCP protocol types
โ”‚   โ”‚   โ”œโ”€โ”€ client.ts      # Client interface types
โ”‚   โ”‚   โ””โ”€โ”€ index.ts       # Type exports
โ”‚   โ”œโ”€โ”€ client/             # WordPress API client
โ”‚   โ”‚   โ”œโ”€โ”€ api.ts         # HTTP client
โ”‚   โ”‚   โ””โ”€โ”€ auth.ts        # Authentication
โ”‚   โ”œโ”€โ”€ tools/              # MCP tool implementations
โ”‚   โ”‚   โ”œโ”€โ”€ posts.ts       # Post management
โ”‚   โ”‚   โ”œโ”€โ”€ pages.ts       # Page management
โ”‚   โ”‚   โ”œโ”€โ”€ media.ts       # Media management
โ”‚   โ”‚   โ”œโ”€โ”€ users.ts       # User management
โ”‚   โ”‚   โ”œโ”€โ”€ comments.ts    # Comment management
โ”‚   โ”‚   โ”œโ”€โ”€ taxonomies.ts  # Categories/Tags
โ”‚   โ”‚   โ”œโ”€โ”€ site.ts        # Site settings
โ”‚   โ”‚   โ””โ”€โ”€ auth.ts        # Authentication
โ”‚   โ””โ”€โ”€ utils/              # Utility functions
โ”‚       โ””โ”€โ”€ debug.ts       # Debug logger
โ”œโ”€โ”€ dist/                   # Compiled JavaScript files
โ”œโ”€โ”€ bin/                    # Utility scripts
โ”‚   โ”œโ”€โ”€ setup.js          # Setup wizard
โ”‚   โ””โ”€โ”€ status.js          # Status checker
โ”œโ”€โ”€ tests/                  # Test suite
โ”œโ”€โ”€ scripts/                # Build and test scripts
โ”œโ”€โ”€ tsconfig.json          # TypeScript configuration
โ”œโ”€โ”€ jest.config.json       # Jest test configuration
โ””โ”€โ”€ package.json           # Node.js project configuration

๐Ÿ’ก TypeScript Features

  • Complete Type Safety - Compile-time validation
  • IntelliSense Support - Better IDE integration
  • Type-safe API Client - Typed HTTP methods
  • Comprehensive WordPress Types - 400+ lines of precise definitions
  • MCP Protocol Types - Tool definitions and handlers
  • Enhanced Error Handling - Typed exceptions
  • Source Maps - Debugging support

๐Ÿ“š API Documentation

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/new-feature
  3. Commit changes: git commit -m 'Add new feature'
  4. Push branch: git push origin feature/new-feature
  5. Create pull request

๐Ÿ“„ License

MIT License - see LICENSE file for details


๐Ÿš€ Powered by TypeScript for better development experience and type safety!