Skip to main content

modrinth-mcp

An MCP (Model Context Protocol) server built with the official MCP Python SDK v2 (MCPServer) for Modrinth mod/modpack discovery, deterministic Minecraft crash & Spark profiler analysis, local instance inspection, config editing, one-shot version migration, .mrpack inspect/export, snapshot rollback, and $O(\log n)$ crash bisection.

Runtime Modes

Mode Flag Transport Exposed Surface Filesystem Access
Local (default) --mode local stdio All 18 tools + 4 built-in prompts Strictly confined to --allowed-roots / MODRINTH_MCP_ALLOWED_ROOTS (or OS launcher defaults)
Remote --mode remote Streamable HTTP (/mcp, stateless) 6 stateless tools + 4 built-in prompts None

Zero barrier to entry: No API keys, no Modrinth OAuth login, and no required in-game mods (Spark is 100% optional and only used if you already have a Spark link or JSON export).

Safety Guarantees

  • Path-traversal confinement: Every local read/write resolves paths and rejects .., null bytes, and symlinks/junctions escaping allowed instance roots.
  • Dry-run by default: modify_instance_mods, edit_mod_config, and migrate_instance_version default to dry_run=True and automatically snapshot mods/ and config/ (retaining the latest 10 snapshots) before applying changes.
  • SHA-512 verification: Mod downloads are restricted to https://cdn.modrinth.com and verified against Modrinth's SHA-512 hash before placement.
  • Modrinth rate-limit & cache etiquette: Uses a unique User-Agent, batch endpoints (POST /v2/version_files, POST /v2/version_files/update), a sliding-window rate guard (< 300 req/min), and a local SQLite TTL cache.
  • SSRF protection (Spark): Remote URLs in analyze_spark_profile only allow https://spark.lucko.me/<id>.

Quick Start

# Run locally via uvx (stdio, all 18 tools + 4 prompts)
uvx modrinth-mcp --mode local

# Or restrict local filesystem access explicitly
uvx modrinth-mcp --mode local --allowed-roots "C:\Users\you\AppData\Roaming\ModrinthApp"

# Run stateless remote HTTP server on http://127.0.0.1:8000/mcp (6 tools only)
uvx modrinth-mcp --mode remote --host 0.0.0.0 --port 8000

Optional Docker Deployment (Remote Mode)

docker build -t modrinth-mcp .
docker run -p 8000:8000 modrinth-mcp

CLI Options

  • --mode {local,remote} (default: local)
  • --allowed-roots [PATH ...] (overrides MODRINTH_MCP_ALLOWED_ROOTS)
  • --host (default: 127.0.0.1, remote mode only)
  • --port (default: 8000, remote mode only)
  • --user-agent (default: MODRINTH_MCP_USER_AGENT or Arthurofox/modrinth-mcp/1.0.0)
  • --cache-db (default: OS cache directory SQLite file)

Client Configuration Snippets

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "modrinth": {
      "command": "uvx",
      "args": ["modrinth-mcp", "--mode", "local"]
    }
  }
}

Claude Code (1-command CLI or .mcp.json)

claude mcp add modrinth -- uvx modrinth-mcp --mode local
{
  "mcpServers": {
    "modrinth": {
      "command": "uvx",
      "args": ["modrinth-mcp", "--mode", "local"]
    }
  }
}

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "modrinth": {
      "command": "uvx",
      "args": ["modrinth-mcp", "--mode", "local"]
    }
  }
}

Windsurf (~/.codeium/windsurf/mcp_config.json)

{
  "mcpServers": {
    "modrinth": {
      "command": "uvx",
      "args": ["modrinth-mcp", "--mode", "local"]
    }
  }
}

Built-in MCP Prompts

  • fix_crash — Guided crash diagnosis → inspection → minimal dry-run fix (or bisect_crash).
  • upgrade_modpack — Guided migrate_instance_version dry-run → compatibility report → snapshot-backed migration.
  • diagnose_lag — Guided Spark TPS/MSPT + mod-level bottleneck analysis → config/alternative fixes.
  • prepare_server_pack — Guided client-only mod audit (client_only_mods) → optional .mrpack export.

Exposed MCP Tools

A. Modrinth API Tools (Local + Remote)

  1. search_modrinth — Search mods, modpacks, or shaders filtered by mc_version, loader, and project_type.
  2. get_project_details — Compact project summary card (description, categories, license, wiki_url, source_url, issues_url, sides, truncated body).
  3. get_project_versions — List compatible versions and their dependency trees (required, optional, incompatible).
  4. check_compatibility_matrix — Check version availability, missing required deps, and explicit incompatibilities across slugs, project IDs, SHA-512 hashes, or (in local mode) an entire instance_path.

B. Diagnostic & Log Analysis Tools (Local + Remote)

  1. analyze_crash_log — Deterministic parser classifying mixin_conflict, missing_dep, version_mismatch, oom, or unknown from raw_log_text (or local instance_path).
  2. analyze_spark_profile — Parse a https://spark.lucko.me/<id> URL (or local Spark JSON in local mode) into TPS, 95th-percentile MSPT, leaf hotspots, and mod-attributed inclusive share (top_mods).

C. Local Instance & Modpack Inspection Tools (Local Only)

  1. list_instances — Auto-discover Prism Launcher, Modrinth App (legacy & modern app.db), CurseForge App, ATLauncher, and vanilla .minecraft instances.
  2. inspect_instance_mods — Hash mods/*.jar (SHA-512), read fabric.mod.json / META-INF/neoforge.mods.toml, batch-resolve via Modrinth, report missing deps, client_only_mods, and available updates.
  3. list_mod_configs — Discover .toml, .json, .properties, .cfg, .yaml files inside config/ with optional substring filtering.
  4. read_mod_config — Safely read a config file inside config/ with 15 KB line-range pagination.
  5. inspect_mrpack — Audit a .mrpack modpack archive (mods, MC/loader versions, client/server split, overrides count) before installing it.

D. Safe Mutation, Export & Bisection Tools (Local Only)

  1. edit_mod_config — Safely edit files inside config/ with dry_run=True unified diff preview, JSON/TOML syntax validation, and automatic snapshot backup.
  2. modify_instance_mods — install (with transitive include_required_deps=True + conflict warnings), update, disable, enable, or remove mods with dry_run=True default and automatic snapshot backup.
  3. migrate_instance_version — Batch-migrate an instance's mods to a target Minecraft version and loader (dry_run=True default, optional disable_incompatible=True, SHA-512 verified downloads, automatic snapshot backup).
  4. export_mrpack — Export a local instance into a shareable Modrinth .mrpack (modrinth.index.json + overrides/config/ + local-only JARs).
  5. list_snapshots — List available backup snapshots (newest first, auto-pruned to latest 10) with timestamps and reasons.
  6. rollback_snapshot — Restore mods/ and config/ to a prior snapshot_id.
  7. bisect_crash — Stateful $O(\log n)$ binary-search crash isolator (start, report_crashed, report_worked, abort) with pinned_library_mods and automatic snapshot restore on completion or abort.

Development

uv sync --extra dev
uv run ruff check src tests
uv run pytest -v           # offline unit + in-memory MCP tests
uv run pytest -m live -v   # live Modrinth API, Spark, HTTP, and stdio tests

Metadata

Release files for modrinth-mcp 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for modrinth-mcp 1.0.0
File Size Uploaded Provenance Actions
modrinth_mcp-1.0.0.tar.gz 115.4 kB With provenance Details for modrinth_mcp-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for modrinth-mcp 1.0.0
File Interpreter ABI Platform Actions
modrinth_mcp-1.0.0-py3-none-any.whl Python 3 none any Details for modrinth_mcp-1.0.0-py3-none-any.whl

Total release size: 166.2 kB

Release files / modrinth_mcp-1.0.0.tar.gz

Download URL modrinth_mcp-1.0.0.tar.gz
Size 115.4 kB
Tags Source
SHA-256 checksum
How to use checksums
96be2199b5e2eb617af3fd14004ab27dc64d51a09e33fcd822fad64b3ca838b7
BLAKE2b-256 checksum
How to use checksums
fc150b7e8c76f7c431387d18ce43bb7741dd3812ab050cbfe8ad40ecef9bf616
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / modrinth_mcp-1.0.0-py3-none-any.whl

Download URL modrinth_mcp-1.0.0-py3-none-any.whl
Size 50.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
962d6cc3b30ea60c3e0195ba4ef2a648eed3dfe52519f6e46d5fac47ee6ed0c7
BLAKE2b-256 checksum
How to use checksums
bc6fd47ffd375e9aee3bb69a164368b47f7eea97469487e833444298dc441a24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for modrinth-mcp 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for modrinth_mcp-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page