4.7 KiB
Hooking Up a New Skill
Use this checklist after generating a new skill under docs/skills/<slug>/.
Checklist
-
Create the authored docs content. Add
docs/skills/<slug>/SKILL.mdand any companion files underdocs/skills/<slug>/references/. -
Choose the three names up front. Use a docs slug like
fastapi-uv-docker, a resource id likefastapi-uv-docker, and a Python package name likefastapi_uv_docker. -
Add the runtime package. Create
src/personal_mcp/skills/<python_namespace>/with__init__.py,server.py, andmetadata.yaml. -
Expose the document resource in
server.py. Follow the existing pattern: create aFastMCPinstance, registerresource://skills/<skill-id>/document, and returnload_skill_document(skill_id=<skill-id>, skill_slug=<slug>). -
Register the catalog metadata. In
metadata.yaml, add the skillid,name,version,description,tags,capabilities, anddepends_on. Thecapabilitieslist should includeresource://skills/<skill-id>/document. -
Mount the skill in the root server. Import the new server in
src/personal_mcp/mcp.pyand add anmcp.mount(...)call with the Python namespace. -
Let the loader and catalog do the rest. The document loader reads canonical Markdown from
docs/skills/<slug>/SKILL.md, and the catalog discovers metadata fromsrc/personal_mcp/skills/*/metadata.yamlautomatically. -
Rebuild and smoke-test. Run
uv run zensical buildto publish the docs site, then run a quick Python check or start the app to confirm the new resource loads.
Minimal Shape
- Docs content:
docs/skills/<slug>/SKILL.md - Optional references:
docs/skills/<slug>/references/*.md - Runtime package:
src/personal_mcp/skills/<python_namespace>/ - Resource URI:
resource://skills/<skill-id>/document
Quick Validation
-
Confirm the Markdown document resolves through the loader.
uv run python -c "from personal_mcp.skills.document_loader import load_skill_document; print(load_skill_document(skill_id='<skill-id>', skill_slug='<slug>')['source_path'])" -
Confirm the docs build still works.
uv run zensical build
server.py Template
from fastmcp import FastMCP
from personal_mcp.skills.document_loader import load_skill_document
<python_namespace>_server = FastMCP("<skill-id>")
@<python_namespace>_server.resource("resource://skills/<skill-id>/document")
def skill_document() -> dict[str, str]:
"""Return the canonical Markdown document for this skill."""
return load_skill_document(
skill_id="<skill-id>",
skill_slug="<slug>",
)
metadata.yaml Template
id: <skill-id>
name: <Human Readable Name>
version: 1.0.0
description: <One sentence describing what the skill provides.>
tags:
- <tag-one>
- <tag-two>
capabilities:
- resource://skills/<skill-id>/document
depends_on: []
Root Mount Template
Add an import in src/personal_mcp/mcp.py:
from personal_mcp.skills.<python_namespace>.server import <python_namespace>_server
Add a mount call:
mcp.mount(<python_namespace>_server, namespace="<python_namespace>")
Example Scaffold
For a new skill called sqlmodel-patterns:
- Docs content lives in
docs/skills/sqlmodel-patterns/SKILL.md. - The Python package lives in
src/personal_mcp/skills/sqlmodel_patterns/. - The resource id is
sqlmodel-patterns.
Example server.py:
from fastmcp import FastMCP
from personal_mcp.skills.document_loader import load_skill_document
sqlmodel_patterns_server = FastMCP("sqlmodel-patterns")
@sqlmodel_patterns_server.resource("resource://skills/sqlmodel-patterns/document")
def skill_document() -> dict[str, str]:
"""Return the canonical Markdown document for this skill."""
return load_skill_document(
skill_id="sqlmodel-patterns",
skill_slug="sqlmodel-patterns",
)
Example metadata.yaml:
id: sqlmodel-patterns
name: SQLModel Patterns
version: 1.0.0
description: Provide reusable patterns for building apps with SQLModel.
tags:
- sqlmodel
- python
- patterns
capabilities:
- resource://skills/sqlmodel-patterns/document
depends_on: []
Example mcp.py additions:
from personal_mcp.skills.sqlmodel_patterns.server import sqlmodel_patterns_server
mcp.mount(sqlmodel_patterns_server, namespace="sqlmodel_patterns")
Bootstrap Sequence
- Create
docs/skills/<slug>/SKILL.md. - Copy the
server.pytemplate intosrc/personal_mcp/skills/<python_namespace>/server.py. - Copy the
metadata.yamltemplate intosrc/personal_mcp/skills/<python_namespace>/metadata.yaml. - Add
__init__.pyin the new package directory. - Import and mount the server in
src/personal_mcp/mcp.py. - Run the validation commands above.