home / mcp / mt content refactor mcp server
Provides AI-driven transformation of Movable Type article HTML via MCP clients, with backup, diff, and rollback workflows.
Configuration
View docs{
"mcpServers": {
"bit-part-mt-content-refactor-mcp": {
"url": "https://example.com/mt/mt-data-api.cgi"
}
}
}This MCP server lets you transform Movable Type article HTML in bulk using AI. By connecting a compatible MCP client, you can back up, convert with flexible rules, review diffs, and safely apply changes to MT Data API content in a structured workflow.
You connect to your MT Data API environment, back up the site contents, and then run AI-driven transformation rules to adjust article HTML. After the transformation, you generate a diff report to review the changes before applying them to MT. If something goes wrong, you can roll back to the original state and resume later from a saved session.
Prerequisites: you need Node.js 18 or newer and Movable Type 6 or newer (Data API v4 compatible). You also need an MCP-compatible AI client such as Claude Desktop.
Clone the MCP server repository, install dependencies, and build the project.
# Clone the MCP server
git clone https://github.com/bit-part/mt-content-refactor-mcp.git
cd mt-content-refactor-mcp
# Install dependencies
npm install
# Build the project
npm run buildRegister a local or remote MCP server with your MCP client. If you run the server locally, you start from the built output and point the client to the runtime JS file inside dist.
# Example: Claude Desktop configuration to run local server
{
"mcpServers": {
"mt-content-refactor": {
"command": "node",
"args": ["/path/to/mt-content-refactor-mcp/dist/index.js"]
}
}
}
```
If you are using Volta for Node.js, specify the full path to the Node binary in the same config instead of node. For example:
```
```
{
"mcpServers": {
"mt-content-refactor": {
"command": "/Users/yourname/.volta/bin/node",
"args": ["/path/to/mt-content-refactor-mcp/dist/index.js"]
}
}
}
```
Save the configuration and restart the MCP client so it picks up the new server entry.1. Add your MT environment with the Data API endpoint, username, and password so the MCP server can access your content.
MT environment to add
endpoint: https://example.com/mt/mt-data-api.cgi
username: api-user
password: secret1232. Connect to the MT environment from the MCP client and select the environment you just configured.
3. List sites to confirm access and browse to the site you want to transform.
4. Create a backup session for all articles you intend to transform. This establishes a restore point.
5. Run the transformation with your rules. For example, you can apply rules like wrapping images inside <p> tags with a figure wrapper and adding a text-specific class to plain text paragraphs.
6. Generate and review the diff report to verify changes before applying them.
7. Apply the confirmed changes to MT. If issues arise, use the built-in rollback to revert to the backup state.
- Follow a backup → transform → diff → apply flow to minimize risk. - Always review the diff report before applying changes. - Use the rollback feature if any transformation causes undesired results. - Sessions save progress so you can pause and resume later.
Backups and session data are saved under your home config path in a structure like: ~/.config/mt-content-refactor/ and include backups/ and session data with a diff-report for each session.
List registered connections for MCP access and management.
Add a new MT Data API connection to the MCP environment.
Select which registered connection to use for subsequent operations.
Remove a registered connection from the MCP environment.
Test the connectivity and authentication for a given connection.
List available MT sites to manage content.
List entries (articles) within a site.
Retrieve detailed data for a single article.
List pages within a site.
Retrieve detailed data for a single page.
List content types available in the MT environment.
List content data items for retrieval or transformation.
Get detailed content data for a particular item.
Create a backup session for selected items.
Fetch the items included in a backup session.
Apply a transformation result to a single item.
Apply transformation results to multiple items in bulk.
Generate a diff report showing changes between before and after.
Apply the prepared changes to MT content.
Rollback changes by restoring from backup.
List active or past transformation sessions.
Load a saved transformation session to continue work.
Delete a saved transformation session.