Skip to content

Commit 73ccc7d

Browse files
committed
Merge branch 'main' into feat/url-elicitation
2 parents 744a5bc + 9f06b6b commit 73ccc7d

File tree

117 files changed

+46408
-37902
lines changed

Some content is hidden

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

117 files changed

+46408
-37902
lines changed

.github/workflows/main.yml

Lines changed: 62 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,67 @@
11
on:
2-
push:
3-
branches:
4-
- main
5-
pull_request:
6-
release:
7-
types: [published]
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
release:
7+
types: [published]
88

99
concurrency:
10-
group: ${{ github.workflow }}-${{ github.ref }}
11-
cancel-in-progress: true
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
1212

1313
jobs:
14-
build:
15-
runs-on: ubuntu-latest
16-
17-
steps:
18-
- uses: actions/checkout@v4
19-
- uses: actions/setup-node@v4
20-
with:
21-
node-version: 18
22-
cache: npm
23-
24-
- run: npm ci
25-
- run: npm run build
26-
- run: npm test
27-
- run: npm run lint
28-
29-
publish:
30-
runs-on: ubuntu-latest
31-
if: github.event_name == 'release'
32-
environment: release
33-
needs: build
34-
35-
permissions:
36-
contents: read
37-
id-token: write
38-
39-
steps:
40-
- uses: actions/checkout@v4
41-
- uses: actions/setup-node@v4
42-
with:
43-
node-version: 18
44-
cache: npm
45-
registry-url: 'https://registry.npmjs.org'
46-
47-
- run: npm ci
48-
49-
- run: npm publish --provenance --access public
50-
env:
51-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 24
22+
cache: npm
23+
24+
- run: npm ci
25+
- run: npm run check
26+
- run: npm run build
27+
28+
test:
29+
runs-on: ubuntu-latest
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
node-version: [18, 24]
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: actions/setup-node@v4
38+
with:
39+
node-version: ${{ matrix.node-version }}
40+
cache: npm
41+
42+
- run: npm ci
43+
- run: npm test
44+
45+
publish:
46+
runs-on: ubuntu-latest
47+
if: github.event_name == 'release'
48+
environment: release
49+
needs: [build, test]
50+
51+
permissions:
52+
contents: read
53+
id-token: write
54+
55+
steps:
56+
- uses: actions/checkout@v4
57+
- uses: actions/setup-node@v4
58+
with:
59+
node-version: 24
60+
cache: npm
61+
registry-url: 'https://registry.npmjs.org'
62+
63+
- run: npm ci
64+
65+
- run: npm publish --provenance --access public
66+
env:
67+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish Any Commit
2+
permissions:
3+
contents: read
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- '**'
9+
tags:
10+
- '!**'
11+
12+
jobs:
13+
pkg-publish:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 24
21+
cache: npm
22+
23+
- run: npm ci
24+
- name: Build
25+
run: npm run build
26+
- name: Publish
27+
run: npx pkg-pr-new publish
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Update Spec Types
2+
3+
on:
4+
schedule:
5+
# Run nightly at 4 AM UTC
6+
- cron: '0 4 * * *'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
update-spec-types:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '24'
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Fetch latest spec types
29+
run: npm run fetch:spec-types
30+
31+
- name: Check for changes
32+
id: check_changes
33+
run: |
34+
if git diff --quiet src/spec.types.ts; then
35+
echo "has_changes=false" >> $GITHUB_OUTPUT
36+
else
37+
echo "has_changes=true" >> $GITHUB_OUTPUT
38+
LATEST_SHA=$(grep "Last updated from commit:" src/spec.types.ts | cut -d: -f2 | tr -d ' ')
39+
echo "sha=$LATEST_SHA" >> $GITHUB_OUTPUT
40+
fi
41+
42+
- name: Create Pull Request
43+
if: steps.check_changes.outputs.has_changes == 'true'
44+
env:
45+
GH_TOKEN: ${{ github.token }}
46+
run: |
47+
git config user.name "github-actions[bot]"
48+
git config user.email "github-actions[bot]@users.noreply.github.com"
49+
50+
git checkout -B update-spec-types
51+
git add src/spec.types.ts
52+
git commit -m "chore: update spec.types.ts from upstream"
53+
git push -f origin update-spec-types
54+
55+
# Create PR if it doesn't exist, or update if it does
56+
PR_BODY="This PR updates \`src/spec.types.ts\` from the Model Context Protocol specification.
57+
58+
Source file: https://github.com/modelcontextprotocol/modelcontextprotocol/blob/${{ steps.check_changes.outputs.sha }}/schema/draft/schema.ts
59+
60+
This is an automated update triggered by the nightly cron job."
61+
62+
if gh pr view update-spec-types &>/dev/null; then
63+
echo "PR already exists, updating description..."
64+
gh pr edit update-spec-types --body "$PR_BODY"
65+
else
66+
gh pr create \
67+
--title "chore: update spec.types.ts from upstream" \
68+
--body "$PR_BODY" \
69+
--base main \
70+
--head update-spec-types
71+
fi

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ web_modules/
6969
# Output of 'npm pack'
7070
*.tgz
7171

72-
# Output of 'npm run fetch:spec-types'
73-
spec.types.ts
74-
7572
# Yarn Integrity file
7673
.yarn-integrity
7774

.prettierignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Ignore artifacts:
2+
build
3+
dist
4+
coverage
5+
*-lock.*
6+
node_modules
7+
**/build
8+
**/dist
9+
.github/CODEOWNERS
10+
pnpm-lock.yaml
11+
12+
# Ignore generated files
13+
src/spec.types.ts

.prettierrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"printWidth": 140,
3+
"tabWidth": 4,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "none",
8+
"bracketSpacing": true,
9+
"bracketSameLine": false,
10+
"proseWrap": "always",
11+
"arrowParens": "avoid",
12+
"overrides": [
13+
{
14+
"files": "**/*.md",
15+
"options": {
16+
"printWidth": 280
17+
}
18+
}
19+
]
20+
}

0 commit comments

Comments
 (0)