Skip to main content

patchwork-mcp-server

A Model Context Protocol (MCP) server that exposes the Patchwork REST API to LLM-based coding agents (Claude Code, Claude Desktop, Cursor, etc.).

It is a thin, read-only wrapper around /api/1.2/ so you can ask the agent things like:

  • "What's the state of my latest seg6: series on netdev?"
  • "Show me failing CI checks on patch 14553325."
  • "List the cover-letter thread for series 1089407."
  • "Find the patch with Message-Id 20260505-seg6-mobile-v2-0-...."

Without this server, the same questions either require a working ~/.pwclientrc (which has trouble with CI checks and comment threads) or hand-rolled curl against the REST API.

Install

Requires Python 3.10+. Install with uv:

# From PyPI (preferred once published)
uv tool install patchwork-mcp-server

# From a local checkout
uv tool install .

# From a Git remote
uv tool install git+https://github.com/higebu/patchwork-mcp-server

The package installs a patchwork-mcp-server executable into ~/.local/bin/. To refresh an existing install after editing source locally:

uv tool install --reinstall .

Configuration

Variable Default Purpose
PATCHWORK_URL https://patchwork.kernel.org Base URL of the Patchwork instance
PATCHWORK_API_VERSION 1.2 REST API version segment

Read-only access to public Patchwork instances needs no credentials.

Connect to Claude Code

After uv tool install, the executable is on your PATH, so registration needs no path:

claude mcp add patchwork-mcp-server -- patchwork-mcp-server

For Claude Desktop, add it to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "patchwork": {
      "command": "patchwork-mcp-server"
    }
  }
}

Tools

Tool Purpose
list_projects List Patchwork projects on the instance.
find_by_msgid Look up patches/covers by Message-Id (works across projects).
get_series Series with every patch's state, delegate, archived flag, check summary.
get_patch Single patch with submitter, tags, series links, check summary.
get_checks CI checks for a patch (checkpatch, build_, sashiko-, contest, ...). Optional fail_only.
get_comments Comment thread on a cover letter or patch (time-ordered, body preview).
recent_series Recent cover letters on a project, optional submitter filter, optional revision collapse.
search_patches Substring search over patch names, with project/state/submitter filters.

Example interaction

What's the state of my SRv6 Mobile series on netdev?

Behind the scenes the agent calls:

  1. find_by_msgid("20260505-seg6-mobile-v2-0-9e8022bdfdb6@gmail.com") to discover series id 1089407 on netdevbpf.
  2. get_series(1089407) for the per-patch state table.
  3. get_checks(<lead_patch>, fail_only=True) to triage CI.
  4. get_comments("cover", 14117478) to read the thread.

Development

cd patchwork-mcp-server
uv sync --group dev
just check          # ruff lint + format check + pytest

just release patch bumps the version, regenerates CHANGELOG.md via git-cliff, and tags locally. Push the tag to trigger the PyPI release workflow.

License

MIT

Metadata

Release files for patchwork-mcp-server 0.1.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 patchwork-mcp-server 0.1.0
File Size Uploaded Provenance
patchwork_mcp_server-0.1.0.tar.gz 59.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for patchwork-mcp-server 0.1.0
File Interpreter ABI Platform
patchwork_mcp_server-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 68.2 kB

Release files / patchwork_mcp_server-0.1.0.tar.gz

Download URL patchwork_mcp_server-0.1.0.tar.gz
Size 59.5 kB
Tags Source
SHA-256 checksum
How to use checksums
636a81f4f9e5013e9a5e216ec45ef016d23f7e9d84fd158b9d6e16d20db5eb59
BLAKE2b-256 checksum
How to use checksums
d8291ff4ea10608fbad12f6d4562483a628bb9c3d337133d7ae927fa71d49f16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / patchwork_mcp_server-0.1.0-py3-none-any.whl

Download URL patchwork_mcp_server-0.1.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0716fcb0344f43736112b3582f236bc93b2306e3e2c13d8ca3c840c2caf33719
BLAKE2b-256 checksum
How to use checksums
86f3211491df5a9a4a03f055d9029d6611fd1812e3846edabe400af6e20313d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for patchwork-mcp-server 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

0.1.0 This release

2 release files No 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