mcpField
M
Mcp Wordpress

Mcp Wordpress

ローカル
github.com/AiondaDotComビジネス・マーケティング071 週間前に更新

Mcp Wordpress について

Mcp Wordpressは、WordPress REST API v2を通じてサイトを管理するMCPサーバーです。AIアシスタントを使って運用するユーザー向けに、コンテンツやメディア、ユーザー、サイト設定を扱う54種類のツールと複数の認証方式を備えています。

主な機能

  1. 01投稿と固定ページの管理
  2. 02メディアの閲覧とアップロード
  3. 03ユーザー、コメント、タクソノミーの管理
  4. 04サイト設定の取得と更新
  5. 05アプリケーションパスワード、JWT、Basic Authに対応

活用シーン

  1. 01WordPressの投稿や固定ページの作成・編集
  2. 02メディアのアップロードと情報編集
  3. 03コメントへの対応とユーザー管理
  4. 04サイト統計の確認や設定変更

MCP 対応

WordPress REST API v2に接続し、MCPクライアントに54種類のWordPress管理ツールを公開します。

設定

ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。

mcp.json · 共通設定
{
"mcpServers": {
"wordpress-aiondadotcom": {
"command": "npx",
"args": [
"-y",
"@aiondadotcom/mcp-wordpress"
],
"env": {
"WORDPRESS_URL": "<WORDPRESS_URL>",
"WORDPRESS_USERNAME": "<WORDPRESS_USERNAME>",
"WORDPRESS_APP_PASSWORD": "<WORDPRESS_APP_PASSWORD>"
}
}
}
}
起動コマンドnpx -y @aiondadotcom/mcp-wordpress
設定が必要な環境変数
WORDPRESS_URL
WORDPRESS_USERNAME
WORDPRESS_APP_PASSWORDシークレット

ローカルサーバーにはマシン上の実行環境(Node.js 18 以上など)が必要です。設定ファイルの場所はクライアントごとに異なります。

パッケージ
npm@aiondadotcom/mcp-wordpress

ツール

ツール一覧はまだ取得されていません

ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。

詳細

MCP WordPress Server

WordPress REST API v2 を通じて WordPress を管理するための、包括的な Model Context Protocol(MCP)サーバーです。最大限の型安全性と優れた開発者エクスペリエンスを実現するため、TypeScript で完全に記述されています。

🚀 機能

  • 54 個の WordPress 管理ツール(8 カテゴリ)
  • 100% TypeScript — 完全な型安全性と IntelliSense
  • 最新の ES Modules — パフォーマンスを最適化
  • 対話型セットアップウィザード — 簡単に設定
  • 包括的なテスト — 完全なテストスイート
  • 柔軟な認証 — アプリケーションパスワード、JWT、Basic Auth に対応
  • デバッグとモニタリング — 構造化ログとエラー追跡

⚡ クイックスタート

オプション 1: NPX(推奨)

インストール不要で、最も簡単に始められます。

# Run directly with NPX
npx @aiondadotcom/mcp-wordpress

# Or install globally
npm install -g @aiondadotcom/mcp-wordpress
mcp-wordpress
オプション 2: ローカル開発
git clone https://github.com/AiondaDotCom/mcp-wordpress.git
cd mcp-wordpress
npm install
npm run setup
npm start
セットアップウィザード
# For NPX users
npx @aiondadotcom/mcp-wordpress setup

# For local installation
npm run setup

セットアップウィザードでは、次の手順をガイドします。

  • WordPress サイトの設定
  • 認証方法の選択
  • 接続テスト
  • Claude Desktop の設定

🚀 Claude Desktop による簡単セットアップ

とても簡単な NPX セットアップ

最も簡単にセットアップするには、このプロンプトを Claude Desktop に貼り付けてください。

Set up the MCP WordPress server using NPX for my Claude Desktop. 

My WordPress details:
- Site URL: [YOUR_WORDPRESS_URL]
- Username: [YOUR_USERNAME]

Please:
1. Help me create a WordPress Application Password
2. Configure my Claude Desktop mcp.json file with the NPX command
3. Test the connection to make sure everything works
4. Show me how to use the WordPress tools

I want to use the NPX version (@aiondadotcom/mcp-wordpress) so I don't need to install anything locally.
ローカル開発の完全セットアップ

ローカルでの開発やカスタマイズを行う場合:

Build and configure the MCP WordPress server project from https://github.com/AiondaDotCom/mcp-wordpress locally on my computer. 

Please:
1. Clone the repository to an appropriate directory
2. Install all dependencies 
3. Run the setup wizard and help me configure my WordPress connection
4. Test the connection to make sure everything works
5. Set up the Claude Desktop MCP configuration
6. Run a quick test to verify all tools are working

My WordPress site URL is: [YOUR_WORDPRESS_URL]
My WordPress username is: [YOUR_USERNAME]

Guide me through any steps that require manual input, and let me know if you need any additional information from me.

[YOUR_WORDPRESS_URL] と [YOUR_USERNAME] を実際の WordPress サイトの情報に置き換えるだけで、あとは Claude が処理します。

🔧 設定

環境変数(.env)
WORDPRESS_SITE_URL=https://your-wordpress-site.com
WORDPRESS_USERNAME=your-username
WORDPRESS_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
WORDPRESS_AUTH_METHOD=app-password
DEBUG=false
Claude Desktop との連携

Claude Desktop の mcp.json 設定ファイルで MCP WordPress Server を設定します。

オプション 1: NPX(推奨)
{
  "mcpServers": {
    "mcp-wordpress": {
      "command": "npx",
      "args": ["@aiondadotcom/mcp-wordpress"],
      "env": {
        "WORDPRESS_SITE_URL": "https://your-site.com",
        "WORDPRESS_USERNAME": "your-username", 
        "WORDPRESS_APP_PASSWORD": "your-app-password",
        "WORDPRESS_AUTH_METHOD": "app-password"
      }
    }
  }
}
オプション 2: グローバルインストール
{
  "mcpServers": {
    "mcp-wordpress": {
      "command": "mcp-wordpress",
      "env": {
        "WORDPRESS_SITE_URL": "https://your-site.com",
        "WORDPRESS_USERNAME": "your-username",
        "WORDPRESS_APP_PASSWORD": "your-app-password", 
        "WORDPRESS_AUTH_METHOD": "app-password"
      }
    }
  }
}
オプション 3: ローカル開発
{
  "mcpServers": {
    "mcp-wordpress": {
      "command": "node",
      "args": ["/path/to/mcp-wordpress/dist/index.js"],
      "env": {
        "WORDPRESS_SITE_URL": "https://your-site.com",
        "WORDPRESS_USERNAME": "your-username",
        "WORDPRESS_APP_PASSWORD": "your-app-password",
        "WORDPRESS_AUTH_METHOD": "app-password"
      }
    }
  }
}
.env ファイルを使用する場合(いずれのオプションでも使用可能)

設定ファイル内の環境変数ではなく、.env ファイルを使用する場合:

{
  "mcpServers": {
    "mcp-wordpress": {
      "command": "npx",
      "args": ["@aiondadotcom/mcp-wordpress"],
      "env": {
        "NODE_ENV": "production"
      }
    }
  }
}
Claude Desktop 設定ファイルの場所
  • macOS:~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows:%APPDATA%\Claude\claude_desktop_config.json
  • Linux:~/.config/Claude/claude_desktop_config.json
簡単な設定手順
  1. 上記のパスにある Claude Desktop 設定ファイルを作成するか、場所を確認します
  2. 上記のいずれかのオプションを使って MCP サーバーの設定を追加します
  3. 変更を反映するため、Claude Desktop を再起動します
  4. 接続を確認します — Claude Desktop で WordPress ツールが利用できることを確認してください
設定全体の例

以下は、MCP WordPress を含む claude_desktop_config.json ファイルの全体例です。

{
  "mcpServers": {
    "mcp-wordpress": {
      "command": "npx",
      "args": ["@aiondadotcom/mcp-wordpress"],
      "env": {
        "WORDPRESS_SITE_URL": "https://your-site.com",
        "WORDPRESS_USERNAME": "your-username",
        "WORDPRESS_APP_PASSWORD": "your-app-password",
        "WORDPRESS_AUTH_METHOD": "app-password"
      }
    }
  }
}

🛠 ビルドシステム

TypeScript のビルド
# Compile
npm run build

# Watch mode
npm run build:watch

# Type checking
npm run typecheck
開発
# Development mode with debug output
npm run dev

# Check status
npm run status

# Re-run setup
npm run setup

🔐 認証

WordPress アプリケーションパスワード(推奨)
  1. WordPress 管理画面 → ユーザー → プロフィール
  2. アプリケーションパスワードまでスクロールします
  3. 名前(例:「MCP WordPress Server」)を入力します
  4. 新しいアプリケーションパスワードを追加をクリックします
  5. 生成されたパスワードをコピーします(形式:xxxx xxxx xxxx xxxx xxxx xxxx)
その他の認証方法
# 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

📋 利用可能なツール(54 個)

📝 投稿(6 個のツール)
  • wp_list_posts - ブログ投稿の一覧表示と絞り込み
  • wp_get_post - 特定の投稿を取得
  • wp_create_post - 新しい投稿を作成
  • wp_update_post - 投稿を編集
  • wp_delete_post - 投稿を削除
  • wp_get_post_revisions - 投稿のリビジョンを取得
📄 固定ページ(6 個のツール)
  • wp_list_pages - 固定ページの一覧表示
  • wp_get_page - 特定の固定ページを取得
  • wp_create_page - 新しい固定ページを作成
  • wp_update_page - 固定ページを編集
  • wp_delete_page - 固定ページを削除
  • wp_get_page_revisions - 固定ページのリビジョンを取得
🖼️ メディア(6 個のツール)
  • wp_list_media - メディアライブラリを閲覧
  • wp_get_media - メディアの詳細を取得
  • wp_upload_media - ファイルをアップロード
  • wp_update_media - メディアのメタデータを編集
  • wp_delete_media - メディアを削除
  • wp_get_media_sizes - 利用可能な画像サイズを取得
👥 ユーザー(6 ツール)
  • wp_list_users - ユーザーの一覧表示
  • wp_get_user - ユーザーの詳細情報を取得
  • wp_create_user - ユーザーを新規作成
  • wp_update_user - ユーザープロフィールを編集
  • wp_delete_user - ユーザーを削除
  • wp_get_current_user - 現在のユーザーを取得
💬 コメント(7 ツール)
  • wp_list_comments - コメントの一覧表示
  • wp_get_comment - コメントの詳細情報を取得
  • wp_create_comment - コメントを新規作成
  • wp_update_comment - コメントを編集
  • wp_delete_comment - コメントを削除
  • wp_approve_comment - コメントを承認
  • wp_spam_comment - コメントをスパムとしてマーク
🏷️ タクソノミー(10 ツール)
  • wp_list_categories - カテゴリーの一覧表示
  • wp_get_category - カテゴリーの詳細情報を取得
  • wp_create_category - カテゴリーを新規作成
  • wp_update_category - カテゴリーを編集
  • wp_delete_category - カテゴリーを削除
  • wp_list_tags - タグの一覧表示
  • wp_get_tag - タグの詳細情報を取得
  • wp_create_tag - タグを新規作成
  • wp_update_tag - タグを編集
  • wp_delete_tag - タグを削除
⚙️ サイト管理(7 ツール)
  • wp_get_site_settings - サイト設定を取得
  • wp_update_site_settings - サイト設定を更新
  • wp_get_site_stats - サイトの統計情報を取得
  • wp_search_site - サイト全体を検索
  • wp_get_application_passwords - アプリケーションパスワードの一覧表示
  • wp_create_application_password - アプリケーションパスワードを新規作成
  • wp_delete_application_password - アプリケーションパスワードを削除
🔐 認証(6 ツール)
  • wp_test_auth - 認証をテスト
  • wp_get_auth_status - 認証状態を取得
  • wp_start_oauth_flow - OAuth フローを開始
  • wp_complete_oauth_flow - OAuth フローを完了
  • wp_refresh_oauth_token - OAuth トークンを更新
  • wp_switch_auth_method - 認証方法を切り替え

🧪 テスト

# 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

📊 ステータスとモニタリング

# 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

🏗 プロジェクト構成

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 の機能

  • 完全な型安全性 - コンパイル時の検証
  • IntelliSense のサポート - IDE との連携を強化
  • 型安全な API クライアント - 型付きの HTTP メソッド
  • 包括的な WordPress 型定義 - 正確な定義を 400 行以上収録
  • MCP プロトコルの型 - ツール定義とハンドラー
  • 強化されたエラー処理 - 型付き例外
  • ソースマップ - デバッグをサポート

🔧 WordPress の要件

  • REST API が有効な WordPress 5.0 以降
  • HTTPS(本番環境で推奨)
  • 適切な権限を持つユーザー
  • アプリケーションパスワードが有効(WordPress 5.6 以降)
WordPress のユーザーロール
ロールアクセス権
管理者すべての機能への完全なアクセス
編集者投稿、固定ページ、コメント、メディア
投稿者自分の投稿とメディア
寄稿者自分の投稿(下書きのみ)
購読者読み取り専用

🐛 トラブルシューティング

よくある問題
  1. 「WordPress に接続できません」

    • WORDPRESS_SITE_URL を確認してください
    • REST API にアクセスできることを確認してください
    • テスト:curl https://your-site.com/wp-json/wp/v2/
  2. 「認証に失敗しました」

    • ユーザー名とアプリケーションパスワードを確認してください
    • アプリケーションパスワードが有効になっていることを確認してください
    • npm run setup をもう一度実行してください
  3. 「TypeScript のコンパイルエラー」

    • npm run typecheck を実行してください
    • すべての依存関係がインストールされていることを確認してください
デバッグログ
DEBUG=true npm run dev

📚 API ドキュメント

🤝 コントリビューション

  1. リポジトリをフォークします
  2. 機能ブランチを作成します:git checkout -b feature/new-feature
  3. 変更をコミットします:git commit -m 'Add new feature'
  4. ブランチをプッシュします:git push origin feature/new-feature
  5. プルリクエストを作成します

📄 ライセンス

MIT License - 詳細は LICENSE ファイルを参照してください


🚀 TypeScript を採用し、開発体験と型安全性を向上!

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。