From 406fd63a07a38359c0e7471921361b2e9463401a Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Sat, 20 Jun 2026 19:40:43 -0500 Subject: [PATCH] better copilot integration --- docs/copilot.md | 9 +++++++++ docs/usage.md | 8 ++++++++ src/personal_mcp/mcp.py | 28 ++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/docs/copilot.md b/docs/copilot.md index 3983899..def30fa 100644 --- a/docs/copilot.md +++ b/docs/copilot.md @@ -69,6 +69,15 @@ When resource attachment is unavailable in the active session, use ResourcesAsTo 4. `get_pattern_by_id` 5. `get_skill_document_by_id` +Canonical naming policy: + +1. Prefer the five canonical tool names above in prompts and instructions. +2. For compatibility with clients that emit `catalog_*` naming, the server also exposes: + - `catalog_search_patterns` + - `catalog_get_pattern_by_id` + - `catalog_get_skill_document_by_id` +3. Canonical and compatibility alias tools return equivalent payloads for the same input. + The first two are generated from the canonical resource surface and should be preferred in tool-only clients. These should stay read-only, minimal, and schema-aligned with catalog resources. diff --git a/docs/usage.md b/docs/usage.md index 64e6088..b752375 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -204,6 +204,14 @@ Preferred tool fallback order: 4. `get_pattern_by_id` 5. `get_skill_document_by_id` +Compatibility aliases for clients that use `catalog_*` naming are also available: + +1. `catalog_search_patterns` +2. `catalog_get_pattern_by_id` +3. `catalog_get_skill_document_by_id` + +Use canonical names first; aliases exist only to preserve interoperability when a client emits non-canonical names. + If confidence is low after discovery, ask one clarifying question before loading more context. ``` diff --git a/src/personal_mcp/mcp.py b/src/personal_mcp/mcp.py index f9038aa..ba24217 100644 --- a/src/personal_mcp/mcp.py +++ b/src/personal_mcp/mcp.py @@ -185,4 +185,32 @@ def get_skill_document_by_id(skill_id: str) -> dict[str, Any]: } +@mcp.tool +def catalog_search_patterns( + query: str = "", + tags: list[str] | None = None, + skip: int = 0, + limit: int = 20, +) -> dict[str, Any]: + """Compatibility alias for clients expecting catalog_* tool naming.""" + return search_patterns( + query=query, + tags=tags, + skip=skip, + limit=limit, + ) + + +@mcp.tool +def catalog_get_pattern_by_id(id: str) -> dict[str, Any]: + """Compatibility alias for clients expecting catalog_* tool naming.""" + return get_pattern_by_id(id) + + +@mcp.tool +def catalog_get_skill_document_by_id(skill_id: str) -> dict[str, Any]: + """Compatibility alias for clients expecting catalog_* tool naming.""" + return get_skill_document_by_id(skill_id) + + _install_tool_fallback_transforms()