Skip to main content
Glama

Typora MCP

English | 简体中文

MIT License Node.js 20+ MCP

A local-first MCP server for inspecting, debugging, and safely automating a running Typora instance through an opt-in renderer bridge.

WARNING

This is an independent community project. It is not affiliated with or endorsed by Typora, Anthropic, or OpenAI.

Highlights

  • One local MCP server for Codex and Claude Code.

  • Reversible renderer bridge for live DOM, styles, source hashes, console events, and fixture evidence.

  • Structured snapshots and short-lived element refs instead of coordinates.

  • Isolated fixture runs that prove Markdown source was not changed.

Related MCP server: Chrome Live MCP

Requirements

  • Node.js 20 or newer.

  • A local Typora installation.

  • Permission to modify Typora resources only when you explicitly install the bridge.

Install from source

git clone https://github.com/DoubleW2w/typora-mcp.git
cd typora-mcp
npm install
npm run build

This project does not publish an npm package yet. Your client starts the built local checkout.

Connect Codex

codex mcp add typora -- node "<absolute-path-to-typora-mcp>/dist/src/index.js"
codex mcp list

Or use your Codex configuration:

[mcp_servers.typora]
command = "node"
args = ["<absolute-path-to-typora-mcp>/dist/src/index.js"]
cwd = "<absolute-path-to-typora-mcp>"

[mcp_servers.typora.env]
TYPORA_PATH = "D:\\Typora\\Typora.exe"
TYPORA_BACKEND = "standalone"

Plugin distribution status

This source-release version supports the official Codex and Claude Code MCP configuration formats, but is not yet a remote one-click plugin. A marketplace cache does not include this project's Node dependencies. Use the source install above, then add the local STDIO server directly.

A remote Codex/Claude plugin will be released after this project ships either an npm package or a GitHub Release bundle containing its runtime dependencies.

Connect Claude Code

From your cloned repository, run:

claude mcp add typora -- node "<absolute-path-to-typora-mcp>/dist/src/index.js"
claude mcp get typora

The committed .mcp.json is a project-scoped Claude Code configuration. It starts the built dist/src/index.js from the local checkout root.

Install or update the bridge

Installing the MCP server does not change Typora. First ask the MCP client:

Check Typora bridge status. If it is not installed, install it.

The explicit typora_install_bridge tool backs up window.html once, adds a marker-scoped deferred script loader, writes typora-mcp-bridge.js, and requires a normal Typora restart. typora_uninstall_bridge removes only this project's marker block and bridge script.

First prompt

Check Typora status, then explain whether the standalone bridge is installed,
connected, and safe to use for the current document.

Tool overview

Category

Tools

Purpose

Discovery

typora_status, typora_capabilities, typora_bridge_status

Find Typora, targets, bridge state, and supported operations.

Bridge lifecycle

typora_install_bridge, typora_uninstall_bridge

Explicit marker-scoped bridge management.

Inspection

typora_snapshot, get_dom, query_selector, get_element, typora_get_document_source

Inspect renderer state, DOM, styles, and source hashes.

Safe actions

click, type, press_key, scroll

Operate DOM controls; editor typing requires explicit allowSourceEdit opt-in.

Lifecycle

typora_launch, typora_close, typora_restart, typora_open_document

Manage MCP-owned Typora instances.

Fixtures

typora_run_fixture

Run read-only JSON fixtures and write separate evidence.

Flight Recorder

typora_diagnostic_start, typora_diagnostic_status, typora_diagnostic_finish, typora_diagnostic_report, typora_diagnostic_cleanup

Record a local redacted timeline and retain compressed diagnostic archives.

Debug evidence

get_console_logs, get_javascript_errors, get_network_requests

Read cursor-based events.

Debug capture

typora_enable_debug_network_capture, typora_disable_debug_network_capture

Temporarily capture fetch/XHR traffic.

Optional capabilities are declared by typora_capabilities. Standalone mode does not provide screenshots or external CDP. execute_javascript appears only when Debug Mode and its separate token are configured.

Fixtures and evidence

Fixtures live below TYPORA_MCP_FIXTURE_ROOT. Each default run starts an isolated MCP-owned Typora profile. Evidence is written below TYPORA_MCP_EVIDENCE_ROOT/runId:

  • run.json

  • source.json

  • snapshot.json

  • events.json

  • assertions.json

  • screenshot.png when supported and requested

    npm test npm run test:live

Flight Recorder

Start a named run before reproducing a bug:

Start a Typora diagnostic run named "menu-click-no-response".

Then ask the agent to reproduce and investigate the problem. End with:

Finish the current Typora diagnostic run, then return its diagnostic report.

The recorder stores a local redacted timeline under %LOCALAPPDATA%/typora-mcp/diagnostics by default. Full run directories remain for 14 days; older runs are compressed into dated archives and retained. When archives exceed 2 GB, MCP reports a storage warning without deleting evidence.

Security and limits

  • The bridge listens only on 127.0.0.1 and authenticates every call with a local token.

  • Bridge installation is explicit and reversible.

  • Normal mode does not expose arbitrary JavaScript evaluation.

  • Network capture is off by default and restores original fetch/XHR functions.

  • Editor typing is disabled by default. Install the standalone bridge with allowSourceEdit: true to enable it, then open a new Typora window (or restart Typora normally). typora_capabilities reports sourceEdit for each window. The existing type behavior is unchanged: clear defaults to true and replaces the target element's contents. Use clear: false to insert at the caret or replace the current text selection. Fixtures always reject editor input, even when allowSourceEdit is enabled. Existing windows keep their previous setting. This option does not enable arbitrary JavaScript or change other backends.

  • Diagnostic traces omit bridge tokens, Markdown bodies, input text, and arbitrary JavaScript expressions by default.

Repository layout

src/                 MCP server, bridge, fixtures, and adapters
test/                Unit and live Typora verification
docs/specs/          V1 product contract
.mcp.json            Project-scoped Claude Code MCP configuration

Contributing

Issues and pull requests are welcome. Include a focused reproduction or fixture for behavior changes. Never commit Typora installation files, tokens, or local evidence.

License

MIT

Available Tools

28 tools
clear_debug_eventsA
DestructiveIdempotent

Clear captured debug events for one renderer or all renderers without resetting sequence numbers.

Inputs: targetId.

clickB
Destructive

Click a visible element through Playwright/CDP; pass index when the selector matches more than one.

Inputs: ref, index, selector, targetId, +1 more.

get_console_logsC
Read-only

Read captured console events, optionally only those after a previous sequence number.

Inputs: limit, levels, afterSeq, targetId.

get_domC
Read-only

Read bounded HTML, visible text, or an accessibility snapshot from Typora.

Inputs: ref, format, maxChars, selector, +2 more.

get_elementC
Read-only

Inspect one element's attributes, geometry, computed styles, accessibility, and event listeners.

Inputs: ref, index, selector, targetId, +4 more.

get_javascript_errorsC
Read-only

Read captured uncaught errors and unhandled promise rejections.

Inputs: limit, afterSeq, targetId.

get_network_requestsC
Read-only

Read captured request, response, and failure events; response bodies are opt-in and bounded.

Inputs: limit, afterSeq, targetId, urlPattern, +2 more.

press_keyC
Destructive

Press a Playwright key on a selected element or the active page.

Inputs: key (required), ref, index, selector, +2 more.

query_selectorB
Read-only

List concise, serializable summaries for elements matching a CSS selector.

Inputs: selector (required), limit, targetId.

scrollC

Scroll an element or the selected Typora page by a pixel delta.

Inputs: deltaY (required), ref, deltaX, selector, +2 more.

send_cdp_commandA
Destructive

Send an arbitrary Chrome DevTools Protocol command when the selected backend exposes CDP; standalone mode does not.

Inputs: method (required), params, targetId.

take_screenshotB
Read-only

Capture the selected Typora page or one matching element as a PNG image.

Inputs: fullPage, selector, targetId.

typeC
Destructive

Enter text into a selected Typora element through Playwright/CDP.

Inputs: text (required), ref, clear, index, +3 more.

typora_bridge_statusB
Read-only

Inspect the explicit standalone renderer bridge installation without changing Typora.

Inputs: executablePath.

typora_capabilitiesA
Read-only

Read the selected Typora target's explicitly supported debugging and automation capabilities before invoking an optional operation.

Inputs: targetId.

typora_closeA
DestructiveIdempotent

Close Typora normally so unsaved prompts can appear; force termination only when force is true.

Inputs: force.

typora_disable_debug_network_captureA
DestructiveIdempotent

Restore the target's original fetch/XHR functions after explicit debug network capture.

Inputs: targetId.

typora_enable_debug_network_captureA
DestructiveIdempotent

Explicitly enable temporary fetch/XHR network capture for one standalone target. It does not cover IPC, WebSocket, or every internal network channel.

Inputs: targetId.

typora_get_document_sourceB
Read-only

Read the current saved Markdown source through the standalone bridge without modifying it; use its sourceHash to prove renderer-side code did not rewrite the file.

Inputs: maxChars, targetId.

typora_install_bridgeA
DestructiveIdempotent

Explicitly back up Typora window.html and install the standalone local renderer bridge. Restart Typora afterward to load it.

Inputs: token, registryDir, executablePath.

typora_launchC
Idempotent

Find and launch Typora with CDP enabled, then wait until a renderer is ready.

Inputs: filePath, debugPort, extraArgs, userDataDir, +2 more.

typora_open_documentB
Destructive

Open an existing Markdown document in the selected renderer and wait until Typora confirms its path. Fixture validation uses a stricter MCP-owned launch flow.

Inputs: path (required), targetId.

typora_reloadA
DestructiveIdempotent

Reload the selected Typora renderer when the selected backend supports safe renderer reload. Standalone mode refuses location.reload; use typora_restart for MCP-managed instances.

Inputs: targetId, ignoreCache.

typora_restartA
DestructiveIdempotent

Restart only a Typora instance launched by this MCP server. It never restarts an externally launched instance that might have unsaved work.

Inputs: no named parameters.

typora_run_fixtureA
Destructive

Run a declarative JSON fixture from the configured fixture root and write separate evidence. Shared targets require explicit opt-in and are never closed or restarted.

Inputs: fixturePath (required), targetId, allowSharedTarget.

typora_snapshotB
Read-only

Create a bounded structured renderer snapshot with a short-lived snapshotRef and revision; prefer this over returning complete HTML.

Inputs: limit, maxNodes, selector, targetId, +2 more.

typora_statusA
Read-only

Inspect Typora processes, CDP connectivity, renderer windows, current file, and latest debug event sequence.

Inputs: no named parameters.

typora_uninstall_bridgeA
DestructiveIdempotent

Remove only the Typora MCP bridge injection and its bridge script. The first pre-install backup is retained.

Inputs: executablePath.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 28 tools

    Disambiguation4/5

    Most tools target clearly distinct purposes (lifecycle, bridge management, debug capture, interaction). There is mild overlap among the DOM-reading group (get_dom, typora_snapshot, query_selector, get_element), but descriptions explicitly steer between them (snapshot preferred over full HTML), so an agent can disambiguate.

    Naming Consistency4/5

    Nearly all tools follow a verb_noun convention, which is readable and predictable. The main deviation is the inconsistent presence of the typora_ prefix: some tools are prefixed (typora_status, typora_launch) while others are bare (get_dom, click, type), so the namespace is split across two styles.

    Tool Count3/5

    At 28 tools this is on the heavy side for a single-application automation server. The surface is defensible given the breadth (process control, bridge, DOM, CDP, debug, interaction), but several tools could plausibly be consolidated, pushing it above the well-scoped 3-15 range.

    Completeness4/5

    Coverage spans process lifecycle, bridge install/uninstall, document opening, source reading, DOM inspection, CDP, debug event capture, and user interactions like click/type/scroll/screenshot. Gaps exist (no explicit document save or new-document creation), but core workflows are well covered.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects to Obsidian's Electron process via Chrome DevTools Protocol, enabling AI assistants to screenshot, execute JavaScript, capture console logs, and automate UI actions for debugging plugins and testing layouts.
      ISC
    • A
      license
      Not graded
      quality
      B
      maintenance
      Connects local stdio MCP servers to an existing Chrome 144+ session, preserving the user's signed-in sessions, cookies, tabs, and extension environment without launching a second browser. It provides tab control, semantic snapshots, screenshots, pointer, keyboard, form selection, scrolling, navigation, and waiting tools.
      MIT
    • A
      license
      D
      quality
      B
      maintenance
      Connects to an already-running Chrome/Chromium instance over CDP and exposes 75 browser-automation tools over newline-delimited MCP JSON-RPC on stdin/stdout, covering navigation, forms, keyboard/mouse input, screenshots, cookies, storage, tabs and frames, assertions, and retry/batch/step composition. It does not launch a browser itself, requiring a localhost debugging port on the existing instance.
      75
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Exposes browser tabs to any MCP client through a local broker, letting agents discover pages, take text snapshots with numbered elements, and drive them via click, type, navigate, eval, network/log inspection, and screenshots. Supports stdio, Streamable HTTP, and SSE transports so IDE and CLI agents can orchestrate browser automation.
      MIT