-
Notifications
You must be signed in to change notification settings - Fork 782
command mcp
Built-in MCP (Model Context Protocol) server for AI agent integration.
# Start MCP server over stdio
officecli mcp
# Register as MCP server in an AI client
officecli mcp <target>
# Unregister from an AI client
officecli mcp uninstall <target>
# Show registration status
officecli mcp listOfficeCLI includes a built-in MCP server that exposes all document operations as tools over the Model Context Protocol (JSON-RPC 2.0, protocol version 2024-11-05). This allows AI agents (Claude, Cursor, VS Code Copilot, LM Studio, etc.) to directly call OfficeCLI commands.
| Target | Aliases | Config Location |
|---|---|---|
| Claude Code |
claude, claude-code
|
~/.claude/ |
| Cursor | cursor |
~/.cursor/ |
| VS Code / Copilot |
vscode, copilot
|
VS Code settings |
| LM Studio |
lms, lmstudio
|
LM Studio config |
# Register in Claude Code
officecli mcp claude
# Register in Cursor
officecli mcp cursor
# Check status across all clients
officecli mcp list
# Unregister from Claude Code
officecli mcp uninstall claudeThe MCP server exposes a single tool named officecli with exactly one parameter, command — a raw CLI command line (string, or a pre-split argv array for values containing spaces/quotes), passed through verbatim to the same CLI engine as the terminal binary. There is no structured per-verb parameter schema (no file/path/props/parent fields) — the tool description explicitly says "Pass an officecli command line in command... it runs through the same CLI you'd use in a terminal."
{ "command": "add deck.pptx /slide[1] --type shape --prop text=Hi" }
{ "command": "set report.docx /body/p[1] --prop bold=true" }
{ "command": "view deck.pptx screenshot --page 2" }
{ "command": "help pptx shape" }
{ "command": "load_skill pptx" }All CLI verbs are reachable this way: create, view (modes text/annotated/outline/stats/issues/html/svg/screenshot/forms), get, query, set, add, remove, move, swap, validate, batch, raw, raw-set, help, load_skill, and the rest of the CLI's command list — load_skill is a verb passed inside command, not a separate top-level MCP tool. Add --json to get/query/validate/view issues for structured output, same as the CLI.
v1.0.120+: the MCP tool is a thin shell over the
officeclicommand line — the router in-process shells out to the CLI, so MCP and CLI behavior stay in lockstep by construction. The tool description carries an always-on delivery gate: before reporting a document finished,validate(schema),view issues+ aview textplaceholder scan (content), and aview screenshotvisual audit (layout) — "validate passing is NOT delivery."
Invoked as {"command": "load_skill <name>"}, mirroring the CLI officecli load_skill <name>. Returns the embedded SKILL.md content for the named specialized skill (e.g. pptx, docx, xlsx, morph-ppt, pitch-deck, academic-paper, data-dashboard, financial-model) so agents can dynamically load just the scene-layer guide for the artifact they're producing without reinstalling anything.
Returns a strategy guide and format-specific property reference for the specified document format:
{ "command": "help", "format": "xlsx" }
{ "command": "help", "format": "pptx" }
{ "command": "help", "format": "docx" }- The MCP server communicates over stdio (stdin/stdout) using JSON-RPC 2.0.
- All tool outputs use the structured JSON envelope format (
{ "success": true/false, "data": ... }). - The server runs as a single process — one instance per AI client session.
- Command Reference - All commands
- skills - Install skill definitions for agent clients
- Agent Guide - Wiki navigation for AI agents
- batch - Batch multiple operations
Based on OfficeCLI v1.0.127