How to Uninstall OfficeCLI from MCP Clients: Complete Guide

Run officecli mcp uninstall <target> where <target> is your AI client (lms, claude, cursor, or vscode) to remove OfficeCLI registration from your MCP configuration.

OfficeCLI is an open-source command-line interface from the iOfficeAI/OfficeCLI repository that registers itself as an MCP (Model Control Protocol) server within various AI coding assistants. When you need to remove this integration, the CLI provides a dedicated uninstall pathway that cleanly detaches the tool from each supported client without leaving orphaned configuration entries.

How the OfficeCLI Uninstall Command Works

The uninstall process begins in src/officecli/Program.cs at lines 94–96, where the CLI parser dispatches the mcp uninstall sub-command to the McpInstaller class. According to the source code, this entry point forwards the target client identifier to McpInstaller.Uninstall (lines 99–108 in src/officecli/McpInstaller.cs), which then routes the request to client-specific removal routines.

The McpInstaller.Uninstall method implements a switch logic that maps user-friendly target names to their corresponding uninstall implementations. If you provide an unrecognized target, the method prints an error to stderr and exits with status code 1 (lines 115–118 in src/officecli/McpInstaller.cs).

Supported MCP Clients and Uninstall Methods

OfficeCLI supports four major AI client integrations, each with dedicated cleanup logic in McpInstaller.cs.

LM Studio

Target aliases: lms, lmstudio, lm-studio

The UninstallLmStudio() method (lines 46–56) removes the directory ~/.cache/lm-studio/extensions/plugins/mcp/officecli that contains the MCP manifest and configuration files. This completely deletes the plugin directory rather than editing a JSON file.

Claude Code

Target aliases: claude, claude-code

The UninstallClaude() method (lines 64–74) edits the ~/.claude.json file to remove the officecli entry from the mcpServers section. This preserves other MCP server configurations while cleanly detaching OfficeCLI.

Cursor

Target: cursor

Cursor configurations are handled by UninstallJson("cursor", GetCursorMcpPath(), "mcpServers") (lines 108–111). This locates Cursor’s MCP configuration JSON and removes the officecli server entry from the mcpServers object.

VS Code (Copilot)

Target aliases: vscode, copilot

The UninstallJson("vscode", GetVsCodeMcpPath(), "mcpServers") method (lines 112–115) targets VS Code’s MCP configuration file, removing the server registration while maintaining the file’s JSON structure.

Step-by-Step Uninstall Examples

Execute these commands in your terminal to remove OfficeCLI from specific clients:


# Remove OfficeCLI from LM Studio

officecli mcp uninstall lms

# Remove OfficeCLI from Claude Code

officecli mcp uninstall claude

# Remove OfficeCLI from Cursor

officecli mcp uninstall cursor

# Remove OfficeCLI from VS Code Copilot

officecli mcp uninstall vscode

Each command returns exit code 0 on successful removal. You can verify the uninstallation by checking that officecli no longer appears in your client’s MCP server list.

Error Handling and Exit Codes

If you specify a client that OfficeCLI does not recognize, the CLI outputs an error message and terminates with exit code 1. This behavior is implemented in the final else-branch of McpInstaller.Uninstall (lines 115–118). To avoid errors, use only the supported target names listed above.

Summary

  • Primary command: officecli mcp uninstall <target> parsed in src/officecli/Program.cs (lines 94–96).
  • Core logic: Implemented in McpInstaller.Uninstall within src/officecli/McpInstaller.cs.
  • LM Studio: Deletes ~/.cache/lm-studio/extensions/plugins/mcp/officecli via UninstallLmStudio().
  • Claude Code: Edits ~/.claude.json via UninstallClaude().
  • Cursor: JSON manipulation via UninstallJson() targeting Cursor’s config path.
  • VS Code: JSON manipulation via UninstallJson() targeting VS Code’s MCP settings.
  • Exit codes: 0 for success, 1 for unrecognized targets.

Frequently Asked Questions

What happens if I run the uninstall command without OfficeCLI being installed?

The command will attempt to remove the configuration entries regardless of whether OfficeCLI is currently active. If the target client has no officecli entry, the JSON editing methods will simply leave the files unchanged, while the LM Studio directory deletion will report that the path does not exist.

Can I uninstall OfficeCLI from all clients at once?

The current implementation in iOfficeAI/OfficeCLI does not support a bulk uninstall flag. You must run separate commands for each MCP client (e.g., officecli mcp uninstall lms && officecli mcp uninstall claude).

Where does OfficeCLI store its uninstall configuration?

OfficeCLI does not maintain a separate uninstall registry. Instead, it reads the target client’s standard configuration paths—~/.claude.json for Claude Code, Cursor’s JSON configuration, VS Code’s settings, and ~/.cache/lm-studio/ for LM Studio—to determine what needs removal.

Is the uninstall process reversible?

You can reinstall OfficeCLI at any time by running the corresponding install command (officecli mcp install <target>). The uninstall command only removes the MCP server registration and associated files; it does not delete the OfficeCLI binary itself from your system.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →