Skip to main content
MathType · MCP · AI Agent · Windows · Office Automation

Overview

This lets an AI agent create editable MathType 7 equations in Microsoft Word and PowerPoint. It ships as an installable agent skill, a Codex and Claude plugin, and a local MCP server, and Word documents also get MathType-native equation numbering and dynamic cross-references. The output is genuine Equation.DSMT4 objects, not Word OMath, images, or typed Unicode equations, so every equation stays editable in MathType.

Core features

  • Creates genuine, editable Equation.DSMT4 objects instead of Word OMath, images, or typed Unicode equations
  • Inline and centered display equations in DOCX
  • After scanning the complete document, classifies the mathematics in a raw manuscript as inline, unnumbered display, numbered display, or dynamic reference; a read-only scan finds plain-text mathematics (including Word sub/superscripts), and a mark step turns reviewed spans into markers
  • Word equation numbers such as (1) and dynamic references, both MathType-native
  • Centered floating MathType equations in PowerPoint, created through a hidden Word conversion document
  • Source Office files are preserved and each output is validated; an existing output is not replaced unless -Overwrite is explicit
  • Large Word documents render in resumable batches (batch_size, default 40), optionally in the background with progress from get_mathtype_render_status
  • A bilingual academic equation style reference: italic scalar variables, bold lowercase vectors, bold uppercase matrices and tensors, upright function names and SI units
  • A portable cross-agent skill and plugin with a local MCP server for Codex and Claude; ChatGPT uses the same capability through a remote endpoint or a Secure MCP Tunnel

Architecture

Word rendering is driven by a JSON manifest. For each equation it lists the TeX, the layout (inline or display), and whether the equation is numbered, and it locates the equation by a marker that occurs exactly once in the document (for example {{MATH:id}}); each reference has its own marker pointing at a numbered equation. On a timeout, the bridge terminates only the Office processes it logged as its own, and PowerPoint work never closes a PowerPoint instance you already had open. The repository layout:
mathtype-for-word
skills/mathtype-for-word · cross-agent skill, references, and launcher
SKILL.md
scripts · Office automation bridge, MCP server, and packager
mathtype-word.ps1 · Office bridge
mcp_server.py · MCP server
mathtype_batch.py · batch rendering
ensure-pwsh.ps1 · installs PowerShell 7
package_plugin.py · packaging
.claude-plugin/marketplace.json · Claude Code marketplace
.agents/plugins/marketplace.json · Codex marketplace
config/defaults.json · default Word equation-number profile
evals/fixtures · real Chinese and English DOCX and PPTX inputs
en-paper-draft.docx · used with en-word-manifest.json
en-presentation-draft.pptx · used with en-powerpoint-manifest.json
tests · static, MCP, live Office, rendering, and packaging checks
run-tests.ps1
dist · packaged output
mathtype-for-word-plugin.zip · plugin package, with a SHA-256 file
mathtype-for-word.skill · standalone skill package
CHANGELOG.md · changes in each release

Quick start

Check the requirements in the notes below first. The README also includes an install prompt that you can paste to an agent so it configures everything for the current environment; to install by hand, pick the path for your agent:
1

Install the plugin in Claude Code

To upgrade, run claude plugin marketplace update mathtype-for-word and claude plugin update mathtype-for-word@mathtype-for-word.
2

Install the plugin in Codex

The plugin carries the skill and the MCP server and sets a 1200 s tool limit. To upgrade, run codex plugin marketplace upgrade mathtype-for-word and then the codex plugin add command again.
3

Restart and verify the installation

Restart Claude Code or Codex after installing or upgrading, then run the checks:
The three commands check the Word prerequisites, check the PowerPoint prerequisites, and run the tests including live Office; the paths are relative to the repository.
4

Hand a document to the agent

Tell the agent which DOCX or PPTX file to edit and which equations to create. The agent keeps the source file untouched and writes the result to a new file; the work counts as done only when validation returns ok: true.

Install options

Notes

Windows 10 or 11 only. You need Microsoft Word and PowerPoint desktop with COM automation, Python 3 on PATH, and desktop MathType for Windows from the MathType download page. Install MathType for Windows, not only MathType Add-In for Microsoft 365: the Microsoft 365 task-pane add-in does not provide the desktop OLE, Word template, PowerPoint add-in, and COM workflow used here. The project is developed and tested with MathType-win-zh-7.11.1.462 (ProductVersion 7.11.1.462). MathType and Microsoft Office are proprietary products and the repository does not distribute them.
The Office bridge must run through pwsh.exe (PowerShell 7 or later). The surrounding terminal can be PowerShell 7, Bash on Windows including Git Bash, or CMD, but the bridge must not run in Windows PowerShell 5.1. From WSL, call the Windows pwsh.exe; Linux pwsh cannot automate Windows Office COM. When pwsh.exe is missing, the MCP server installs PowerShell 7 for the current user and says so in the tool reply: a download of about 106 MB and about 300 MB on disk, where the ZIP must match a pinned SHA-256 and pwsh.exe must carry a valid Microsoft signature, with no administrator rights and no PATH or registry changes.
An AI agent editing Word, PowerPoint, or MathType content must work silently: no showing or activating application windows, no stealing keyboard focus, no modal dialogs, and no mouse or keyboard automation of visible UI. If a step cannot be done silently, it stops and reports the limitation. PowerPoint rendering briefly uses the Windows clipboard and replaces whatever you had copied. PowerPoint has no equivalent of Word’s MathType numbering and references, and the tool does not imitate them.

In practice

This fits handing the equations in a paper draft or a presentation to an AI agent when the result has to stay editable in MathType. In Word, the numbers and cross-references are native MathType fields rather than typed text. The repository includes real Chinese and English DOCX and PPTX fixtures for a quick smoke test.