gabriel / musehub public
feat patch mists task/phase5-mist-mcp-tools #1 / 1
gabriel · 65 days ago · Apr 15, 2026 · Diff

feat(mists): Phase 5 — MCP tools, read executors, and resource handlers

Add 7 MCP tools for the Mists domain, wired end-to-end through the tool catalogue, dispatcher, and resource URI router.

Write tools (musehub/mcp/write_tools/mists.py): muse_mist_create — publish content-addressed mist; auto-detects artifact_type, language, symbol_anchors muse_mist_update — partial update (title/description/visibility/tags/content); owner-only; content replacement increments version muse_mist_fork — fork into caller's namespace; enforces depth limit; source fork_count incremented atomically muse_mist_delete — hard-delete mist + backing repo via cascade; owner-only

Read executors (musehub/services/musehub_mcp_executor.py): execute_read_mist — fetch single mist; secret guard; increments view_count execute_list_mists — explore (owner=None) or per-owner; cursor pagination; artifact_type filter; secret include/exclude logic execute_read_mist_embed — iframe/JS/badge embed codes; increments embed_count; public-only

Tool definitions (musehub/mcp/tools/musehub.py): 3 tools added to MUSEHUB_READ_TOOLS (muse_mist_read, muse_mist_list, muse_mist_embed) 4 tools added to MUSEHUB_WRITE_TOOLS (muse_mist_create, muse_mist_update, muse_mist_fork, muse_mist_delete) Total tools: 111

Dispatcher routing (musehub/mcp/dispatcher.py): 7 new elif branches; write tools import lazily from write_tools/mists

Resource URI router (musehub/mcp/resources.py): Templates: musehub://mists/{owner}/{mist_id}, musehub://mists/{owner} Handlers: _read_mist, _read_owner_mists — secret guard; view_count increment

Tests (tests/test_mcp_mist_tools.py, 62 tests, all passing): Layer 1 Unit, Layer 2 Integration, Layer 3 E2E, Layer 4 Stress, Layer 5 Data Integrity, Layer 6 Security, Layer 7 Performance

sha256:865ae60faf0dd8984c1c77516564384b7bf614da993c67db3553d069cd76ba81 sha
sha256:36fd74198a93b3343ea82e0d60f6c8c729164393aa7ede0777f14d0f9ca395bc snapshot
← Older Oldest on task/phase5-mist-mcp-tools
All commits
Newer → Latest on task/phase5-mist-mcp-tools

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:865ae60faf0dd8984c1c77516564384b7bf614da993c67db3553d069cd76ba81 --body "your comment"