Skip to content

Commit a463338

Browse files
authored
Merge branch 'main' into Matvey-Kuk/add-archestra-mcp-apps-support
2 parents 1110e03 + 19cd19b commit a463338

75 files changed

Lines changed: 2015 additions & 3140 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package-lock.json linguist-generated=true
2-
schema/*/schema.json linguist-generated=true
3-
docs/specification/*/schema.md linguist-generated=true
4-
docs/specification/*/schema.mdx linguist-generated=true
5-
docs/seps/index.mdx linguist-generated=true
6-
docs/seps/[0-9]*.mdx linguist-generated=true
2+
3+
# Generated files: linguist-generated collapses them in PR diffs; -merge tells
4+
# git not to attempt a textual merge (keeps the current branch's copy and marks
5+
# the file conflicted). Resolve by re-running `npm run generate` and committing.
6+
schema/*/schema.json linguist-generated=true -merge
7+
docs/specification/*/schema.md linguist-generated=true -merge
8+
docs/specification/*/schema.mdx linguist-generated=true -merge
9+
docs/seps/index.mdx linguist-generated=true -merge
10+
docs/seps/[0-9]*.mdx linguist-generated=true -merge

.github/workflows/cut-release.yml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
name: Cut spec release
2+
3+
# Two paths:
4+
# kind=rc → tag <version>-RC + prerelease GitHub Release on current main.
5+
# Spec content stays under docs/specification/draft/. No PR.
6+
# kind=final → promote draft/ to docs/specification/<version>/ and schema/<version>/,
7+
# open a PR for core-maintainers review. Tagging the GA release is
8+
# handled by the companion `publish-release` job after that PR merges.
9+
10+
on:
11+
workflow_dispatch:
12+
inputs:
13+
version:
14+
description: Spec version (YYYY-MM-DD)
15+
required: true
16+
kind:
17+
description: rc | final
18+
required: true
19+
type: choice
20+
options: [rc, final]
21+
dry_run:
22+
description: Skip the write step (log what would happen)
23+
required: false
24+
default: 'false'
25+
26+
permissions:
27+
contents: write
28+
pull-requests: write
29+
30+
# Never interpolate inputs.* directly into run: — pass via env and reference as
31+
# shell vars so a malicious input can't inject shell.
32+
env:
33+
VERSION: ${{ inputs.version }}
34+
35+
jobs:
36+
rc:
37+
if: inputs.kind == 'rc'
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Validate version
43+
run: |
44+
[[ "$VERSION" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]] || { echo "::error::version must be YYYY-MM-DD"; exit 1; }
45+
# Never publish over an existing tag.
46+
! git ls-remote --exit-code --tags origin "refs/tags/${VERSION}-RC" \
47+
|| { echo "::error::tag ${VERSION}-RC already exists"; exit 1; }
48+
49+
- name: Create RC tag and prerelease
50+
if: inputs.dry_run != 'true'
51+
env:
52+
GH_TOKEN: ${{ github.token }}
53+
TARGET_SHA: ${{ github.sha }}
54+
run: |
55+
cat > /tmp/notes.md <<EOF
56+
This release marks the **release candidate (RC)** \`${VERSION}\` revision of the Model Context Protocol.
57+
58+
The specification is available in [draft form](https://modelcontextprotocol.io/specification/draft).
59+
60+
For a detailed overview of changes, see [${VERSION} draft changelog](https://modelcontextprotocol.io/specification/draft/changelog).
61+
62+
>[!NOTE]
63+
>**To users and implementers:** this specification is not final. Changes may be introduced between the RC and the final release. SDKs will adopt this version at their own pace, and the prior version of the spec may remain in use for an undetermined amount of time.
64+
>
65+
>Refer to the [Version Negotiation documentation](https://modelcontextprotocol.io/specification/draft/basic/lifecycle#version-negotiation) to learn about the process for clients and servers to determine the version of the protocol being used.
66+
EOF
67+
gh release create "${VERSION}-RC" \
68+
--target "$TARGET_SHA" \
69+
--prerelease \
70+
--title "MCP ${VERSION} RC" \
71+
--notes-file /tmp/notes.md
72+
73+
- name: Summary
74+
run: |
75+
echo "tag=${VERSION}-RC" >> "$GITHUB_OUTPUT"
76+
echo "RC ${VERSION} → tag \`${VERSION}-RC\` (prerelease)" >> "$GITHUB_STEP_SUMMARY"
77+
78+
final:
79+
if: inputs.kind == 'final'
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v4
83+
- uses: actions/setup-node@v4
84+
with:
85+
node-version: '20'
86+
cache: npm
87+
88+
- name: Validate version
89+
run: |
90+
[[ "$VERSION" =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]] || { echo "::error::version must be YYYY-MM-DD"; exit 1; }
91+
[[ ! -d "docs/specification/$VERSION" ]] || { echo "::error::docs/specification/$VERSION already exists"; exit 1; }
92+
93+
- name: Promote draft → versioned dir
94+
run: |
95+
set -euo pipefail
96+
cp -r docs/specification/draft "docs/specification/$VERSION"
97+
cp -r schema/draft "schema/$VERSION"
98+
# Stamp the protocolVersion constant the generators read.
99+
sed -i "s|^export const LATEST_PROTOCOL_VERSION = .*|export const LATEST_PROTOCOL_VERSION = \"$VERSION\";|" "schema/$VERSION/schema.ts"
100+
101+
- name: Regenerate schema artifacts
102+
run: |
103+
npm ci
104+
npm run generate
105+
106+
- name: Patch Mintlify nav (docs/docs.json)
107+
run: |
108+
node <<'EOF'
109+
const fs = require('fs');
110+
const V = process.env.VERSION;
111+
const p = 'docs/docs.json';
112+
const j = JSON.parse(fs.readFileSync(p, 'utf8'));
113+
// navigation.tabs[].versions[] where version === 'Draft' is the template.
114+
// Insert a copy as the new "(latest)", strip "(latest)" from the previous one,
115+
// and rewrite page paths draft/ → <V>/.
116+
const rewrite = (o) =>
117+
JSON.parse(JSON.stringify(o).replaceAll('specification/draft', `specification/${V}`));
118+
for (const tab of j.navigation.tabs ?? []) {
119+
const versions = tab.versions;
120+
if (!Array.isArray(versions)) continue;
121+
const draft = versions.find((v) => v.version === 'Draft');
122+
if (!draft) continue;
123+
for (const v of versions)
124+
if (typeof v.version === 'string')
125+
v.version = v.version.replace(' (latest)', '');
126+
const promoted = rewrite(draft);
127+
promoted.version = `Version ${V} (latest)`;
128+
const i = versions.indexOf(draft);
129+
versions.splice(i, 0, promoted);
130+
}
131+
fs.writeFileSync(p, JSON.stringify(j, null, 2) + '\n');
132+
EOF
133+
134+
- name: Reset draft changelog for next cycle
135+
run: |
136+
cat > docs/specification/draft/changelog.mdx <<'EOF'
137+
---
138+
title: Changelog
139+
---
140+
141+
Changes since the most recent release will accumulate here.
142+
EOF
143+
144+
- name: Open release PR
145+
if: inputs.dry_run != 'true'
146+
id: pr
147+
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11
148+
with:
149+
branch: release/${{ inputs.version }}
150+
title: "Add ${{ inputs.version }} MCP specification"
151+
commit-message: "Add ${{ inputs.version }} MCP specification"
152+
labels: release
153+
body: |
154+
Promotes `docs/specification/draft/` and `schema/draft/` to `${{ inputs.version }}`.
155+
156+
Generated by `cut-release.yml` (dispatched from mcp-spec-tpm).
157+
158+
- [ ] Spot-check rendered pages on the preview deploy
159+
- [ ] Confirm `schema/${{ inputs.version }}/schema.json` regenerated cleanly
160+
- [ ] Prior version's `(latest)` suffix removed in `docs/docs.json`
161+
162+
Tagging `${{ inputs.version }}` happens via `publish-release.yml` after merge.
163+
164+
- name: Summary
165+
env:
166+
PR_URL: ${{ steps.pr.outputs.pull-request-url }}
167+
run: |
168+
echo "pr=$PR_URL" >> "$GITHUB_OUTPUT"
169+
echo "Final ${VERSION} → PR ${PR_URL}" >> "$GITHUB_STEP_SUMMARY"
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish spec release
2+
3+
# Companion to cut-release.yml. Creates the GA tag + GitHub Release once the
4+
# `release/<version>` PR has merged to main. Runs only on the merge commit of a
5+
# release branch so a stray push can't publish.
6+
7+
on:
8+
push:
9+
branches: [main]
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
# Only fire for the merge of a release/<YYYY-MM-DD> branch.
18+
if: |
19+
startsWith(github.event.head_commit.message, 'Add ')
20+
&& contains(github.event.head_commit.message, ' MCP specification')
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Derive version from merged release branch
25+
id: v
26+
env:
27+
# Never interpolate event payloads directly into run: — pass via env.
28+
COMMIT_MSG: ${{ github.event.head_commit.message }}
29+
run: |
30+
# COMMIT_MSG is "Add YYYY-MM-DD MCP specification (#NNN)"
31+
V=$(printf '%s' "$COMMIT_MSG" | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}' | head -1)
32+
[[ -n "$V" ]] || { echo "::error::could not parse version from commit message"; exit 1; }
33+
[[ -d "docs/specification/$V" ]] || { echo "::error::docs/specification/$V missing on main"; exit 1; }
34+
echo "version=$V" >> "$GITHUB_OUTPUT"
35+
36+
- name: Create GA release
37+
env:
38+
GH_TOKEN: ${{ github.token }}
39+
VERSION: ${{ steps.v.outputs.version }}
40+
TARGET_SHA: ${{ github.sha }}
41+
run: |
42+
# Idempotent — skip if the tag already exists.
43+
if git ls-remote --exit-code --tags origin "refs/tags/${VERSION}"; then
44+
echo "tag ${VERSION} already exists — skipping"
45+
exit 0
46+
fi
47+
cat > /tmp/notes.md <<EOF
48+
This release marks the \`${VERSION}\` revision of the Model Context Protocol.
49+
50+
The specification is available at [modelcontextprotocol.io/specification/${VERSION}](https://modelcontextprotocol.io/specification/${VERSION}).
51+
52+
For a detailed overview of changes, see the [${VERSION} changelog](https://modelcontextprotocol.io/specification/${VERSION}/changelog).
53+
EOF
54+
gh release create "$VERSION" \
55+
--target "$TARGET_SHA" \
56+
--latest \
57+
--title "MCP ${VERSION}" \
58+
--notes-file /tmp/notes.md

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,19 @@ npm run check:schema:ts
5353
npm run generate:schema
5454
```
5555

56+
### Resolving merge conflicts in generated files
57+
58+
If your branch conflicts with `main` in generated files (`schema/*/schema.json`, `docs/specification/*/schema.mdx`, `docs/seps/*.mdx`), do not resolve them by hand. Merge `main`, resolve any conflicts in the source files (e.g. `schema/draft/schema.ts`), then regenerate and commit:
59+
60+
```bash
61+
git merge main
62+
npm run generate
63+
git add .
64+
git commit
65+
```
66+
67+
These files are marked with `-merge` in `.gitattributes`, so git keeps your branch's copy and flags them as conflicted instead of inserting conflict markers.
68+
5669
## Documentation changes
5770

5871
Documentation is written in MDX format and in the [`docs`](./docs) directory.

0 commit comments

Comments
 (0)