{"$schema":"https://modelcontextprotocol.io/schema/mcp-server-card.json","name":"unseen-workflow-compiler","title":"Unseen Workflow Compiler","version":"0.1.0","protocolVersion":"2024-11-05","supportedProtocolVersions":["2025-11-25","2025-06-18","2025-03-26","2024-11-05"],"capabilities":{"tools":true,"prompts":true,"resources":true},"instructions":"Unseen Workflow Compiler turns SOPs, compliance policies, spreadsheets, playbooks, and multi-actor processes into source-grounded workflow visuals (clean SVG, Mermaid, Excalidraw, and interactive Studio links).\n\nOPERATING RULES:\n1. Prefer Host-LLM Native Mode ($0 Unseen credits, <50ms): Read the full document in your own context first, synthesize a bounded VisualSpec v0.1 JSON (`{ schemaVersion: '0.1', kind: 'flowchart', title, summary, sources: [{ id, locator, excerpt }], nodes: [{ id, label, role: 'step'|'decision'|'concept', actor?, detail?, sourceIds }], edges: [{ from, to, label?, sourceIds }] }`), and call `compile_workflow({ spec })`. Only pass raw `{ text }` or `{ sources }` when you explicitly want Unseen's server-side AI pipeline (which uses monthly allowance/credits).\n2. Inspect embedded diagrams & tables before claiming missing steps: Copy diagram step order and edges into their own cited source excerpt with locator (e.g. `p.9 figure: process map`).\n3. Stay source-grounded: Preserve documented rejection paths, exceptions, approvals, thresholds, and timing. Every outgoing edge from a `decision` node MUST carry a source-backed `label`. Never invent missing branches; surface ambiguity or contradictions cleanly.\n4. Present & self-heal: Render the returned `svg` / `svgUrl` / `mermaid` directly in chat alongside the optional `studioUrl`. Fix structural or connector warnings yourself via `autofix_workflow`, `revise_workflow`, or `compile_workflow({ spec })` ($0 credits).\n5. Built-in Skill & Contract: Read MCP resources `unseen://skills/unseen-workflow-compiler/SKILL.md` and `unseen://contract/visual-spec-v0.1` for the full workflow skill and schema bounds, or invoke built-in prompts (`compile-sop-host-llm`, `audit-workflow-gaps`, `revise-workflow-from-feedback`). Call `send_feedback` (no auth required, never include raw docs or PII) if a tool errors or behaves unexpectedly.","agentSkillsIndexUrl":"https://unseendocs.in/.well-known/agent-skills/index.json","description":"Create, autofix, enhance, and revise workflow diagrams from supplied business evidence, raw text, or Host-LLM VisualSpec v0.1 JSON ($0 credits), with source references and SVG/Mermaid/Excalidraw output. Supports OAuth 2.1 PKCE browser sign-in, 1Password for Agents autofill, and Agent & Human Email+OTP login.","endpoint":"https://unseendocs.in/mcp/oauth","transports":["streamable-http","sse","stdio"],"remotes":[{"type":"streamable-http","url":"https://unseendocs.in/mcp/oauth"},{"type":"streamable-http","url":"https://unseendocs.in/mcp"},{"type":"streamable-http","url":"https://unseendocs.in/mcp/chatgpt"}],"transport":{"type":"http","endpoint":"/mcp/oauth","url":"https://unseendocs.in/mcp/oauth","encoding":"json-rpc-2.0"},"auth":{"type":"oauth2","authorizationUrl":"https://unseendocs.in/oauth/authorize","tokenUrl":"https://unseendocs.in/oauth/token","registrationUrl":"https://unseendocs.in/oauth/register","resourceMetadataUrl":"https://unseendocs.in/.well-known/oauth-protected-resource/mcp/oauth","authorizationServerMetadataUrl":"https://unseendocs.in/.well-known/oauth-authorization-server"},"authentication":{"type":"oauth2","resourceMetadataUrl":"https://unseendocs.in/.well-known/oauth-protected-resource/mcp/oauth","authorizationServerMetadataUrl":"https://unseendocs.in/.well-known/oauth-authorization-server"},"documentationUrl":"https://unseendocs.in/agents","tools":[{"name":"compile_workflow","title":"Compile Workflow Diagram","description":"Turn supplied document evidence, raw operational text, OR a Host-LLM VisualSpec v0.1 JSON (`spec`) into a publication-ready workflow diagram with source references, clean vector SVG, Mermaid, Excalidraw scene, and interactive Studio deep link (`studioUrl`). THREE INPUT MODES: (1) HOST-LLM NATIVE MODE ($0 free, unlimited once signed in, <50ms — ALWAYS PREFER THIS WHEN YOU HAVE A HOST LLM): Construct `spec` (VisualSpec v0.1 JSON: `{schemaVersion:'0.1', kind:'flowchart', title, summary, sources:[{id,locator,excerpt}], nodes:[{id,label,role:'step'|'decision'|'concept',actor?,detail?,sourceIds:[...]}], edges:[{from,to,label?,sourceIds:[...]}]}` where outgoing edges from `decision` nodes MUST have a `label`) using your own LLM and pass `{ spec }`. Unseen deterministically validates citations, heals connectors, and renders SVG/Mermaid/Excalidraw/studioUrl at $0 Unseen credits even when server-AI credits are 0 (returning exact validation errors if anything needs self-correction). (2) RAW TEXT MODE (PAID / USES ALLOWANCE): Passing ONLY `{ text: '...' }` without `spec` uses Unseen's server-side AI pipeline and returns HTTP 402 if free monthly slots/credits are 0 — if that happens, switch to Mode 1 (`{ spec }`) for $0. (3) STRUCTURED SOURCES MODE (PAID / USES ALLOWANCE): Passing ONLY `{ sources: [{id, locator, excerpt}, ...] }` without `spec` uses Unseen's server-side AI pipeline (requires free monthly slot or credits). EDITING GUIDANCE: For cosmetic edits, edit `<svg>` XML directly. For structural edits, edit `spec` JSON and call `compile_workflow({ spec })` or `autofix_workflow({ spec })` ($0 free).","annotations":{"title":"Compile Workflow Diagram","readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":false},"inputSchema":{"type":"object","properties":{"schemaVersion":{"type":"string","enum":["0.1"],"description":"Protocol envelope version (defaults to '0.1')"},"spec":{"type":"object","description":"Optional Host-LLM pre-synthesized VisualSpec v0.1 JSON (`{schemaVersion:'0.1', kind:'flowchart', title, summary, sources, nodes, edges}`). When supplied, Unseen skips server-LLM generation ($0 credits, <50ms) and deterministically validates citations, heals connectors, and compiles SVG + Mermaid + Excalidraw + studioUrl."},"requestId":{"type":"string","description":"Optional client request correlation ID"},"jobId":{"type":"string","description":"Optional job ID when resuming a workflow after clarification"},"userGoal":{"type":"string","description":"The overarching operational goal or process description (defaults to `spec.title` or the first line of `text`/`sources` if omitted)"},"text":{"type":"string","description":"Optional raw document or user text. If provided when `sources` is omitted or empty, Unseen automatically segments `text` into faithful `sources[]` chunks."},"renderFormat":{"type":"string","enum":["full","preview","compact","svg","mermaid"],"description":"Optional output size control (defaults to 'full'). Use 'preview' for compact metadata + svgUrl + mermaid without large inline Excalidraw/SVG blobs, or 'svg'/'mermaid' for a single format."},"includeSvg":{"type":"boolean","description":"Explicitly include or omit inline SVG XML (defaults to true for 'full' and 'svg', false for 'preview'/'compact'/'mermaid')."},"includeExcalidraw":{"type":"boolean","description":"Explicitly include or omit inline Excalidraw scene JSON (defaults to true only for 'full')."},"maxPreviewWidth":{"type":"number","description":"Target preview width bound in px for responsive preview metadata (default 1200)."},"maxPreviewHeight":{"type":"number","description":"Target preview height bound in px for responsive preview metadata (default 900)."},"desiredOutput":{"type":"object","properties":{"orientation":{"type":"string","enum":["portrait","landscape","choose"],"description":"Desired visual orientation"},"depth":{"type":"string","enum":["macro","detailed","choose"],"description":"Desired workflow abstraction depth"},"granularity":{"type":"string","enum":["overview","subprocess","all"],"description":"Target scope level: 'overview' for parent lifecycle summary (~8-12 steps), 'subprocess' when paired with focusSourceIds, or 'all'."},"swimlane":{"type":"boolean","description":"Optional swimlane layout toggle (defaults to automatic swimlanes when 2+ actor groups exist)"}}},"focusSourceIds":{"type":"array","description":"Optional subset of source IDs to focus on when compiling a specific subprocess or phase returned by detect_workflows.","items":{"type":"string"}},"sources":{"type":"array","description":"Array of faithful source excerpts with locators from the input document (1..60 chunks, <=2000 chars each). Preserve exact thresholds, actors, and IF/ELSE branches.","items":{"type":"object","required":["id","locator","excerpt"],"properties":{"id":{"type":"string","description":"Unique chunk ID (e.g. 's1', 's2')"},"name":{"type":"string","description":"Document or file name"},"locator":{"type":"string","description":"Heading, page, or section locator"},"excerpt":{"type":"string","description":"Faithful document excerpt (do not rewrite)"},"modality":{"type":"string","enum":["text","image","diagram","table"],"description":"Optional evidence modality ('text', 'image', 'diagram', or 'table')."},"confidence":{"type":"string","enum":["verbatim","reviewed","inferred"],"description":"Optional evidence grounding confidence ('verbatim', 'reviewed', or 'inferred')."}}}},"evidenceCoverage":{"type":"object","description":"Optional document preflight coverage report from the host agent (`pagesExamined`, `totalPages`, `textExtracted`, `tablesExtracted`, `embeddedDiagramsDetected`, `omittedMedia`, `notes`). When omitted media or uninspected diagrams are reported, Unseen flags `EVIDENCE_NOT_INSPECTED`.","properties":{"pagesExamined":{"type":"number"},"totalPages":{"type":"number"},"textExtracted":{"type":"boolean"},"tablesExtracted":{"type":"boolean"},"embeddedDiagramsDetected":{"type":"number"},"omittedMedia":{"type":"array","items":{"type":"string"}},"notes":{"type":"string"}}},"hostContext":{"type":"object","description":"Optional advisory context observed by the host agent","properties":{"actors":{"type":"array","items":{"type":"string"}},"ambiguities":{"type":"array","items":{"type":"string"}},"contradictions":{"type":"array","items":{"type":"string"}},"assumptions":{"type":"array","items":{"type":"string"}},"userContext":{"type":"array","items":{"type":"string"}}}},"priorAnswers":{"type":"array","description":"Answers to prior Unseen clarification questions when resuming a compilation","items":{"type":"object","required":["questionId","answer","source"],"properties":{"questionId":{"type":"string"},"answer":{"description":"User's answer to the clarification question"},"source":{"type":"string","enum":["user","document","host-context"]}}}}}},"securitySchemes":[{"type":"oauth2","scopes":["workflow:compile"]}]},{"name":"revise_workflow","title":"Revise Workflow Diagram","description":"Apply explicit node label/role changes or node removal using node IDs, or request connector autofix. For other changes, including new steps or edges, edit the returned spec with confirmed source evidence and call autofix_workflow. Unsupported instructions return an error; this tool does not perform general natural-language rewrites.","annotations":{"title":"Revise Workflow Diagram","readOnlyHint":false,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"inputSchema":{"type":"object","required":["spec","instruction"],"properties":{"spec":{"type":"object","description":"The existing VisualSpec object to revise"},"instruction":{"type":"string","description":"Clear revision instruction (e.g. 'Change node-2 role to decision and label to Finance Approval?', 'Remove orphan node-4', 'Autofix layout connections')"},"additionalSources":{"type":"array","description":"Optional additional source evidence excerpts to support the revision","items":{"type":"object","required":["id","locator","excerpt"],"properties":{"id":{"type":"string","description":"Unique chunk ID"},"locator":{"type":"string","description":"Heading or section locator"},"excerpt":{"type":"string","description":"Faithful document excerpt"}}}},"renderFormat":{"type":"string","enum":["full","preview","compact","svg","mermaid"],"description":"Optional output size control (defaults to 'full'). Use 'preview' for compact metadata + svgUrl + mermaid without large inline Excalidraw/SVG blobs, or 'svg'/'mermaid' for a single format."},"includeSvg":{"type":"boolean","description":"Explicitly include or omit inline SVG XML (defaults to true for 'full' and 'svg', false for 'preview'/'compact'/'mermaid')."},"includeExcalidraw":{"type":"boolean","description":"Explicitly include or omit inline Excalidraw scene JSON (defaults to true only for 'full')."},"maxPreviewWidth":{"type":"number","description":"Target preview width bound in px for responsive preview metadata (default 1200)."},"maxPreviewHeight":{"type":"number","description":"Target preview height bound in px for responsive preview metadata (default 900)."}}},"securitySchemes":[{"type":"oauth2","scopes":["workflow:compile"]}]},{"name":"autofix_workflow","title":"Autofix & Re-Render Workflow ($0 Free)","description":"Deterministic connector healing and full visual re-rendering ($0 compute cost, instant, unlimited). Cleans exact duplicate edges and empty sequence labels, recomputes deterministic orthogonal layout, and returns fresh `spec`, `svg`, `mermaid`, `excalidraw`, and `studioUrl`. Missing steps or branches require source-backed edits to the spec; this tool preserves graph meaning and does not perform semantic verification. Use this tool after making direct structural edits to `VisualSpec` JSON (`nodes` / `edges`), or when a user asks to autofix connectors.","annotations":{"title":"Autofix & Re-Render Workflow","readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":false},"inputSchema":{"type":"object","required":["spec"],"properties":{"spec":{"type":"object","description":"The VisualSpec JSON object to deterministically heal and re-render into SVG, Mermaid, and Excalidraw."},"orientation":{"type":"string","enum":["portrait","landscape","choose"],"description":"Optional layout orientation (defaults to topology auto-orientation)."},"swimlane":{"type":"boolean","description":"Optional swimlane layout toggle (defaults to automatic swimlanes when 2+ actor groups exist)."},"renderFormat":{"type":"string","enum":["full","preview","compact","svg","mermaid"],"description":"Optional output size control (defaults to 'full'). Use 'preview' for compact metadata + svgUrl + mermaid without large inline Excalidraw/SVG blobs, or 'svg'/'mermaid' for a single format."},"includeSvg":{"type":"boolean","description":"Explicitly include or omit inline SVG XML (defaults to true for 'full' and 'svg', false for 'preview'/'compact'/'mermaid')."},"includeExcalidraw":{"type":"boolean","description":"Explicitly include or omit inline Excalidraw scene JSON (defaults to true only for 'full')."},"maxPreviewWidth":{"type":"number","description":"Target preview width bound in px for responsive preview metadata (default 1200)."},"maxPreviewHeight":{"type":"number","description":"Target preview height bound in px for responsive preview metadata (default 900)."}}},"securitySchemes":[{"type":"oauth2","scopes":["workflow:compile"]}]},{"name":"enhance_workflow","title":"AI Enhance Workflow (TypeSafe Jev Audit & Repair)","description":"Bundled free semantic verification and repair powered by TypeSafe Jev. Audits the VisualSpec against its cited `sources[]` for unsupported claims, missing decision branches, and role accuracy, applies targeted repair if actionable issues are found, and returns the enhanced `spec`, `svg`, `mermaid`, `excalidraw`, `studioUrl`, and Jev quality metrics.","annotations":{"title":"AI Enhance Workflow","readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":false},"inputSchema":{"type":"object","required":["spec"],"properties":{"spec":{"type":"object","description":"The current VisualSpec JSON object (including its `sources` array) to audit and enhance."},"visualId":{"type":"string","description":"The `jobId` or `visualId` returned when the workflow was compiled."},"renderFormat":{"type":"string","enum":["full","preview","compact","svg","mermaid"],"description":"Optional output size control (defaults to 'full'). Use 'preview' for compact metadata + svgUrl + mermaid without large inline Excalidraw/SVG blobs, or 'svg'/'mermaid' for a single format."},"includeSvg":{"type":"boolean","description":"Explicitly include or omit inline SVG XML (defaults to true for 'full' and 'svg', false for 'preview'/'compact'/'mermaid')."},"includeExcalidraw":{"type":"boolean","description":"Explicitly include or omit inline Excalidraw scene JSON (defaults to true only for 'full')."},"maxPreviewWidth":{"type":"number","description":"Target preview width bound in px for responsive preview metadata (default 1200)."},"maxPreviewHeight":{"type":"number","description":"Target preview height bound in px for responsive preview metadata (default 900)."}}},"securitySchemes":[{"type":"oauth2","scopes":["workflow:compile"]}]},{"name":"detect_workflows","title":"Detect Candidate Workflows in Document","description":"Discover distinct operational workflows from multi-section documents or raw text before compiling. Returns candidate workflows (`id`, `title`, `description`, `sourceIds`) audited by TypeSafe Jev.","annotations":{"title":"Detect Candidate Workflows","readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"inputSchema":{"type":"object","properties":{"sources":{"type":"array","description":"Array of source excerpts `{id, locator, excerpt, modality?, confidence?}` from the document.","items":{"type":"object","required":["id","locator","excerpt"],"properties":{"id":{"type":"string","description":"Unique chunk ID (e.g. 's1', 's2')"},"name":{"type":"string","description":"Document or file name"},"locator":{"type":"string","description":"Heading, page, or section locator"},"excerpt":{"type":"string","description":"Faithful document excerpt (do not rewrite)"},"modality":{"type":"string","enum":["text","image","diagram","table"],"description":"Optional evidence modality ('text', 'image', 'diagram', or 'table')."},"confidence":{"type":"string","enum":["verbatim","reviewed","inferred"],"description":"Optional evidence grounding confidence ('verbatim', 'reviewed', or 'inferred')."}}}},"evidenceCoverage":{"type":"object","description":"Optional document preflight coverage report from the host agent (`pagesExamined`, `totalPages`, `textExtracted`, `tablesExtracted`, `embeddedDiagramsDetected`, `omittedMedia`, `notes`). When omitted media or uninspected diagrams are reported, Unseen flags `EVIDENCE_NOT_INSPECTED`.","properties":{"pagesExamined":{"type":"number"},"totalPages":{"type":"number"},"textExtracted":{"type":"boolean"},"tablesExtracted":{"type":"boolean"},"embeddedDiagramsDetected":{"type":"number"},"omittedMedia":{"type":"array","items":{"type":"string"}},"notes":{"type":"string"}}},"text":{"type":"string","description":"Optional raw document text if `sources` is not pre-segmented."},"granularity":{"type":"string","enum":["overview","subprocess","all"],"description":"Hierarchy detail hint: 'overview' (parent + phases summary), 'subprocess', or 'all' (default)."}}},"securitySchemes":[{"type":"oauth2","scopes":["workflow:compile"]}]},{"name":"get_workflow","title":"Get Compiled Workflow","description":"Retrieve an existing VisualSpec workflow by jobId or visualId, returning the spec, SVG layout, and Mermaid diagram.","annotations":{"title":"Get Compiled Workflow","readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"inputSchema":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"The jobId or visualId of the workflow to retrieve"},"renderFormat":{"type":"string","enum":["full","preview","compact","svg","mermaid"],"description":"Optional output size control (defaults to 'full'). Use 'preview' for compact metadata + svgUrl + mermaid without large inline Excalidraw/SVG blobs, or 'svg'/'mermaid' for a single format."},"includeSvg":{"type":"boolean","description":"Explicitly include or omit inline SVG XML (defaults to true for 'full' and 'svg', false for 'preview'/'compact'/'mermaid')."},"includeExcalidraw":{"type":"boolean","description":"Explicitly include or omit inline Excalidraw scene JSON (defaults to true only for 'full')."},"maxPreviewWidth":{"type":"number","description":"Target preview width bound in px for responsive preview metadata (default 1200)."},"maxPreviewHeight":{"type":"number","description":"Target preview height bound in px for responsive preview metadata (default 900)."}}},"securitySchemes":[{"type":"oauth2","scopes":["workflow:read"]}]},{"name":"get_account_status","title":"Get Agent Account & Credit Status","description":"Check the authenticated user's Unseen credit balance, free monthly server-AI generation allowance, uniform 100-page safety limit per visual (Host-LLM spec compilation uses 0 credits), and 1-click prepaid credit refill link (`https://unseendocs.in/#pricing`). Call this before server-AI compilations or when credits are low.","annotations":{"title":"Get Account & Credit Status","readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"inputSchema":{"type":"object","properties":{}},"securitySchemes":[{"type":"oauth2","scopes":["workflow:read"]}]},{"name":"send_feedback","title":"Send Feedback To The Unseen Team","description":"Report a bug, a missing capability, or an improvement idea about Unseen's tools or output to the Unseen team. No sign-in needed and free. Use it whenever a tool errors, behaves unexpectedly, or you had to work around something. Describe the problem in your own words (what you called, what you expected, what happened). Never include document contents, personal data or credentials.","annotations":{"title":"Send Feedback","readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":false},"inputSchema":{"type":"object","properties":{"kind":{"type":"string","enum":["bug","improvement","worked_well"],"description":"Type of feedback (defaults to 'improvement')."},"tool":{"type":"string","description":"Optional tool name the feedback is about, e.g. compile_workflow."},"message":{"type":"string","description":"What happened and what you would change (max 1500 characters). No document contents."},"errorCode":{"type":"string","description":"Optional short error code or errorKind observed (e.g. 'unsupported_edit', 'not_found')."},"expectedBehavior":{"type":"string","description":"Optional concise description of what you expected (max 300 chars, no document contents)."},"observedBehavior":{"type":"string","description":"Optional concise description of what happened instead (max 300 chars, no document contents)."},"buildVersion":{"type":"string","description":"Optional client/deployment version or environment hint (max 64 chars)."},"jobId":{"type":"string","description":"Optional related workflow jobId/visualId (max 80 chars)."}},"required":["message"]},"securitySchemes":[{"type":"oauth2","scopes":["workflow:compile"]}]}]}