Skip to content

Commit 45962b2

Browse files
committed
fix: address PR #1157 review feedback (docs/security/UX)
CodeRabbit + Copilot review fixes that don't touch the generated tool reference. Generator change + regenerated pages come in a follow-up commit. docs: - guides/uv-setup.md: Python requirement was wrongly 3.12+; the server pyproject declares >=3.10. Verify command + body updated to 3.10+. Homebrew tip retains 3.12 as a reasonable default. - getting-started/index.md: drop "(coming soon)" placeholders for Your First Prompt and Choosing an MCP Client — both pages exist in this PR. Setup Wizard remains "coming soon" (not in this PR). - .github/ISSUE_TEMPLATE/bug_report.yml: troubleshooting link pointed at /guides/cursor (deleted earlier in this branch); now points at /guides/troubleshooting which is where that content lives. components: - CopyButton: track setTimeout in a useRef, clear it on unmount and before scheduling a new one. Prevents React "setState on unmounted component" warnings and stops timer-stacking on rapid clicks. - HomeArchitecture diagram <div>: now role="img" with a descriptive aria-label that explains the layer flow, so assistive tech actually announces the diagram instead of skipping it. workflows (security): - docs-deploy.yml, docs-generate.yml: add `persist-credentials: false` on actions/checkout — these jobs never push, so the token shouldn't linger in the checked-out worktree (zizmor `artipacked` warning). - sync-releases.yml: - Workflow-level permissions narrowed to `contents: read`; the `sync` job opts into `contents: write` itself. `drift-check` stays read-only. - drift-check job: was gated on `pull_request` but the workflow had no pull_request trigger — unreachable code. Added a paths-scoped pull_request trigger so PRs touching the sync script or the synced docs run the check. - `sync` job retains `persist-credentials: true` (it pushes back). - drift-check checkout gets `persist-credentials: false`. CodeRabbit comments NOT addressed in this PR and why: - execute_menu_item 'exists' mode, script_apply_edits malformed JSON, find_gameobjects empty param descriptions: all live in the Python tool's source description string under Server/src/services/tools/. Fixing upstream is a separate code PR; the generator faithfully renders whatever source provides. - React 18.3.1 / Docusaurus 3.10.1 bump: out of scope for this docs PR; the lockfile already permits the latest 18.x, and a Docusaurus minor bump is a separate dependency PR. - robots.txt sitemap 404 check: will resolve as soon as Pages serves the site on the canonical URL. Not a real bug. - sidebars.js duplicate roadmap: /architecture/roadmap is the 2026 feature deep-research; /architecture/project-roadmap is the wiki living roadmap. Two distinct docs, intentional. - scripting_ext group blurb: comes from the registry TOOL_GROUPS map; wording tweak not worth touching in a docs PR.
1 parent 033c873 commit 45962b2

8 files changed

Lines changed: 43 additions & 10 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ body:
1010
1111
**Before filing:**
1212
- Search [existing issues](https://github.com/CoplayDev/unity-mcp/issues?q=is%3Aissue) to avoid duplicates
13-
- Check the [troubleshooting docs](https://coplaydev.github.io/unity-mcp/guides/cursor) and [setup wiki](https://github.com/CoplayDev/unity-mcp/wiki)
13+
- Check the [troubleshooting docs](https://coplaydev.github.io/unity-mcp/guides/troubleshooting) and [setup wiki](https://github.com/CoplayDev/unity-mcp/wiki)
1414
1515
- type: textarea
1616
id: what-happened

.github/workflows/docs-deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ jobs:
4949
# can resolve real per-file commit metadata. Shallow clones make every
5050
# page report the latest commit instead.
5151
fetch-depth: 0
52+
# No push back from this workflow — the deploy uses the Pages
53+
# OIDC token issued by actions/deploy-pages, not the repo token.
54+
persist-credentials: false
5255

5356
- name: Setup Node
5457
uses: actions/setup-node@v4

.github/workflows/docs-generate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
steps:
3939
- name: Checkout
4040
uses: actions/checkout@v4
41+
with:
42+
persist-credentials: false
4143

4244
- name: Install uv
4345
uses: astral-sh/setup-uv@v4

.github/workflows/sync-releases.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,21 @@ on:
2222
release:
2323
types: [published, edited, unpublished, deleted]
2424
workflow_dispatch: {}
25+
pull_request:
26+
paths:
27+
- tools/sync_release_notes.py
28+
- website/docs/releases.md
29+
- README.md
30+
- .github/workflows/sync-releases.yml
2531
schedule:
2632
# 11:00 UTC daily — picks up any out-of-band edits to release bodies.
2733
- cron: '0 11 * * *'
2834

35+
# Least-privilege at the workflow level. The `sync` job below opts into
36+
# `contents: write` explicitly because it commits + pushes; `drift-check`
37+
# only reads so it stays read-only.
2938
permissions:
30-
contents: write
39+
contents: read
3140

3241
concurrency:
3342
group: docs-sync-releases
@@ -36,14 +45,19 @@ concurrency:
3645
jobs:
3746
sync:
3847
name: Sync release notes
48+
if: github.event_name != 'pull_request'
3949
runs-on: ubuntu-latest
50+
permissions:
51+
contents: write
4052
steps:
4153
- name: Checkout beta
4254
uses: actions/checkout@v4
4355
with:
4456
ref: beta
4557
# Full history so the commit lands on a fresh ref tip.
4658
fetch-depth: 0
59+
# `sync` needs to push back, so the token must persist here.
60+
persist-credentials: true
4761
token: ${{ secrets.GITHUB_TOKEN }}
4862

4963
- name: Set up Python
@@ -76,6 +90,8 @@ jobs:
7690
runs-on: ubuntu-latest
7791
steps:
7892
- uses: actions/checkout@v4
93+
with:
94+
persist-credentials: false
7995
- uses: actions/setup-python@v5
8096
with:
8197
python-version: '3.12'

website/docs/getting-started/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ MCP for Unity bridges AI assistants — Claude, Codex, VS Code, local LLMs, and
3030
## Next steps
3131

3232
- **[Install](./install.md)** — Add the Unity package, install the Python server, and connect your first MCP client.
33+
- **[Your First Prompt](./first-prompt.md)** — End-to-end "build me a red cube" tutorial.
34+
- **[Choosing an MCP Client](./clients.md)** — A capability matrix across all supported clients.
3335
- **Setup Wizard** *(coming soon)* — Walk through the first-run experience.
34-
- **Your First Prompt** *(coming soon)* — End-to-end "build me a red cube" tutorial.
35-
- **Choosing an MCP Client** *(coming soon)* — A capability matrix across all supported clients.
3636

3737
---
3838

website/docs/guides/uv-setup.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ Clients like Claude Code or JetBrains Rider can get confused if you switch from
2121

2222
## Requirements
2323

24-
You need **Python 3.12+** and the **`uv`** package manager.
24+
You need **Python 3.10+** and the **`uv`** package manager.
2525

2626
### Verify
2727

2828
```bash
29-
python3 --version # should be 3.12+
29+
python3 --version # should be 3.10+
3030
uv --version # should print a version like "uv 0.x"
3131
```
3232

@@ -38,7 +38,7 @@ uv --version # should print a version like "uv 0.x"
3838
# Option A: Official installer (recommended)
3939
# Download from https://www.python.org/downloads/
4040

41-
# Option B: Homebrew
41+
# Option B: Homebrew (3.12 is the latest LTS as of writing; 3.10 also works)
4242
brew install python@3.12
4343
```
4444

website/src/components/CopyButton/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from 'react';
1+
import React, { useState, useRef, useEffect } from 'react';
22
import styles from './styles.module.css';
33

44
/**
@@ -9,6 +9,13 @@ import styles from './styles.module.css';
99
*/
1010
export default function CopyButton({ text, label = 'Copy', className }) {
1111
const [copied, setCopied] = useState(false);
12+
// Timer ref so rapid repeated clicks don't stack pending resets and
13+
// an unmount mid-cooldown doesn't fire setCopied on a dead component.
14+
const timerRef = useRef(null);
15+
16+
useEffect(() => () => {
17+
if (timerRef.current) clearTimeout(timerRef.current);
18+
}, []);
1219

1320
const onClick = async () => {
1421
try {
@@ -27,7 +34,8 @@ export default function CopyButton({ text, label = 'Copy', className }) {
2734
document.body.removeChild(ta);
2835
}
2936
setCopied(true);
30-
setTimeout(() => setCopied(false), 1500);
37+
if (timerRef.current) clearTimeout(timerRef.current);
38+
timerRef.current = setTimeout(() => setCopied(false), 1500);
3139
} catch {
3240
// swallow — the user can still select-and-copy the rendered text
3341
}

website/src/components/HomeArchitecture/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ export default function HomeArchitecture() {
1616
</p>
1717
</div>
1818

19-
<div className={styles.diagram} aria-label="MCP for Unity architecture diagram">
19+
<div
20+
className={styles.diagram}
21+
role="img"
22+
aria-label="MCP for Unity architecture diagram: MCP client connects to the Python server over stdio or HTTP, which talks to the Unity Editor plugin over WebSocket."
23+
>
2024
<Stage
2125
kicker="LAYER 01"
2226
title="MCP Client"

0 commit comments

Comments
 (0)