.Net + Python: [BREAKING] Limit MCP skill archives to the ZIP format - #8290
Conversation
Skill archives served over MCP are restricted to ZIP in both .NET and Python. Payloads detected as any other container format are reported as unsupported and skipped during discovery instead of being unpacked. - .NET: drop `ArchiveFormat.Tar`/`TarGz` and the TAR extraction path from `AgentMcpSkillArchiveExtractor`; an unsupported format now throws before the target directory is created. - Python: drop `_ArchiveFormat.TAR`/`TAR_GZ` and `_extract_tar_to_memory` from `_skills.py`; an unsupported format raises. - Update the affected unit tests and documentation to match. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
A public Foundry toolbox docstring still incorrectly advertises TAR support.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Limits MCP skill archives to ZIP consistently across .NET and Python.
Changes:
- Removes TAR/gzip detection and extraction paths.
- Rejects unsupported formats while preserving ZIP protections.
- Updates tests and core documentation.
File summaries
| File | Description |
|---|---|
python/packages/core/tests/core/test_mcp_skills.py |
Tests ZIP-only behavior. |
python/packages/core/AGENTS.md |
Documents ZIP-only archives. |
python/packages/core/agent_framework/_skills.py |
Removes Python TAR support. |
dotnet/tests/Microsoft.Agents.AI.Mcp.UnitTests/Skills/AgentMcpSkillsSourceArchiveTests.cs |
Tests .NET rejection behavior. |
dotnet/src/Microsoft.Agents.AI.Mcp/Skills/Loaders/ArchiveFormat.cs |
Removes TAR enum values. |
dotnet/src/Microsoft.Agents.AI.Mcp/Skills/Loaders/ArchiveEntryLoader.cs |
Updates loader documentation. |
dotnet/src/Microsoft.Agents.AI.Mcp/Skills/Loaders/AgentMcpSkillArchiveExtractor.cs |
Removes TAR extraction and detection. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): 0235f67793cb
Model: gpt-5.6-sol-fast
Overview
The PR consistently narrows both implementations to ZIP while retaining per-entry failure isolation, traversal defenses, extraction limits, and cleanup behavior. The new rejection tests align across .NET and Python. However, removing previously supported TAR and gzip-TAR behavior silently drops existing archive skills after upgrade, so the change needs breaking-change classification and migration guidance.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: dotnet/src/Microsoft.Agents.AI.Mcp/Skills/Loaders/AgentMcpSkillArchiveExtractor.cs
- Drop redundant `@pytest.mark.asyncio` decorators: `packages/core` configures `asyncio_mode = "auto"`, so pytest-asyncio collects the async tests without them. - Update the `FoundryToolbox.as_skills_provider()` docstring to describe archive entries as ZIP, matching the source it forwards options to. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Motivation & Context
archiveentries in askill://index.jsonindex accepted ZIP, TAR, and gzip-compressedTAR. Three unpacking paths across two languages is surface area and drift for little
benefit: ZIP is what the skill-packaging ecosystem uses, and it is the only format both
implementations handled identically. This narrows archive support to ZIP.
Description & Review Guide
What are the major changes?
ArchiveFormat/_ArchiveFormatare reduced toUnknown/Zip, the TAR extractionpaths and TAR/gzip detection signals are removed, and a non-ZIP format is rejected up
front. Tests and docs updated to match.
What is the impact of these changes?
A TAR or
.tar.gz/.tgzentry is skipped during discovery and logged as an unsupportedmedia type, so the rest of the index still loads. ZIP is unchanged. The enums are
internal/private, but
UseMcpSkills/MCPSkillsSourcebehaviour changes, hence[BREAKING].Migration
Repack such archives as ZIP and serve them with an
application/zipmedia type or a.zipURL suffix. No caller-side code changes are needed.What do you want reviewers to focus on?
Whether skipping (rather than hard-failing) a non-ZIP entry is right, and that the .NET
and Python detection tables still agree entry for entry.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.