Skip to content

@mrsf/mcp

Model Context Protocol (MCP) server for Sidemark — the Markdown Review Sidecar Format (MRSF).

License: MITMRSF v1.0 Draft@mrsf/mcp on npmnpm downloads (mcp)MCP Compatible

Exposes Sidemark and MRSF (Markdown Review Sidecar Format) operations as MCP tools and resources so that AI assistants (Claude Desktop, Cursor, VS Code Copilot, etc.) can review Markdown documents, inspect existing comment threads, add review feedback, resolve comments, validate sidecars, and re-anchor comments through the standard MCP protocol.

Installation

bash
npm install -g @mrsf/mcp

Or use directly:

bash
npx @mrsf/mcp

Quick Start — Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):

json
{
  "mcpServers": {
    "mrsf": {
      "command": "npx",
      "args": ["-y", "@mrsf/mcp"]
    }
  }
}

Restart Claude Desktop — the MRSF tools will appear automatically.

Quick Start — VS Code / Cursor

Add to your project's .vscode/mcp.json:

json
{
  "servers": {
    "mrsf": {
      "command": "npx",
      "args": ["-y", "@mrsf/mcp"]
    }
  }
}

Transport Options

FlagDefaultDescription
--transport stdioStandard I/O (Claude Desktop, Cursor, VS Code)
--transport sseServer-Sent Events over HTTP
--port <n>3001Port for SSE transport
bash
# Default — stdio
mrsf-mcp

# SSE on custom port
mrsf-mcp --transport sse --port 8080

Tools

The server exposes the following MCP tools:

ToolDescription
mrsf_discoverFind the sidecar for a Markdown document
mrsf_validateValidate sidecars against the MRSF schema
mrsf_reanchorRe-anchor comments after a document has been edited
mrsf_addAdd a new review comment to a sidecar
mrsf_add_batchAdd multiple review comments in one atomic call
mrsf_updateUpdate fields of an existing comment by ID
mrsf_resolveResolve or unresolve comments by ID(s) or filters
mrsf_listList and filter comments (status, author, type, severity) with full or compact output
mrsf_statusCheck anchor health (fresh / stale / orphaned)
mrsf_renameUpdate a sidecar after its document has been renamed
mrsf_deleteDelete a comment by ID (with optional cascade)
mrsf_repairRepair or reset a corrupted sidecar
mrsf_helpList all tools and their parameter schemas

Tool Details

mrsf_discover

Find the Sidemark (MRSF) sidecar for a Markdown document.

ParameterTypeRequiredDescription
documentstringPath to the Markdown document
cwdstringWorking directory (defaults to process.cwd())

mrsf_validate

Validate one or more Sidemark (MRSF) sidecars.

ParameterTypeRequiredDescription
filesstring[]Sidecar or Markdown file paths. If omitted, discovers all sidecars in the workspace.
strictbooleanTreat warnings as errors
cwdstringWorking directory

mrsf_reanchor

Re-anchor comments after document edits.

ParameterTypeRequiredDescription
filesstring[]Sidecar or Markdown file paths. If omitted, discovers all sidecars.
dryRunbooleanReport without modifying files
thresholdnumberFuzzy match threshold 0.0–1.0 (default 0.6)
updateTextbooleanAlso replace selected_text with current document text
forcebooleanFirmly anchor high-confidence results: update commit to HEAD and clear audit fields
cwdstringWorking directory

mrsf_add

Add a review comment to a Sidemark (MRSF) sidecar.

ParameterTypeRequiredDescription
documentstringPath to the Markdown document
textstringComment text
authorstringAuthor identifier (e.g. 'Name (handle)')
linenumberStarting line number (1-based)
end_linenumberEnding line number (inclusive)
start_columnnumberStarting column (0-based)
end_columnnumberEnding column
typestringComment type: suggestion, issue, question, accuracy, style, clarity
severity"low" | "medium" | "high"Severity level
reply_tostringParent comment ID for threading
extensionsobjectTool-specific x_* extension fields; keys must start with x_
cwdstringWorking directory

mrsf_add_batch

Add multiple review comments to a Sidemark (MRSF) sidecar in one atomic write.

ParameterTypeRequiredDescription
documentstringPath to the Markdown document
commentsobject[]Array of comments: each needs text and author, optional line, end_line, start_column, end_column, type, severity, reply_to, extensions
cwdstringWorking directory

mrsf_update

Update fields of an existing comment by ID (only provided fields are changed).

ParameterTypeRequiredDescription
documentstringPath to the Markdown document or its sidecar
idstringComment ID to update
textstringNew comment text
typestringNew type: suggestion, issue, question, accuracy, style, clarity
severity"low" | "medium" | "high"New severity level
linenumberNew starting line number (1-based)
end_linenumberNew ending line number (inclusive)
start_columnnumberNew starting column (0-based)
end_columnnumberNew ending column
extensionsobjectMerge tool-specific x_* fields into the comment
cwdstringWorking directory

extensions values are stored on disk as flat x_* fields on the comment, not as a nested object.

mrsf_resolve

Resolve or unresolve comments. Provide a single id, an array of ids, or filters.

ParameterTypeRequiredDescription
documentstringPath to the Markdown document or its sidecar
idstringSingle comment ID to resolve/unresolve
idsstring[]Array of comment IDs to resolve/unresolve
authorstringResolve all comments by this author
typestringResolve all comments of this type
severity"low" | "medium" | "high"Resolve all comments of this severity
unresolvebooleanSet to true to unresolve instead
cwdstringWorking directory

mrsf_list

List and filter comments across Sidemark (MRSF) sidecars.

ParameterTypeRequiredDescription
filesstring[]Sidecar or Markdown file paths. If omitted, discovers all sidecars.
openbooleanOnly show unresolved comments
resolvedbooleanOnly show resolved comments
authorstringFilter by author
typestringFilter by type
severity"low" | "medium" | "high"Filter by severity
format"full" | "compact"Output format: full (JSON) or compact (text table)
summarybooleanReturn summary statistics instead of full comments
cwdstringWorking directory

mrsf_status

Check anchor health of all comments in Sidemark (MRSF) sidecars.

ParameterTypeRequiredDescription
filesstring[]Sidecar or Markdown file paths. If omitted, discovers all sidecars.
cwdstringWorking directory

mrsf_rename

Update sidecar after a document rename/move.

ParameterTypeRequiredDescription
oldDocumentstringOld path to the Markdown document
newDocumentstringNew path to the Markdown document
cwdstringWorking directory

mrsf_delete

Delete a comment by ID from a sidecar. By default, direct replies are promoted (they inherit the parent's anchor and their reply_to is re-pointed to the grandparent). Use cascade to delete direct replies along with the parent instead.

ParameterTypeRequiredDescription
documentstringPath to the Markdown document or its sidecar
idstringComment ID to delete
cascadebooleanWhen true, also remove direct replies instead of promoting them (default: false)
cwdstringWorking directory

mrsf_repair

Repair or reset a corrupted sidecar. Use salvage strategy to attempt recovering parseable comments from a corrupted sidecar (rewrites it cleanly). Use reset strategy to delete the sidecar and start fresh with an empty comment list.

ParameterTypeRequiredDescription
documentstringPath to the Markdown document or its sidecar
strategy"salvage" | "reset"Repair strategy: salvage (default) attempts to recover comments; reset starts fresh
cwdstringWorking directory

mrsf_help

List all available Sidemark (MRSF) MCP tools with their parameter schemas. Optionally filter to a specific tool for detailed parameter info.

ParameterTypeRequiredDescription
toolstringTool name to get detailed help for (e.g. mrsf_add). Omit to list all tools.

Resources

The server also exposes MCP resources for direct data access:

URI PatternDescription
mrsf://sidecar/{path}Full parsed Sidemark (MRSF) sidecar as JSON
mrsf://comment/{path}/{id}A single review comment from a sidecar
mrsf://anchors/{path}Anchor health status for all comments in a sidecar

Agent Skill Example

The repository includes a ready-to-use Agent Skill that teaches AI agents to review Markdown documents using the MCP server. See the skill on GitHub.

Copy it into your project:

bash
cp -r examples/mrsf-review .agent/skills/

The skill instructs the agent to discover sidecars, add anchored comments with type and severity, validate results, and summarize findings — all through the MCP tools above.

Requirements

  • Node.js ≥ 18
  • @mrsf/cli (installed automatically as a dependency)

License

MIT

Released under the MIT License.