From 260ee785abec88104aaf313416d99cc247c86f63 Mon Sep 17 00:00:00 2001 From: fOuttaMyPaint Date: Sun, 14 Jun 2026 20:59:33 -0400 Subject: [PATCH] docs: reconcile docs to the tag-only release model; read version from package.json The shipped release is tag-only (bump the version in your PR; release.yml tags + creates the release and dispatches publish.yml; no conventional-commit auto-bump, no RELEASE_PAT). Align every doc that still described the abandoned auto-bump design: - .cursorrules, CONTRIBUTING.md, AGENTS.md (branching + code-conventions): 'CI auto-bumps / never edit the version' -> 'bump the version in your PR; CI tags and publishes it'. - CHANGELOG.md: fix the top note; add the [0.1.2] entry (PAT-free tag-only release); reconcile [0.1.1] (it described the auto-bump design 0.1.2 reverted). - CLAUDE.md: version line 0.1.0 -> 0.1.2. - src/index.ts: read the MCP server version from package.json instead of a hardcoded literal, so it tracks the published version. No package.json version bump: release.yml will see v0.1.2 already tagged and skip, so this merge triggers no release and no npm publish. Signed-off-by: fOuttaMyPaint --- .cursorrules | 2 +- AGENTS.md | 12 +++++++----- CHANGELOG.md | 23 ++++++++++++++++------- CLAUDE.md | 2 +- CONTRIBUTING.md | 2 +- src/index.ts | 18 +++++++++++++++++- 6 files changed, 43 insertions(+), 16 deletions(-) diff --git a/.cursorrules b/.cursorrules index b9fd33d..93f15f4 100644 --- a/.cursorrules +++ b/.cursorrules @@ -10,6 +10,6 @@ This is a mcp-server repository for Local AI MCP development. ## Conventions - Use conventional commits (feat:, fix:, chore:, docs:) -- Never manually edit the version -- CI auto-bumps package.json +- Bump the version in `package.json` in your PR; CI tags and publishes it - Keep mcp-tools.json in sync with the registered tools - Provider adapters live in src/providers/; tools live in src/tools/ diff --git a/AGENTS.md b/AGENTS.md index 3b61ac9..9066295 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,10 +19,12 @@ This is an MCP server. It contains: ## Branching and commit model - **Single branch**: `main` only. No develop/release branches. -- **Conventional commits** are required. The release workflow parses them: - - `feat:` or `feat(scope):` -- triggers a **minor** version bump - - `feat!:` or `BREAKING CHANGE` -- triggers a **major** version bump - - Everything else (`fix:`, `chore:`, `docs:`, etc.) -- triggers a **patch** bump +- **Conventional commits** are required. Use them to decide your version bump: + - `feat:` or `feat(scope):` -- bump the **minor** version + - `feat!:` or a `BREAKING CHANGE` trailer -- bump the **major** version + - everything else (`fix:`, `chore:`, `docs:`, etc.) -- bump the **patch** version + + Apply the bump in your PR with `npm version --no-git-tag-version` (keeps `package.json` and the lockfile in sync); `release.yml` tags and publishes that version on merge. CI never writes to `main`. - Commit messages should be concise and describe the "why", not the "what". ## CI/CD workflows @@ -66,7 +68,7 @@ Keeps repository labels in sync. ## Code conventions - No hardcoded credentials -- CI scans for password/token/api_key patterns. -- Conventional commits; never hand-edit the version. +- Conventional commits; bump the version deliberately in your PR (CI tags and publishes it). - Keep `mcp-tools.json` in sync with the tools registered in `src/tools/`. ## Adding content diff --git a/CHANGELOG.md b/CHANGELOG.md index 7aebe99..0345a3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,21 @@ # Changelog All notable changes to Local AI MCP are documented in this file. The format is -based on [Keep a Changelog](https://keepachangelog.com/). Versions are bumped -automatically from conventional commits by the release workflow; never edit the -version by hand. +based on [Keep a Changelog](https://keepachangelog.com/). Bump the version in +each PR (following conventional-commit intent); on merge the release workflow +tags that version and publishes it. ## [Unreleased] +## [0.1.2] - 2026-06-14 + +### Changed + +- Release chain is now PAT-free: `release.yml` uses the default `GITHUB_TOKEN` + to push tags and create the GitHub Release, then explicitly dispatches + `publish.yml` (a `GITHUB_TOKEN` release does not auto-trigger it). Removed the + dependency on `RELEASE_PAT`, which was read-only and could not push. + ## [0.1.1] - 2026-06-14 ### Changed @@ -14,10 +23,10 @@ version by hand. - Docs and metadata now describe an MCP server (provider adapters, tool registration, stdio transport, npx install) instead of cursor-plugin boilerplate. -- Rewrote the release workflow to auto-bump from conventional commits and create - the release with a token that actually triggers publishing; the publish - workflow now runs on a published release or manual dispatch and skips a - version that is already on npm. +- Adopted a tag-only release model compatible with the protected `main` branch: + bump the version in your PR; `release.yml` tags it and creates the release, + and `publish.yml` builds, tests, and publishes (skipping a version already on + npm). CI never writes to `main`. ### Fixed diff --git a/CLAUDE.md b/CLAUDE.md index dd493dc..237db08 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -8,7 +8,7 @@ This file provides guidance for Claude Code when working in this repository. Local AI MCP -- Unified MCP server for managing local model runtimes (Ollama, LM Studio, and more): provider-agnostic discovery, lifecycle, hardware-fit, and delegated inference. -**Version:** 0.1.0 +**Version:** 0.1.2 **License:** CC-BY-NC-ND-4.0 **Author:** TMHSDigital diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7558275..d0f765b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ Use [Conventional Commits](https://www.conventionalcommits.org/): - Add it to `mcp-tools.json` - Add vitest tests -Never hand-edit the version; CI auto-bumps `package.json`. +Bump the version in `package.json` in your PR (e.g. `npm version --no-git-tag-version`); CI tags and publishes it on merge. ## Pull Request Process diff --git a/src/index.ts b/src/index.ts index 9123c2e..0cf8ab3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,7 @@ #!/usr/bin/env node +import { readFileSync } from "node:fs"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { loadConfig } from "./config.js"; @@ -7,13 +10,26 @@ import { ProviderManager } from "./providers/manager.js"; import type { ToolContext } from "./tools/context.js"; import { registerAll } from "./tools/index.js"; +// Read the version from package.json so the server reports the published +// version rather than a hardcoded literal that drifts on every release. +// dist/index.js lives at /dist/, so ../package.json is the manifest +// (npm always includes package.json in the published tarball). +function readVersion(): string { + try { + const pkgPath = join(dirname(fileURLToPath(import.meta.url)), "..", "package.json"); + return JSON.parse(readFileSync(pkgPath, "utf-8")).version ?? "0.0.0"; + } catch { + return "0.0.0"; + } +} + async function main(): Promise { const config = loadConfig(process.env); const manager = new ProviderManager(config); const hardware = createHardwareProbe(); const ctx: ToolContext = { manager, hardware, config }; - const server = new McpServer({ name: "local-ai-mcp", version: "0.1.0" }); + const server = new McpServer({ name: "local-ai-mcp", version: readVersion() }); registerAll(server, ctx); const transport = new StdioServerTransport();