prompts and resources as tools
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastmcp import FastMCP
|
||||
from fastmcp.server.transforms import PromptsAsTools
|
||||
from fastmcp.server.transforms import ResourcesAsTools
|
||||
from mcp_types import Icon
|
||||
|
||||
from .prompts.provider import prompt_lifespan
|
||||
@@ -10,8 +12,9 @@ from .skills import skill_lifespan
|
||||
|
||||
_SERVER_INSTRUCTIONS = """Personal development guidance exposed as native MCP resources and prompts.
|
||||
|
||||
Use prompts for parameterized workflows. For task-specific guidance, browse native skill resources,
|
||||
select one skill://<name>/SKILL.md resource, and read its manifest only when supporting detail is needed.
|
||||
Use prompts for parameterized workflows; tool-only agents can discover and render them with
|
||||
list_prompts and get_prompt. For task-specific guidance, browse native skill resources, select one
|
||||
skill://<name>/SKILL.md resource, and read its manifest only when supporting detail is needed.
|
||||
"""
|
||||
_SERVER_ICON = Icon(
|
||||
src=(
|
||||
@@ -59,6 +62,10 @@ def create_mcp() -> FastMCP:
|
||||
def docs_markdown(path: str) -> dict[str, str]:
|
||||
return read_docs_markdown_path(registry, path)
|
||||
|
||||
# Bridges tool-only clients that cannot browse native resources or prompts directly.
|
||||
mcp.add_transform(ResourcesAsTools(mcp))
|
||||
mcp.add_transform(PromptsAsTools(mcp))
|
||||
|
||||
return mcp
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user