# This workflow builds the project, creates packages, and publishes a release.
# It triggers on pushes to the main branch and on tags that start with 'v'.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Release CI
permissions:
contents: write
on:
push:
branches: ["main"]
tags:
- "v*" # Also triggered by tags starting with 'v'
jobs:
build:
runs-on: ubuntu-latest
outputs:
is_prerelease: ${{ steps.prerelease.outputs.is_prerelease }}
steps:
- uses: actions/checkout@v4.1.1
with:
submodules: recursive
- name: Set up Docker environment
run: |
echo "TD_WEB_SERVER_HOST=http://127.0.0.1" >> $GITHUB_ENV
echo "TD_WEB_SERVER_PORT=9981" >> $GITHUB_ENV
- name: Docker Compose Action
uses: hoverkraft-tech/compose-action@v2.2.0
with:
compose-file: "./docker-compose.yml"
down-flags: "--volumes"
services: |
touchdesigner-mcp-server
- name: Extract build artifacts and create package
run: |
# Create a temporary container to extract build artifacts
docker create --name temp-mcp touchdesigner-mcp-server
docker cp temp-mcp:/app/td/modules td/
docker cp temp-mcp:/app/dist ./
docker rm temp-mcp
# Create a package for the td directory
echo "Creating td directory package..."
mkdir -p temp_td
cp td/import_modules.py temp_td/
cp td/mcp_webserver_base.tox temp_td/
cp -r td/modules temp_td/
cd temp_td && zip -r ../touchdesigner-mcp-td.zip .
rm -rf temp_td
echo "Build artifacts extracted and package created!"
- name: Build MCPB package
run: |
# Build MCPB package
npm run build:mcpb
echo "MCPB package created successfully!"
ls -la *.mcpb
- name: Get Node.js project information
id: projectinfo
uses: gregoranders/nodejs-project-info@master
- name: Determine if prerelease
id: prerelease
run: |
VERSION="${{ steps.projectinfo.outputs.version }}"
if [[ "$VERSION" == *"-"* ]] || [[ "$VERSION" == *"beta"* ]] || [[ "$VERSION" == *"alpha"* ]] || [[ "$VERSION" == *"rc"* ]] || [[ "$VERSION" == *"test"* ]]; then
echo "is_prerelease=true" >> $GITHUB_OUTPUT
echo "::notice::Detected prerelease version: $VERSION"
else
echo "is_prerelease=false" >> $GITHUB_OUTPUT
echo "::notice::Detected production version: $VERSION"
fi
- run: |
echo "v${{ steps.projectinfo.outputs.version }}" > TAG_NAME
git tag $(cat TAG_NAME)
git push origin $(cat TAG_NAME)
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.projectinfo.outputs.version }}
name: ${{ steps.projectinfo.outputs.name }} - ${{ steps.projectinfo.outputs.version }} Release
body: |
## Downloads
- **TouchDesigner Components**: [touchdesigner-mcp-td.zip](https://github.com/${{ github.repository }}/releases/download/v${{ steps.projectinfo.outputs.version }}/touchdesigner-mcp-td.zip)
- **MCP Bundle (.mcpb)**: [touchdesigner-mcp.mcpb](https://github.com/${{ github.repository }}/releases/download/v${{ steps.projectinfo.outputs.version }}/touchdesigner-mcp.mcpb)
## Usage
### Quick Start with Claude Desktop and MCP Bundle (Recommended)
1. Download `TouchDesigner Components` and the `MCP Bundle`.
2. Extract the TouchDesigner components from `touchdesigner-mcp-td.zip`.
3. Import `mcp_webserver_base.tox` into your TouchDesigner project.
https://github.com/user-attachments/assets/215fb343-6ed8-421c-b948-2f45fb819ff4
4. Install the bundle in Claude Desktop by double-clicking the `touchdesigner-mcp.mcpb` file.
https://github.com/user-attachments/assets/0786d244-8b82-4387-bbe4-9da048212854
5. The extension will automatically handle the TouchDesigner server connection.
6. If you see a version mismatch warning, follow these steps before reconnecting:
1. Download the latest `touchdesigner-mcp-td.zip` from the releases page.
2. Delete the existing `touchdesigner-mcp-td` folder and replace it with the newly extracted contents.
3. Remove the old `mcp_webserver_base` component from your TouchDesigner project and import the `.tox` from the new folder.
4. Restart TouchDesigner and the AI agent running the MCP server (e.g., Claude Desktop).
### Set up with npx
1. Download and extract the TouchDesigner components from `touchdesigner-mcp-td.zip`.
2. Import `mcp_webserver_base.tox` into your TouchDesigner project.
3. Set up the MCP Server configuration:
```json
{
"mcpServers": {
"touchdesigner": {
"command": "npx",
"args": ["-y", "touchdesigner-mcp-server@latest", "--stdio"]
}
}
}
```
4. If the MCP client reports incompatible server versions, follow the same remediation steps:
1. Download the latest `touchdesigner-mcp-td.zip`.
2. Replace the old `touchdesigner-mcp-td` folder with the new one.
3. Remove the previously imported `mcp_webserver_base`, import the updated `.tox`, and restart TouchDesigner.
4. Restart the AI agent that runs the MCP client.
## Changes
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for a detailed history of changes.
files: |
touchdesigner-mcp.mcpb
touchdesigner-mcp-td.zip
draft: false
prerelease: ${{ steps.prerelease.outputs.is_prerelease == 'true' }}
publish-npm:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/setup-node@v4.0.0
with:
node-version: "24.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- name: Publish to npm
run: |
if [[ "${{ needs.build.outputs.is_prerelease }}" == "true" ]]; then
echo "Publishing prerelease version with 'prerelease' tag..."
npm publish --access public --tag prerelease
else
echo "Publishing production version with 'latest' tag..."
npm publish --access public
fi
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}