Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

Export Skill from fastmcp (#6071)

nate nowackc8d97d1d394e
diff --git a/docs/servers/skills.mdx b/docs/servers/skills.mdx
index 71bfe7425..cd43af6dd 100644
--- a/docs/servers/skills.mdx
+++ b/docs/servers/skills.mdx
@@ -25,7 +25,7 @@ The recommended path is to define each skill as a `Skill` object, and serve them
A `Skill` holds one skill's files in memory, exactly as they will be served. You can write it in Python, read it from a folder, or load it from an installed package.
```python
-from fastmcp.skills import Skill
+from fastmcp import Skill
release_notes = Skill(
name="release-notes",
diff --git a/fastmcp_slim/fastmcp/__init__.py b/fastmcp_slim/fastmcp/__init__.py
index 5a77961de..0204b5c30 100644
--- a/fastmcp_slim/fastmcp/__init__.py
+++ b/fastmcp_slim/fastmcp/__init__.py
@@ -16,6 +16,7 @@ if TYPE_CHECKING:
from fastmcp.apps.app import FastMCPApp as FastMCPApp
from fastmcp.server.context import Context as Context
from fastmcp.server.server import FastMCP as FastMCP
+ from fastmcp.skills import Skill as Skill
settings = Settings()
if settings.log_enabled:
@@ -82,6 +83,10 @@ def __getattr__(name: str) -> object:
raise ImportError(_install_hints.APP_SUPPORT) from exc
return FastMCPApp
+ if name == "Skill":
+ from fastmcp.skills import Skill
+
+ return Skill
if name == "client":
try:
return importlib.import_module("fastmcp.client")
@@ -102,5 +107,6 @@ __all__ = [
"FastMCP",
"FastMCPApp",
"FastMCPDeprecationWarning",
+ "Skill",
"settings",
]
diff --git a/tests/skills/test_skill.py b/tests/skills/test_skill.py
index 271135661..717b17be7 100644
--- a/tests/skills/test_skill.py
+++ b/tests/skills/test_skill.py
@@ -138,3 +138,9 @@ def test_to_mcp_skill_describes_every_file(tmp_path: Path):
record = records[f"skill://team/review/{path}"]
assert record.size == len(content)
assert record.digest == f"sha256:{hashlib.sha256(content).hexdigest()}"
+
+
+def test_skill_is_exported_from_fastmcp():
+ import fastmcp
+
+ assert fastmcp.Skill is Skill