renovate-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Timo Hankamer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,115 @@
1
+ # renovate-mcp
2
+
3
+ An MCP server for designing [Renovate](https://github.com/renovatebot/renovate) configurations interactively. Point it at a local repo and let an LLM help you read, validate, preview, and save `renovate.json`.
4
+
5
+ ## What it does
6
+
7
+ Seven tools plus a preset reference:
8
+
9
+ | Tool | What it does |
10
+ | --- | --- |
11
+ | `check_setup` | Report Renovate CLI + validator availability, versions, env overrides, and install hints. Also runs at server startup and embeds the result in the server's `instructions` when anything's missing. |
12
+ | `read_config` | Locate and parse `renovate.json` / `renovate.json5` / `.renovaterc*` / `.github/renovate.json` / `.gitlab/renovate.json` / `package.json#renovate` in a repo — in Renovate's priority order. |
13
+ | `resolve_config` | Expand every `extends` preset against the committed catalogue and return the fully resolved config (offline; no `renovate` invocation). Flags unresolvable entries with a reason. Opt in to fetching `github>` / `gitlab>` presets over HTTPS with `externalPresets: true` (auth via `GITHUB_TOKEN` / `GITLAB_TOKEN` / `RENOVATE_TOKEN`). |
14
+ | `preview_custom_manager` | Preview a `customManagers` (regex) entry against a local repo — offline, no `renovate` invocation. Shows which files match `fileMatch`, which lines match each `matchStrings` regex with named capture groups, and what dep info the template fields produce. Intended for fast regex iteration; run `dry_run` afterwards for full-fidelity confirmation. |
15
+ | `validate_config` | Run `renovate-config-validator` against a file or inline object. |
16
+ | `dry_run` | Run Renovate with `--platform=local --dry-run`, return the structured JSON report (no PRs, no pushes). |
17
+ | `write_config` | Validate, then write a config to disk (temp-file → validate → atomic rename). Refuses to save invalid configs unless `force: true`. |
18
+ | `renovate://presets` (resource) | Markdown index of every built-in preset (1000+), grouped by namespace. Snapshot from the installed `renovate` devDep. |
19
+ | `renovate://preset/{name}` (resource template) | Expanded JSON body (description, extends, packageRules, …) for any single built-in preset. E.g. `renovate://preset/config:recommended`. |
20
+
21
+ ## Requirements
22
+
23
+ - Node.js ≥ 24 (aligns with Renovate's own engine requirement).
24
+ - Renovate available on your `PATH` — either a global install (`npm i -g renovate`) or a project-local install that exposes `renovate` and `renovate-config-validator` via `npm exec`. Only needed for `validate_config`, `dry_run`, and `write_config`; the offline tools (`read_config`, `resolve_config`, `preview_custom_manager`) work without it.
25
+ - Override binary locations with env vars if needed: `RENOVATE_BIN`, `RENOVATE_CONFIG_VALIDATOR_BIN`.
26
+ - Optional for `resolve_config` with `externalPresets: true`: `GITHUB_TOKEN` / `GITLAB_TOKEN` (or `RENOVATE_TOKEN` as a fallback) for fetching presets from private repos or to avoid rate limits.
27
+
28
+ ## Install
29
+
30
+ Once published to npm, no install is needed — `npx` will fetch it on demand. For local development, clone and build:
31
+
32
+ ```bash
33
+ npm install
34
+ npm run build
35
+ ```
36
+
37
+ ## Use with Claude Code
38
+
39
+ Add to `.mcp.json` (project) or `~/.claude.json` (user):
40
+
41
+ ```json
42
+ {
43
+ "mcpServers": {
44
+ "renovate": {
45
+ "command": "npx",
46
+ "args": ["-y", "renovate-mcp"]
47
+ }
48
+ }
49
+ }
50
+ ```
51
+
52
+ For local development, swap to:
53
+
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "renovate": {
58
+ "command": "node",
59
+ "args": ["/absolute/path/to/renovate-mcp/dist/index.js"]
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ ## Use with Claude Desktop
66
+
67
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
68
+
69
+ ```json
70
+ {
71
+ "mcpServers": {
72
+ "renovate": {
73
+ "command": "npx",
74
+ "args": ["-y", "renovate-mcp"]
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ ## Development
81
+
82
+ ```bash
83
+ npm run dev # build watch mode
84
+ npm run typecheck # tsc --noEmit
85
+ npm run build # compile to dist/
86
+ npm start # run the built server over stdio
87
+ npm test # vitest run (builds first)
88
+ npm run test:watch # vitest watch mode
89
+ npm run generate:presets # regenerate src/data/presets.generated.ts from the renovate devDep
90
+ ```
91
+
92
+ The preset catalogue at `src/data/presets.generated.ts` is a committed snapshot of Renovate's built-in presets. Runtime code never imports the `renovate` package — only `scripts/generate-presets.mjs` does. Regenerate after bumping the `renovate` devDependency.
93
+
94
+ CI runs `typecheck`, `build`, and `test` on Node 24 for every PR and push to `main` (see `.github/workflows/ci.yml`).
95
+
96
+ ## Release flow
97
+
98
+ Releases are automated via [release-please](https://github.com/googleapis/release-please) (see `.github/workflows/release.yaml`):
99
+
100
+ 1. Merge Conventional Commits to `main` (`feat:`, `fix:`, etc.)
101
+ 2. release-please opens or updates a release PR that bumps the version and updates `CHANGELOG.md`
102
+ 3. Merging the release PR creates a GitHub release and tag
103
+ 4. The `publish` workflow (`.github/workflows/publish.yml`) fires on the release event, runs the test suite, and runs `npm publish` with provenance
104
+
105
+ Publishing uses [npm Trusted Publishers](https://docs.npmjs.com/trusted-publishers) — no npm token is stored in the repo. Instead the workflow authenticates to npm via OIDC using the `id-token: write` permission. Trusted Publishers must be configured on the npm package settings page before OIDC publishes will succeed; this requires the package to already exist, so the **first release must be published manually once** (`npm login && npm publish` from a clean build), after which Trusted Publishers can be wired up and all subsequent releases go through this workflow.
106
+
107
+ Secrets required on the repo: `RELEASE_PLEASE_TOKEN` (a PAT for release-please). No npm token is needed.
108
+
109
+ ## Design notes
110
+
111
+ - `validate_config`, `dry_run`, and `write_config` shell out to the Renovate CLI rather than importing Renovate as a library — this decouples our Node version from Renovate's (currently Node 24).
112
+ - `resolve_config` and `preview_custom_manager` are fully in-process and never invoke the Renovate CLI, so they work without a Renovate install.
113
+ - `resolve_config` expands `extends` against a committed snapshot of Renovate's built-in presets (`src/data/presets.generated.ts`). External `github>` / `gitlab>` fetching is opt-in, uses each platform's contents API with a 10 s timeout, and caches results per call.
114
+ - `dry_run` uses `--report-type=file` so we get a structured JSON report instead of scraping stdout.
115
+ - `write_config` writes to a temp file, validates, then atomically renames — so a failed validation never leaves a broken config on disk.
@@ -0,0 +1,8 @@
1
+ export interface GeneratedPreset {
2
+ namespace: string;
3
+ description: string | null;
4
+ body: Record<string, unknown>;
5
+ }
6
+ export declare const RENOVATE_VERSION = "43.139.5";
7
+ export declare const PRESETS: Record<string, GeneratedPreset>;
8
+ export declare const PRESET_NAMES: readonly string[];