UNPKG

sia-vision-mcp-server

Version:

Enhanced v2 MCP server with improved error handling, validation, and comprehensive tool schemas for SIA.Vision storytelling platform

470 lines 19.9 kB
/** * MCP Resources for SIA.Vision * Provides templated resources for storytelling workflows */ // Story Structure Templates with Enhanced Guidance export const storyTemplates = [ { uri: 'resource://sia-vision/story-templates/screenplay-formatting', name: 'Screenplay Formatting Guide', description: 'Complete guide to professional screenplay formatting including sluglines, action lines, dialogue, transitions, and parentheticals. Essential for creating industry-standard scripts.', mimeType: 'application/json', }, { uri: 'resource://sia-vision/story-templates/scene-structure', name: 'Scene Structure Template', description: 'Template for crafting effective scenes with proper sluglines, action setup, character introductions, dialogue, and transitions. Includes examples for different scene types.', mimeType: 'application/json', }, { uri: 'resource://sia-vision/story-templates/character-development', name: 'Character Development Framework', description: 'Comprehensive framework for creating well-developed characters with arcs, motivations, relationships, and backstory elements that drive compelling narratives.', mimeType: 'application/json', }, { uri: 'resource://sia-vision/story-templates/three-act', name: 'Three-Act Structure Template', description: 'Traditional three-act story structure template with setup, confrontation, and resolution', mimeType: 'application/json', }, { uri: 'resource://sia-vision/story-templates/hero-journey', name: "Hero's Journey Template", description: 'Classic hero\'s journey story structure template with 12 stages from ordinary world to return with elixir', mimeType: 'application/json', }, { uri: 'resource://sia-vision/story-templates/save-the-cat', name: 'Save the Cat Beat Sheet', description: 'Blake Snyder\'s 15-beat story structure template for screenwriting and storytelling', mimeType: 'application/json', }, { uri: 'resource://sia-vision/story-templates/short-form-tiktok', name: 'TikTok Short-Form Template', description: 'Optimized story structure for TikTok content with hook, build, payoff in 15-60 seconds', mimeType: 'application/json', }, { uri: 'resource://sia-vision/story-templates/short-form-instagram', name: 'Instagram Reel Template', description: 'Story structure template for Instagram Reels with visual storytelling focus', mimeType: 'application/json', }, ]; // Character Archetype Templates export const characterTemplates = [ { uri: 'resource://sia-vision/character-archetypes/protagonist', name: 'Protagonist Archetype', description: 'Character development template for protagonists with goals, motivations, and character arc', mimeType: 'application/json', }, { uri: 'resource://sia-vision/character-archetypes/antagonist', name: 'Antagonist Archetype', description: 'Character development template for antagonists with opposing forces and motivations', mimeType: 'application/json', }, { uri: 'resource://sia-vision/character-archetypes/mentor', name: 'Mentor Archetype', description: 'Character development template for mentor figures who guide the protagonist', mimeType: 'application/json', }, { uri: 'resource://sia-vision/character-archetypes/ally', name: 'Ally Archetype', description: 'Character development template for supporting characters and allies', mimeType: 'application/json', }, { uri: 'template://character/love-interest', name: 'Love Interest Archetype', description: 'Romantic character template with agency and compelling backstory', mimeType: 'application/json', }, ]; // World-Building Framework Templates export const worldBuildingTemplates = [ { uri: 'resource://sia-vision/world-building/fantasy-realm', name: 'Fantasy Realm Framework', description: 'World-building template for fantasy settings with magic systems, cultures, and geography', mimeType: 'application/json', }, { uri: 'resource://sia-vision/world-building/sci-fi-universe', name: 'Sci-Fi Universe Framework', description: 'World-building template for science fiction settings with technology, societies, and physics', mimeType: 'application/json', }, { uri: 'resource://sia-vision/world-building/modern-setting', name: 'Modern Setting Framework', description: 'World-building template for contemporary settings with realistic locations and social structures', mimeType: 'application/json', }, { uri: 'resource://sia-vision/world-building/modern-urban', name: 'Modern Urban Framework', description: 'Contemporary city setting template with neighborhoods, institutions, and culture', mimeType: 'application/json', }, ]; // Scene Templates export const sceneTemplates = [ { uri: 'template://scene/dialogue-heavy', name: 'Dialogue-Heavy Scene Template', description: 'Character conversation scene with subtext and emotional beats', mimeType: 'application/json', }, { uri: 'template://scene/action-sequence', name: 'Action Sequence Template', description: 'High-energy action scene with pacing and visual descriptions', mimeType: 'application/json', }, { uri: 'template://scene/exposition-reveal', name: 'Exposition Reveal Template', description: 'Information delivery scene that maintains engagement and momentum', mimeType: 'application/json', }, { uri: 'template://scene/climax-confrontation', name: 'Climax Confrontation Template', description: 'Final confrontation scene with emotional and physical stakes', mimeType: 'application/json', }, ]; // Genre Convention Templates export const genreTemplates = [ { uri: 'resource://sia-vision/genre-conventions/horror', name: 'Horror Genre Conventions', description: 'Genre-specific storytelling conventions and tropes for horror narratives', mimeType: 'application/json', }, { uri: 'resource://sia-vision/genre-conventions/romance', name: 'Romance Genre Conventions', description: 'Genre-specific storytelling conventions and tropes for romance narratives', mimeType: 'application/json', }, { uri: 'resource://sia-vision/genre-conventions/mystery', name: 'Mystery Genre Conventions', description: 'Genre-specific storytelling conventions and tropes for mystery narratives', mimeType: 'application/json', }, ]; // MCP Operation Guides export const mcpGuides = [ { uri: 'resource://sia-vision/guides/mcp-playbook', name: 'MCP Operation Playbook', description: 'Step-by-step patterns for LLMs to use SIA tools safely', mimeType: 'application/json', }, { uri: 'resource://sia-vision/guides/node-types-and-hierarchy', name: 'Node Types and Hierarchy', description: 'Canonical node types, parents, and common operations', mimeType: 'application/json', }, { uri: 'resource://sia-vision/guides/document-editing', name: 'Document Editing with JSON Patch', description: 'How to read, patch, and version TipTap documents', mimeType: 'application/json', }, { uri: 'resource://sia-vision/guides/scene-continuous-writer', name: 'Scene Continuous Research Writer', description: 'Loop to research, write, and patch scene documents', mimeType: 'application/json', }, ]; // Combine all resources export const allResources = [ ...storyTemplates, ...characterTemplates, ...worldBuildingTemplates, ...sceneTemplates, ...genreTemplates, ...mcpGuides, ]; // Resource content mapping export const resourceContent = { // Story Structure Templates 'template://story/three-act-structure': { name: 'Three-Act Structure', description: 'Classic narrative structure', structure: { act1: { name: 'Setup', percentage: 25, elements: ['Hook', 'Inciting Incident', 'Plot Point 1'], description: 'Establish characters, world, and central conflict' }, act2: { name: 'Confrontation', percentage: 50, elements: ['Rising Action', 'Midpoint', 'Plot Point 2'], description: 'Develop conflict, obstacles, and character growth' }, act3: { name: 'Resolution', percentage: 25, elements: ['Climax', 'Falling Action', 'Resolution'], description: 'Resolve conflict and character arcs' } }, usage: 'Ideal for feature films, novels, and long-form content' }, 'template://story/heros-journey': { name: "Hero's Journey", description: 'Joseph Campbell\'s monomyth structure', stages: [ 'Ordinary World', 'Call to Adventure', 'Refusal of the Call', 'Meeting the Mentor', 'Crossing the Threshold', 'Tests, Allies, and Enemies', 'Approach to the Inmost Cave', 'Ordeal', 'Reward', 'The Road Back', 'Resurrection', 'Return with the Elixir' ], usage: 'Perfect for character-driven adventures and personal growth narratives' }, 'template://story/short-form-vertical': { name: 'Short-Form Vertical Content', description: 'Template for social media storytelling', structure: { hook: { duration: '0-3 seconds', purpose: 'Grab attention immediately', techniques: ['Visual surprise', 'Bold statement', 'Question'] }, development: { duration: '3-25 seconds', purpose: 'Deliver core content', techniques: ['Quick pacing', 'Visual storytelling', 'Emotional beats'] }, payoff: { duration: '25-30 seconds', purpose: 'Satisfying conclusion', techniques: ['Twist', 'Emotional resolution', 'Call to action'] } }, platforms: ['TikTok', 'Instagram Reels', 'YouTube Shorts'], usage: 'Viral content, brand storytelling, educational content' }, // Character Templates 'template://character/protagonist': { name: 'Protagonist Archetype', description: 'Hero character framework', elements: { background: { ordinary_world: 'Character\'s normal life before the story begins', skills_talents: 'Natural abilities and learned competencies', relationships: 'Family, friends, and significant connections' }, psychology: { want: 'What the character thinks they need', need: 'What the character actually needs for growth', fear: 'Deep-seated fear that creates internal conflict', wound: 'Past trauma that shapes current behavior' }, arc: { inciting_incident: 'Event that forces character into action', resistance: 'Initial reluctance to change', commitment: 'Decision to pursue the goal', growth: 'Learning and adaptation through challenges', transformation: 'Fundamental change in character' } }, usage: 'Central character in any narrative genre' }, 'template://character/antagonist': { name: 'Antagonist Archetype', description: 'Compelling villain framework', elements: { motivation: { goal: 'What the antagonist wants to achieve', justification: 'Why they believe their actions are right', stakes: 'What they stand to lose if they fail' }, methods: { direct_opposition: 'How they directly challenge the protagonist', manipulation: 'Indirect ways they create obstacles', resources: 'Power, allies, and tools at their disposal' }, complexity: { sympathetic_traits: 'Qualities that make them relatable', moral_code: 'Personal rules they follow', vulnerability: 'Weakness or blind spot' } }, usage: 'Primary opposition force in conflict-driven narratives' }, // World-Building Templates 'template://world/fantasy-realm': { name: 'Fantasy Realm Framework', description: 'Complete fantasy world template', elements: { magic_system: { source: 'Where magical power comes from', rules: 'Limitations and costs of magic use', practitioners: 'Who can use magic and how they learn' }, geography: { regions: 'Different areas with distinct characteristics', climate: 'Weather patterns and seasonal changes', resources: 'Natural materials and magical elements' }, cultures: { races_species: 'Different intelligent beings', societies: 'Government, religion, and social structures', conflicts: 'Historical and current tensions' }, history: { creation_myth: 'How the world came to be', major_events: 'Wars, disasters, and turning points', current_era: 'Present-day situation and challenges' } }, usage: 'Epic fantasy, urban fantasy, magical realism' }, // Scene Templates 'template://scene/dialogue-heavy': { name: 'Dialogue-Heavy Scene', description: 'Character conversation framework', structure: { setup: { location: 'Where the conversation takes place', mood: 'Emotional atmosphere of the scene', stakes: 'What each character wants from the conversation' }, development: { subtext: 'What characters really mean vs. what they say', conflict: 'Disagreement or tension between characters', reveals: 'Information disclosed during conversation' }, resolution: { outcome: 'How the conversation ends', change: 'How relationships or understanding shifts', transition: 'How scene connects to next story beat' } }, techniques: ['Interruptions', 'Pauses', 'Body language', 'Environmental details'], usage: 'Character development, exposition, relationship building' }, // MCP Guides Content 'resource://sia-vision/guides/mcp-playbook': { title: 'MCP Operation Playbook', version: 'v2', patterns: [ { name: 'Discover-and-Validate', steps: [ 'List tools and read input schemas', 'Identify the current storyworld context (id provided or fetch list)', 'Fetch hierarchy before creating or moving nodes', 'Never guess IDs; re-read when in doubt' ] }, { name: 'Create-and-Edit-Node', steps: [ 'Call node_create with nodeType, title, and parentId (if not STORYWORLD)', 'Call document_ensure for node types that have documents (SCENE, NOTE, etc.)', 'If editing, prefer apply_document_patch with test op on version then add/replace', 'On 409/conflict, refetch, rebase patch once, retry' ] }, { name: 'Relate-and-Navigate', steps: [ 'Use create_relationship to link nodes (e.g., CHARACTER appears_in SCENE)', 'Use get_related_nodes to traverse graph when needed', 'Use nodes_get and get_content_hierarchy to keep mental model fresh' ] } ], safety: [ 'Never delete without explicit instruction', 'Prefer minimal patches scoped to exact JSON pointers', 'Respect permissions; if a tool is denied, do not retry with mutations' ] }, 'resource://sia-vision/guides/node-types-and-hierarchy': { title: 'Node Types and Hierarchy', types: [ { type: 'STORYWORLD', children: ['SERIES', 'BOARD', 'CHARACTER', 'LOCATION', 'ASSET', 'NOTE'] }, { type: 'SERIES', children: ['EPISODE'] }, { type: 'EPISODE', children: ['SCENE'] }, { type: 'SCENE', children: [], hasDocument: true }, { type: 'NOTE', children: [], hasDocument: true }, { type: 'BOARD', children: [] }, { type: 'CHARACTER', children: [] }, { type: 'LOCATION', children: [] }, { type: 'ASSET', children: [] } ], fields: { common: ['id', 'title', 'nodeType', 'storyworldId', 'parentId', 'orderKey', 'metadata', 'createdAt', 'updatedAt'] }, tips: [ 'Use parentId for non-STORYWORLD creation', 'Order by orderKey ascending for UI parity', 'document_ensure excludes STORYWORLD and BOARD' ] }, 'resource://sia-vision/guides/document-editing': { title: 'Document Editing with JSON Patch', model: 'TipTap JSON', example_read: { tool: 'get_document_view', args: { document_id: '<docId>' }, result: 'blocks with paths and version' }, example_patch: { tool: 'apply_document_patch', args: { document_id: '<docId>', version: 12, ops: [ { op: 'test', path: '/version', value: 12 }, { op: 'add', path: '/content/0', value: { type: 'paragraph', content: [{ type: 'text', text: 'New line' }] } } ] } }, guidance: [ 'Always include a test op against current version to prevent races', 'Add replaces specific array indices; re-read view if indices uncertain', 'Prefer small, iterative patches over large rewrites' ] }, 'resource://sia-vision/guides/scene-continuous-writer': { title: 'Scene Continuous Research Writer', loop: [ 'Ensure document for scene node', 'Fetch get_document_view for current content and version', 'Formulate focused research query (story bible, prior scenes, references)', 'Use search_research and related_nodes to gather facts', 'Draft or revise a small block; apply_document_patch with version test', 'Repeat until goal satisfied; summarize changes' ], failure_modes: [ 'Patch conflict → re-read and rebase', 'Missing scene node → create under EPISODE then ensure document', 'Insufficient permissions → abort with explanation' ] } }; //# sourceMappingURL=index.js.map