Back to Fastmcp

skills

docs/python-sdk/fastmcp-utilities-skills.mdx

3.2.43.3 KB
Original Source

fastmcp.utilities.skills

Client utilities for discovering and downloading skills from MCP servers.

Functions

list_skills <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/skills.py#L43" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
list_skills(client: Client) -> list[SkillSummary]

List all available skills from an MCP server.

Discovers skills by finding resources with URIs matching the skill://{name}/SKILL.md pattern.

Args:

  • client: Connected FastMCP client

Returns:

  • List of SkillSummary objects with name, description, and URI

get_skill_manifest <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/skills.py#L87" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
get_skill_manifest(client: Client, skill_name: str) -> SkillManifest

Get the manifest for a specific skill.

Args:

  • client: Connected FastMCP client
  • skill_name: Name of the skill

Returns:

  • SkillManifest with file listing

Raises:

  • ValueError: If manifest cannot be read or parsed

download_skill <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/skills.py#L127" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
download_skill(client: Client, skill_name: str, target_dir: str | Path) -> Path

Download a skill and all its files to a local directory.

Creates a subdirectory named after the skill containing all files.

Args:

  • client: Connected FastMCP client
  • skill_name: Name of the skill to download
  • target_dir: Directory where skill folder will be created
  • overwrite: If True, overwrite existing skill directory. If False (default), raise FileExistsError if directory exists.

Returns:

  • Path to the downloaded skill directory

Raises:

  • ValueError: If skill cannot be found or downloaded
  • FileExistsError: If skill directory exists and overwrite=False

sync_skills <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/skills.py#L218" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

python
sync_skills(client: Client, target_dir: str | Path) -> list[Path]

Download all available skills from a server.

Args:

  • client: Connected FastMCP client
  • target_dir: Directory where skill folders will be created
  • overwrite: If True, overwrite existing files

Returns:

  • List of paths to downloaded skill directories

Classes

SkillSummary <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/skills.py#L18" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Summary information about a skill available on a server.

SkillFile <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/skills.py#L27" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Information about a file within a skill.

SkillManifest <sup><a href="https://github.com/PrefectHQ/fastmcp/blob/main/src/fastmcp/utilities/skills.py#L36" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Full manifest of a skill including all files.