Skip to content

MCP Server Integration (agentskills-mcp-server)

Serves skills as MCP tools/resources.

pip install agentskills-mcp-server

agentskills_mcp_server

MCP server integration for Agent Skills.

This package bridges :mod:agentskills_core and the Model Context Protocol <https://modelcontextprotocol.io>_, providing:

  • :func:create_mcp_server -- builds an MCP server from a :class:~agentskills_core.SkillRegistry. Useful when you have custom providers or need full control over registration.
  • CLI entry-point (python -m agentskills_mcp_server --config server.json) for zero-code server startup.

Quick start (programmatic)::

from agentskills_core import SkillRegistry
from agentskills_mcp_server import create_mcp_server

registry = SkillRegistry()
await registry.register("incident-response", my_custom_provider)
server = create_mcp_server(registry, name="My Agent")
server.run()  # stdio by default

CLI::

python -m agentskills_mcp_server --config server.json

Install::

pip install agentskills-mcp-server

__getattr__

__getattr__(name: str) -> object

Lazy-load optional extras to avoid hard dependencies at import time.

create_mcp_server

create_mcp_server(registry: SkillRegistry, *, name: str, instructions: str | None = None, max_inline_binary_bytes: int = DEFAULT_MAX_INLINE_BINARY_BYTES, fast_path: FastPath | None = None, vision: bool = False, max_inline_image_bytes: int = DEFAULT_MAX_INLINE_IMAGE_BYTES) -> FastMCP

Build an MCP server that exposes an Agent Skills registry.

The returned server (FastMCP on SDK 1.x, MCPServer on SDK 2.x) is transport-agnostic. Call server.run() to start with the default stdio transport, or server.run(transport="streamable-http") for HTTP.

Tools let the LLM agent read skill content (metadata, body, references, scripts, assets). Resources provide the skill catalog and usage instructions for system-prompt injection.

Parameters:

Name Type Description Default
registry SkillRegistry

The :class:~agentskills_core.SkillRegistry whose skills should be exposed via MCP.

required
name str

Display name for the MCP server. Clients see this during the MCP initialization handshake. Required.

required
instructions str | None

Optional server-level instructions sent to the MCP client during initialization. Use this to describe the server's purpose or capabilities.

None
max_inline_binary_bytes int

Size ceiling for inlining binary resources as base64. Larger resources are described but not returned. See :func:~agentskills_core.encode_resource_content.

DEFAULT_MAX_INLINE_BINARY_BYTES
fast_path FastPath | None

A :class:~agentskills_core.FastPath from :func:~agentskills_core.resolve_fast_path. When given, both catalog resources serve the skill's body directly, the usage-instructions resource drops the selection workflow it no longer describes, and the four body-access tools are not registered at all. Resource tools remain.

None
vision bool

When True, bundled images small enough to inline are returned as native ImageContent instead of a base64 JSON envelope. Off by default: handing an image to a text-only model is an API error, not a degraded answer, so the caller declares the capability rather than the library guessing it.

False
max_inline_image_bytes int

Size ceiling for native images. Only consulted when vision is True. Larger images fall back to the JSON envelope.

DEFAULT_MAX_INLINE_IMAGE_BYTES

Returns:

Type Description
MCPServer

A configured server from the installed MCP SDK, ready for

MCPServer

server.run(). Its direct Python methods follow that SDK's API.