npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

latexmk-mcp

v1.1.3

Published

MCP server for the latexmk LaTeX build tool

Readme

latexmk-mcp

A Model Context Protocol server that exposes latexmk tooling as MCP tools, allowing any MCP-compatible client or agent to compile, check, clean, and inspect LaTeX documents.

NPM Version NPM Downloads NPM License CI

Prerequisites

  • Node.js 18+
  • latexmk on $PATH — bundled with most TeX distributions (TeX Live, MiKTeX)
  • A TeX distribution with the engines and packages your project requires
# Debian/Ubuntu
sudo apt install latexmk texlive-full

# macOS
brew install --cask mactex

# Arch Linux
sudo pacman -S texlive

Usage

Simply add this to your MCP client configuration:

{
  "mcpServers": {
    "latexmk": {
      "command": "npx",
      "args": ["-y", "latexmk-mcp"]
    }
  }
}

The example above applies for clients such as Gemini CLI, Claude Desktop, etc. The -y flag is omittable for brevity, but is best kept in for unexpected scenarios. Additionally, some tools allow you to add MCP servers imperatively:

codex mcp add latexmk -- npx -y latexmk-mcp

Global install via npm

Alternatively, you can install the package globally and invoke it directly without npx:

npm install -g latexmk-mcp
which latexmk-mcp  # note the absolute path

Then point your MCP client at the resolved binary using node:

{
  "mcpServers": {
    "latexmk": {
      "command": "node",
      "args": ["/absolute/path/to/node/vX.Y.Z/bin/latexmk-mcp"]
    }
  }
}

Development

bun install
bun test
bun run build
node dist/index.js

Tools

latexmk_compile

Full compile of a LaTeX document with configurable engine, output format, bibliography processor, and latexmk flags.

| Parameter | Type | Default | Description | | --------------- | -------------------------------------------- | ---------- | ------------------------------------------------------ | | tex_content | string | — | Raw LaTeX source (mutually exclusive with file_path) | | file_path | string | — | Path to existing .tex file | | output_format | pdf\|dvi\|ps\|xdv | pdf | Target format | | engine | pdflatex\|xelatex\|lualatex\|latex\|pdftex | pdflatex | TeX engine | | bibtex | bibtex\|biber\|none | none | Bibliography processor | | shell_escape | boolean | false | Enable --shell-escape | | synctex | boolean | false | Generate SyncTeX data | | extra_args | string[] | [] | Extra latexmk CLI flags | | working_dir | string | temp dir | Build directory | | return_pdf | boolean | false | Return compiled PDF as base64 when building PDF output |

Returns: success, exit_code, output_file, page_count, structured errors[], structured warnings[], missing_packages[], install_hints[], working_dir, stdout, stderr, and optional pdf_base64.

latexmk_draft_compile

Fast single-pass compile (no reruns, no bibliography) — ideal for quick syntax/error checks while editing.

| Parameter | Type | Default | Description | | ------------- | ------ | ---------- | ------------------- | | tex_content | string | — | Raw LaTeX source | | file_path | string | — | Path to .tex file | | engine | string | pdflatex | TeX engine | | working_dir | string | temp dir | Build directory |

Returns: success, structured errors[], structured warnings[], missing_packages[], install_hints[], stdout, stderr.

latexmk_clean

Remove build artifacts using latexmk -c (auxiliaries only) or latexmk -C (auxiliaries + output files).

| Parameter | Type | Default | Description | | ------------- | ------- | ------------ | ------------------------- | | working_dir | string | required | Directory to clean | | job_name | string | — | Clean a specific job only | | clean_all | boolean | false | -C instead of -c |

latexmk_check

Detect whether latexmk is installed and which TeX engines are available on the system.

Returns: latexmk_available, latexmk_version, latexmk_path, engines_available map.

latexmk_list_dependencies

List all file dependencies of a document (included .tex files, .bib files, packages, images…) via latexmk -deps.

| Parameter | Type | Description | | ------------- | ------ | ------------------- | | tex_content | string | Raw LaTeX source | | file_path | string | Path to .tex file | | working_dir | string | Working directory |

Returns: dependencies[] (deduplicated list of file paths).

latexmk_watch_start / latexmk_watch_stop / latexmk_watch_list

Manage background latexmk -pvc watch sessions. Start returns a session_id; stop terminates it; list shows active sessions with PID, job name, and start time.

latexmk_write_config / latexmk_read_config

Write or inspect .latexmkrc files. The write tool can set engine, output mode, shell escape, extra pdflatex args, and custom Perl rules.

latexmk_list_citations

Extract citation keys from LaTeX source and optionally compare them to a .bib file.

Returns: cited_keys[], cited_count, and when bib_path is provided, bib_entries[], missing_from_bib[], and unused_in_bib[].

License

MIT