Skip to content

.Net + Python: [BREAKING] Limit MCP skill archives to the ZIP format - #8290

Merged
SergeyMenshykh merged 2 commits into
microsoft:mainfrom
SergeyMenshykh:mcp-skill-archives-zip-only
Sep 11, 2026
Merged

.Net + Python: [BREAKING] Limit MCP skill archives to the ZIP format#8290
SergeyMenshykh merged 2 commits into
microsoft:mainfrom
SergeyMenshykh:mcp-skill-archives-zip-only

Conversation

@SergeyMenshykh

@SergeyMenshykh SergeyMenshykh commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Motivation & Context

archive entries in a skill://index.json index accepted ZIP, TAR, and gzip-compressed
TAR. 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 / _ArchiveFormat are reduced to Unknown/Zip, the TAR extraction
    paths 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/.tgz entry is skipped during discovery and logged as an unsupported
    media type, so the rest of the index still loads. ZIP is unchanged. The enums are
    internal/private, but UseMcpSkills / MCPSkillsSource behaviour changes, hence
    [BREAKING].

  • Migration
    Repack such archives as ZIP and serve them with an application/zip media type or a
    .zip URL 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

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

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>
Copilot AI balanced review requested due to automatic review settings September 11, 2026 10:08
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth September 11, 2026 10:08 — with GitHub Actions Active
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth September 11, 2026 10:08 — with GitHub Actions Active
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth September 11, 2026 10:08 — with GitHub Actions Active
@agent-framework-automation agent-framework-automation Bot added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python .NET Usage: [Issues, PRs], Target: .Net labels Sep 11, 2026
@github-actions github-actions Bot changed the title .Net + Python: Limit MCP skill archives to the ZIP format Python: .Net + Python: Limit MCP skill archives to the ZIP format Sep 11, 2026
@github-actions github-actions Bot changed the title Python: .Net + Python: Limit MCP skill archives to the ZIP format .NET: .Net + Python: Limit MCP skill archives to the ZIP format Sep 11, 2026
@SergeyMenshykh
SergeyMenshykh marked this pull request as ready for review September 11, 2026 10:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread python/packages/core/agent_framework/_skills.py
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth September 11, 2026 10:13 — with GitHub Actions Active
Comment thread python/packages/core/tests/core/test_mcp_skills.py Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth September 11, 2026 10:30 — with GitHub Actions Active
@SergeyMenshykh SergeyMenshykh changed the title .NET: .Net + Python: Limit MCP skill archives to the ZIP format [BREAKING] .Net + Python: Limit MCP skill archives to the ZIP format Sep 11, 2026
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth September 11, 2026 10:54 — with GitHub Actions Active
@agent-framework-automation agent-framework-automation Bot added the breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible label Sep 11, 2026
@SergeyMenshykh SergeyMenshykh changed the title [BREAKING] .Net + Python: Limit MCP skill archives to the ZIP format .Net + Python: [BREAKING] Limit MCP skill archives to the ZIP format Sep 11, 2026
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth September 11, 2026 11:07 — with GitHub Actions Active
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth September 11, 2026 11:07 — with GitHub Actions Active
@SergeyMenshykh
SergeyMenshykh deployed to github-app-auth September 11, 2026 11:08 — with GitHub Actions Active
@SergeyMenshykh
SergeyMenshykh added this pull request to the merge queue Sep 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 11, 2026
@SergeyMenshykh
SergeyMenshykh added this pull request to the merge queue Sep 11, 2026
@SergeyMenshykh SergeyMenshykh self-assigned this Sep 11, 2026
Merged via the queue into microsoft:main with commit c744b16 Sep 11, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Usage: [PRs], Target: all PRs that introduce changes that are not backward compatible documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net python Usage: [Issues, PRs], Target: Python

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants