Skip to main content
Glama
MT Content Refactor MCP Server

MT Content Refactor MCP Server

by bit-part

MT Content Refactor MCP Server

Movable Type の記事コンテンツを AI で一括変換するための MCP(Model Context Protocol)サーバーです。

Claude Desktop などの MCP 対応 AI クライアントから、MT Data API を通じて記事の HTML を一括で変換できます。

特徴

  • AI による柔軟な変換: 自然言語で変換ルールを指示するだけで、Claude が HTML を解析・変換

  • 安全なワークフロー: バックアップ → 変換 → 差分確認 → 適用の段階的プロセス

  • 差分レポート: 変更前後を比較できる HTML レポートを自動生成

  • ロールバック対応: いつでも元の状態に復元可能

  • セッション管理: 作業状態を保存し、後から再開可能

Related MCP server: WordPress MCP Server

使用例

あなた: サイト1の記事をバックアップして

Claude: 45件の記事をバックアップしました。セッション: 20251208_150000

あなた: 以下のルールで変換して:
        - <p> 内に画像がある場合、<figure class="m-media"> で囲む
        - テキストのみの <p> には class="m-text" を追加

Claude: 12件に変更が必要です。変換を実行しました。

あなた: 差分レポートを見せて

Claude: 差分レポートを生成しました: ~/.config/mt-content-refactor/backups/20251208_150000/diff-report.html

あなた: 問題なさそうなので適用して

Claude: 12件の変更を MT に反映しました。

必要環境

  • Node.js 18 以上

  • Movable Type 6 以上(Data API v4 対応)

  • MCP 対応 AI クライアント(Claude Desktop など)

インストール

# リポジトリをクローン
git clone https://github.com/bit-part/mt-content-refactor-mcp.git
cd mt-content-refactor-mcp

# 依存関係をインストール
npm install

# ビルド
npm run build

Claude Desktop への登録

~/Library/Application Support/Claude/claude_desktop_config.json に以下を追加:

{
  "mcpServers": {
    "mt-content-refactor": {
      "command": "node",
      "args": ["/path/to/mt-content-refactor-mcp/dist/index.js"]
    }
  }
}

Volta を使用している場合は、Node.js のフルパスを指定:

{
  "mcpServers": {
    "mt-content-refactor": {
      "command": "/Users/yourname/.volta/bin/node",
      "args": ["/path/to/mt-content-refactor-mcp/dist/index.js"]
    }
  }
}

設定後、Claude Desktop を再起動してください。

使い方

1. 接続先の登録

MT環境を追加して
endpoint: https://example.com/mt/mt-data-api.cgi
username: api-user
password: secret123

2. 接続先の選択

MT環境に接続して

3. サイト・記事の確認

サイト一覧を表示して
サイト1の記事一覧を見せて

4. バックアップの作成

サイト1の記事を全件バックアップして

5. 変換の実行

以下のルールで変換して:
1. <p> 内に <img> がある場合、<figure> で囲む
2. テキストのみの <p> には class="m-text" を追加

6. 差分の確認

差分レポートを生成して

生成された HTML ファイルをブラウザで開いて確認します。

7. 変更の適用

変更を適用して

8. 問題があった場合のロールバック

記事ID 123 を元に戻して

利用可能なツール

接続管理

ツール

説明

mt_list_connections

登録済み接続先の一覧

mt_add_connection

新しい接続先を追加

mt_use_connection

使用する接続先を選択

mt_remove_connection

接続先を削除

mt_test_connection

接続テスト

コンテンツ操作

ツール

説明

mt_list_sites

サイト一覧

mt_list_entries

記事一覧

mt_get_entry

記事詳細取得

mt_list_pages

ページ一覧

mt_get_page

ページ詳細取得

mt_list_content_types

コンテンツタイプ一覧

mt_list_content_data

コンテンツデータ一覧

mt_get_content_data

コンテンツデータ詳細取得

バックアップ・変換

ツール

説明

mt_create_backup

バックアップセッション作成

mt_get_backup_items

バックアップ内容取得

mt_set_transform

単一アイテムの変換結果を設定

mt_set_bulk_transform

複数アイテムの変換結果を一括設定

mt_generate_diff_report

差分レポート生成

mt_apply_changes

変更を MT に適用

mt_restore

ロールバック

mt_list_sessions

セッション一覧

mt_load_session

セッション読み込み

mt_delete_session

セッション削除

データの保存場所

バックアップデータは以下に保存されます:

~/.config/mt-content-refactor/
├── connections.json          # 接続先情報
└── backups/
    └── 20251208_150000/      # セッションディレクトリ
        ├── session.json      # セッション情報
        ├── items/            # 各アイテムのバックアップ
        │   ├── entry_123.json
        │   └── entry_124.json
        └── diff-report.html  # 差分レポート

開発

# 開発モード(ファイル変更を監視)
npm run dev

# MCP Inspector で動作確認
npm run inspect

注意事項

  • 本番環境での使用は慎重に: 必ずテスト環境で動作確認してから使用してください

  • バックアップの確認: 変更適用前に必ず差分レポートを確認してください

  • 認証情報の管理: 接続情報は ~/.config/mt-content-refactor/connections.json に保存されます

ライセンス

MIT License

作者

mersy

関連リンク

Available Tools

23 tools
mt_add_connectionC

新しいMT接続を追加します

Inputs: id (required), name (required), endpoint (required), username (required), +1 more.

mt_apply_changesD

変換結果をMTに適用します

Inputs: dryRun.

mt_create_backupA

サイトのコンテンツをバックアップします。変換前に必ず実行してください。

Inputs: siteId (required), targetType, status.

mt_delete_sessionC

バックアップセッションを削除します

Inputs: sessionId (required).

mt_generate_diff_reportC

変換前後の差分レポートを生成します

Inputs: format.

mt_get_backup_itemsB

バックアップしたアイテムの一覧を表示します

Inputs: no named parameters.

mt_get_content_dataC

コンテンツデータの詳細を取得します

Inputs: siteId (required), contentTypeId (required), contentDataId (required).

mt_get_entryC

記事の詳細を取得します

Inputs: siteId (required), entryId (required).

mt_get_pageC

ウェブページの詳細を取得します

Inputs: siteId (required), pageId (required).

mt_list_connectionsB

登録済みのMT接続一覧を表示します

Inputs: no named parameters.

mt_list_content_dataC

コンテンツデータ一覧を取得します

Inputs: siteId (required), contentTypeId (required), limit, offset.

mt_list_content_typesC

コンテンツタイプ一覧を取得します

Inputs: siteId (required).

mt_list_entriesC

記事一覧を取得します

Inputs: siteId (required), limit, offset, status.

mt_list_pagesC

ウェブページ一覧を取得します

Inputs: siteId (required), limit, offset, status.

mt_list_sessionsB

バックアップセッション一覧を表示します

Inputs: no named parameters.

mt_list_sitesC

サイト一覧を取得します

Inputs: no named parameters.

mt_load_sessionC

過去のバックアップセッションを読み込みます

Inputs: sessionId (required).

mt_remove_connectionC

接続を削除します

Inputs: connectionId (required).

mt_restoreC

バックアップから元の状態にリストアします

Inputs: sessionId.

mt_set_bulk_transformC

複数のアイテムに一括で変換後のHTMLを設定します

Inputs: transforms (required).

mt_set_transformC

個別のアイテムに変換後のHTMLを設定します

Inputs: itemType (required), itemId (required), afterHtml (required).

mt_test_connectionC

接続をテストします

Inputs: connectionId.

mt_use_connectionC

指定した接続をアクティブにします

Inputs: connectionId (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 23 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific resources like connections, backups, content items, and transformations, with clear boundaries. However, mt_set_transform and mt_set_bulk_transform could be slightly confusing as they differ only in scale (individual vs. bulk), but their descriptions clarify this distinction.

    Naming Consistency5/5

    All tools follow a consistent snake_case naming pattern with a 'mt_' prefix, using clear verb_noun combinations (e.g., mt_add_connection, mt_list_entries). This predictability makes it easy for agents to understand and navigate the toolset.

    Tool Count3/5

    With 23 tools, the count is on the higher side for a content refactoring server, which may feel heavy but is not extreme. It covers multiple aspects like connections, backups, content management, and transformations, but could potentially be streamlined without losing core functionality.

    Completeness5/5

    The toolset provides comprehensive coverage for content refactoring workflows, including CRUD operations for connections, backups, and content items, plus transformation and restoration capabilities. No obvious gaps exist; agents can perform full lifecycle tasks from setup to application and rollback.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      Not graded
      maintenance
      AI-powered WordPress management that enables creating and editing posts, pages, media, plugins, themes, and Gutenberg blocks through natural language with safe-by-default writes and full rollback support.
      5
      24 npm
      -
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to manage WordPress sites through natural conversation, supporting post creation, content updates, site queries, and draft-to-publish workflows via the WordPress REST API.
      9
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      MCP server for AI-assisted WordPress editing across 12 page builders. 172 tools for content management, page builder editing, WooCommerce, SEO analysis, accessibility scanning, and site intelligence. Edits native builder formats (Elementor, Bricks, Divi, Gutenberg, Beaver Builder, and 7 more) with duplicate-before-edit safety, optimistic locking, and surgical element-level operations
      11
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to read and edit WordPress sites over the REST API, including Divi 4, Divi 5, and Gutenberg content, with safety features like round-trip verification, draft-based editing, and dry-run previews.
      45
      MIT