Skip to main content

Python SDK for Claude Code plugins and marketplaces

Project description

claude-code-plugins-sdk

A Python library for working with Claude Code plugins and marketplaces.

Claude Code has a plugin ecosystem — agents, skills, commands, hooks, MCP servers — but no official Python tooling to work with it. This library lets you load, parse, and validate plugins and marketplaces from disk or from remote sources.

Install

pip install claude-code-plugins-sdk

Requires Python 3.10+.

What you can do

Load a local marketplace and inspect its plugins:

from pathlib import Path
from claude_code_plugins_sdk import load_marketplace

marketplace = load_marketplace(Path("./my-marketplace"))

for plugin in marketplace.plugins:
    print(plugin.name, plugin.version)

Fetch a marketplace from GitHub:

from claude_code_plugins_sdk import fetch_marketplace

# GitHub shorthand
marketplace = fetch_marketplace("anthropics/claude-code")

# Pinned to a tag
from claude_code_plugins_sdk import GitHubSource
marketplace = fetch_marketplace(GitHubSource(source="github", repo="anthropics/claude-code", ref="v1.0"))

# Raw URL to a marketplace.json
marketplace = fetch_marketplace("https://example.com/.claude-plugin/marketplace.json")

Load a plugin directory and read its agents, skills, commands, and hooks:

from pathlib import Path
from claude_code_plugins_sdk import load_plugin

plugin = load_plugin(Path("./my-plugin"))

print(plugin.manifest.name)       # plugin name from plugin.json
print(plugin.agents)              # list of AgentDefinition
print(plugin.skills)              # list of SkillDefinition
print(plugin.commands)            # list of CommandDefinition
print(plugin.hooks)               # HooksConfig or None
print(plugin.mcp_servers)         # MCPServersConfig or None

Load individual component files directly:

from claude_code_plugins_sdk import load_agent, load_skill, load_command

agent = load_agent(Path("./agents/reviewer.md"))
print(agent.name, agent.tools)   # tools is always a list, even though YAML stores it as a comma string

skill = load_skill(Path("./skills/code-review/SKILL.md"))
command = load_command(Path("./commands/review.md"))

Plugin structure

A Claude Code plugin is a directory with this layout:

my-plugin/
├── .claude-plugin/
│   └── plugin.json      # optional manifest
├── agents/              # *.md files with YAML frontmatter
├── skills/              # */SKILL.md files
├── commands/            # *.md files
├── hooks/
│   └── hooks.json
├── .mcp.json
└── .lsp.json

A marketplace is a directory with .claude-plugin/marketplace.json listing plugins and where to find them.

Development

git clone git@github.com:doron-cohen/claude-code-plugins-sdk.git
cd claude-code-plugins-sdk
uv sync
uv run pytest
uv run pytest -m integration  # hits real remote marketplaces, needs network

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

claude_code_plugins_sdk-0.1.1.tar.gz (60.6 kB view details)

Uploaded Source

Built Distribution

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

claude_code_plugins_sdk-0.1.1-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file claude_code_plugins_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: claude_code_plugins_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 60.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for claude_code_plugins_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8c9a1c8c64f303679f6f96108a9da486df10c89256b644550df806aed2a8e57e
MD5 0c7f0b0cd3cc3d569e4dec483f76acda
BLAKE2b-256 8c4c3afbb6563e5c571803aa88c409f8aee2145e871e98fa9ef12b76dd982ed6

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_code_plugins_sdk-0.1.1.tar.gz:

Publisher: release.yml on doron-cohen/claude-code-plugins-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_code_plugins_sdk-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_code_plugins_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc0712ae2c62cae48daa1cbf47144c20bba5ef7cb6c2f4697917f283d98387d2
MD5 d1a9009d12a4af2d385a20b13894e495
BLAKE2b-256 fd1a05dfde615e7a18045f6e68262f0e1d3fe06fd72cb74b47e2ac27659b6bed

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_code_plugins_sdk-0.1.1-py3-none-any.whl:

Publisher: release.yml on doron-cohen/claude-code-plugins-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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