Skip to main content

HTTP-based skill providers for the Agent Skills format (https://agentskills.io)

Project description

agentskills-http

PyPI Python 3.12+ License: MIT

HTTP static-file skill provider for the Agent Skills SDK.

Serves Agent Skills from any static HTTP file host — S3, Azure Blob, CDN, GitHub Pages, Nginx, etc. Expects the same directory-tree layout as the filesystem provider, served over HTTP.

Installation

pip install agentskills-http

Requires Python 3.12+. Installs agentskills-core, httpx, and pyyaml as dependencies.

Expected URL Layout

https://cdn.example.com/skills/
├── incident-response/
│   ├── SKILL.md
│   ├── references/severity-levels.md
│   ├── scripts/page-oncall.sh
│   └── assets/flowchart.mermaid
└── another-skill/
    └── SKILL.md

Usage

from agentskills_core import SkillRegistry
from agentskills_http import HTTPStaticFileSkillProvider

async with HTTPStaticFileSkillProvider("https://cdn.example.com/skills") as provider:
    registry = SkillRegistry()
    await registry.register("incident-response", provider)

    skill = registry.get_skill("incident-response")
    meta = await skill.get_metadata()
    body = await skill.get_body()

Custom Headers

Pass authentication or other headers:

provider = HTTPStaticFileSkillProvider(
    "https://cdn.example.com/skills",
    headers={"Authorization": "Bearer <token>"},
)

Bring Your Own Client

Supply a pre-configured httpx.AsyncClient for full control over timeouts, proxies, etc.:

import httpx

client = httpx.AsyncClient(timeout=30, headers={"Authorization": "Bearer <token>"})
provider = HTTPStaticFileSkillProvider("https://cdn.example.com/skills", client=client)
# caller is responsible for closing the client

Note: client and headers are mutually exclusive. Configure headers on the client directly when providing your own.

API

HTTPStaticFileSkillProvider(base_url, *, client=None, headers=None, params=None, require_tls=False, max_response_bytes=10_485_760)

Parameter Type Default Description
base_url str Root URL where the skill tree is hosted
client AsyncClient | None None Pre-configured httpx client (caller manages lifecycle)
headers dict | None None Extra headers sent with every request
params dict | None None Query parameters appended to every request
require_tls bool False Reject http:// URLs with ValueError
max_response_bytes int 10_485_760 Maximum allowed response size in bytes

Note: client and headers/params are mutually exclusive. Configure headers and params on the client directly when providing your own.

Method Returns Description
get_metadata(skill_id) dict[str, Any] Parsed YAML frontmatter from SKILL.md
get_body(skill_id) str Markdown body after the frontmatter
get_script(skill_id, name) bytes Raw script content
get_asset(skill_id, name) bytes Raw asset content
get_reference(skill_id, name) bytes Raw reference content
aclose() None Close the HTTP client (if owned by the provider)

Supports async with for automatic cleanup.

Error Handling

Scenario Exception
404 on SKILL.md SkillNotFoundError
404 on a resource ResourceNotFoundError
Other HTTP errors (500, 403, ...) AgentSkillsError
Connection failures AgentSkillsError

All exceptions inherit from AgentSkillsError.

Security

  • Input validation — Skill IDs and resource names are validated against a safe-character pattern (^[a-zA-Z0-9][a-zA-Z0-9._-]*$) to prevent path-traversal and injection attacks.
  • TLS warnings — A UserWarning is emitted when base_url uses unencrypted HTTP. Set require_tls=True to reject HTTP URLs entirely.
  • Redirect protection — The internally-created HTTP client does not follow redirects by default, preventing open-redirect SSRF.
  • Timeouts — Default 30-second timeout on all HTTP requests.
  • Response size limits — Responses exceeding 10 MB (default) are rejected before processing. Configure via max_response_bytes.
  • Error-message sanitization — Error messages omit URLs and include only status codes and generic descriptions, preventing internal URL leakage.

For the full security policy, see SECURITY.md.

Deployment Considerations

  • Rate limiting — The SDK does not enforce rate limits on MCP tool calls or HTTP requests. Deploy behind a reverse proxy or API gateway that provides rate limiting in production environments.
  • Credential management — Do not store secrets (API keys, SAS tokens, Authorization headers) in config files committed to version control. Use environment variables or a secret manager instead.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentskills_http-0.2.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentskills_http-0.2.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file agentskills_http-0.2.1.tar.gz.

File metadata

  • Download URL: agentskills_http-0.2.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.13.9 Windows/11

File hashes

Hashes for agentskills_http-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c0cb52161e2a1e20f17f15522eb79bb6cb3ac0300e69d992e45a85456d95cc7d
MD5 48b5e721da954491a6cdc6d3ab908b7f
BLAKE2b-256 d415534b1a17e393814209dc7d68fb0b1e78f13c54b7b25d0afa46d49011391d

See more details on using hashes here.

File details

Details for the file agentskills_http-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: agentskills_http-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.1 CPython/3.13.9 Windows/11

File hashes

Hashes for agentskills_http-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 de49bde4ac905935fe09b9700a172b932b5779b715909cb3152c2c11156eac2c
MD5 61ed86b26d330a61a768fb0061b56163
BLAKE2b-256 47576c1c1ae92caedaa379974087c5cf6070704f403c31a79462d48985b8ab86

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page