Implementation:8beeeaaat Touchdesigner mcp syncApiServerVersions
| Knowledge Sources | |
|---|---|
| Domains | Versioning, Release_Management |
| Last Updated | 2026-10-28 22:13 GMT |
Overview
Concrete tool for synchronizing the MCP API version across four files (`pyproject.toml`, `td/modules/utils/version.py`, `src/api/index.yml`, `package.json#mcpCompatibility.expectedApiVersion`) from the current `package.json` version.
Description
The syncApiServerVersions.ts script reads the `version` field from `package.json`, then writes that version into the three API-axis files and updates `mcpCompatibility.expectedApiVersion` in `package.json` itself. It is run by the `npm run version:api` script, which fires as part of `npm version` (alongside `version:mcp`). When the API axis should stay put, the three files are reverted via `git checkout` after this script runs.
Usage
This script is run automatically by `npm version` (via the `version` npm script → `run-p version:*`). Call it directly only for debugging:
npm run version:api
It is Step 5 of the Release Preparation workflow (API axis portion).
Code Reference
Source Location
- Repository: touchdesigner-mcp
- File: scripts/syncApiServerVersions.ts
- Lines: L1-63
Signature
// No exported functions — this is a standalone CLI script.
// Reads package.json version, writes it to four API-axis files.
const packageVersion: string = packageJson.version;
// Writes to:
// 1. pyproject.toml — version = "<version>"
// 2. td/modules/utils/version.py — MCP_API_VERSION = "<version>"
// 3. src/api/index.yml — version: <version>
// 4. package.json — mcpCompatibility.expectedApiVersion = "<version>"
Import
# Not imported — run as a script:
npm run version:api
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| package.json | file | Yes | Must contain a `version` field |
Outputs
| Name | Type | Description |
|---|---|---|
| pyproject.toml | file | `version` field updated |
| td/modules/utils/version.py | file | `MCP_API_VERSION` updated |
| src/api/index.yml | file | `info.version` updated |
| package.json | file | `mcpCompatibility.expectedApiVersion` updated |
Usage Examples
Run via npm
# Fires as part of `npm version` via the `version` script
npm version patch --no-git-tag-version
# This runs: run-p version:api version:mcp
# Or run directly:
npm run version:api
Revert After Bump (API Axis Stays)
# After npm version, revert the three API files:
git checkout HEAD -- src/api/index.yml td/modules/utils/version.py pyproject.toml
npm pkg set mcpCompatibility.expectedApiVersion=1.4.3 # old value