Skip to content

feat: IRM/AIP-protected file support#515

Merged
sbroenne merged 1 commit intomainfrom
feat/irm-aip-file-support
Feb 24, 2026
Merged

feat: IRM/AIP-protected file support#515
sbroenne merged 1 commit intomainfrom
feat/irm-aip-file-support

Conversation

@sbroenne
Copy link
Owner

Summary

Adds support for opening IRM/AIP-protected Excel files that require Windows credential prompts.

Problem

IRM (Information Rights Management) / AIP (Azure Information Protection) protected Excel files could not be opened by ExcelMcp because:

  1. The exclusive file lock check would fail before the Windows IRM auth dialog appeared
  2. Files needed to be opened with Excel visible so the user could authenticate

Solution

  • Auto-detect IRM files: Check OLE2 header magic bytes \D0 CF 11 E0 A1 B1 1A E1\ in \FileAccessValidator.IsIrmProtected()\
  • Skip lock check for IRM files: Credential prompt must appear first
  • Force \Visible=true\ for IRM files: Required for Windows IRM auth dialog
  • Open read-only: IRM files opened with \ReadOnly:true\
  • *Expose \isIrmProtected* in \ ile(action='test')\ response
  • Updated tool description with IRM workflow guidance

Changes

Core Implementation

  • \src/ExcelMcp.ComInterop/FileAccessValidator.cs\ — \IsIrmProtected()\ via OLE2 header check
  • \src/ExcelMcp.ComInterop/Session/ExcelBatch.cs\ — IRM branch: skip lock check, force Visible, open ReadOnly
  • \src/ExcelMcp.Core/Models/ResultTypes.cs\ — \IsIrmProtected\ property on \FileValidationInfo\
  • \src/ExcelMcp.Core/Commands/FileCommands.cs\ — Populate \IsIrmProtected\ in \Test()\
  • \src/ExcelMcp.McpServer/Tools/ExcelFileTool.cs\ — Expose \isIrmProtected\ + IRM guidance in tool description

Also Included

  • MCP SDK \

- Auto-detect OLE2/IRM files via header signature (D0 CF 11 E0 A1 B1 1A E1)
- Skip exclusive lock check for IRM files (credential prompt must appear first)
- Open IRM files read-only with Excel forced visible for Windows IRM auth
- Expose isIrmProtected in file(action='test') response
- Update tool description with IRM workflow guidance
- Also: MCP SDK upgrade 0.8.0-preview.1 -> 0.9.0-preview.2 (ImageContentBlock API)
@github-actions
Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@sbroenne sbroenne merged commit 8578b87 into main Feb 24, 2026
4 checks passed
@sbroenne sbroenne deleted the feat/irm-aip-file-support branch February 24, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant