Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,35 @@ jobs:
- run: npm publish --provenance --access public ${{ steps.npm-tag.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-gh-pages:
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs: [publish]

permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches

- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm

- name: Install dependencies
run: npm ci

- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Generate documentation
run: ./scripts/generate-gh-pages.sh ${{ github.ref_name }}

- name: Push to gh-pages
run: git push origin gh-pages
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ pnpm-lock.yaml

# Ignore generated files
src/spec.types.ts

# Jekyll/Liquid template files with special formatting requirements
docs/index.md
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,7 @@ app.listen(3000);

## Documentation

- [SDK API documentation](https://modelcontextprotocol.github.io/typescript-sdk/)
- [Model Context Protocol documentation](https://modelcontextprotocol.io)
- [MCP Specification](https://spec.modelcontextprotocol.io)
- [Example Servers](https://github.com/modelcontextprotocol/servers)
Expand Down
5 changes: 5 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
title: '@modelcontextprotocol/sdk'

# Include generated files and directories which may start with underscores
include:
- '_*'
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# Empty Jekyll front matter to enable Liquid templating (see {{ ... }} below)
---

{% for version in site.data.versions %}
- [v{{ version }}](v{{ version }}/)
{% endfor %}
19 changes: 19 additions & 0 deletions docs/latest/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
# Empty Jekyll front matter to enable Liquid templating (see {{ ... }} below)
---

<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Redirecting to latest documentation...</title>
<meta http-equiv="refresh" content="0; url=../v{{ site.data.versions[0] }}/" />
<link rel="canonical" href="../v{{ site.data.versions[0] }}/" />
</head>
<body>
<p>Redirecting to <a href="../v{{ site.data.versions[0] }}/">latest documentation</a>...</p>
<script>
window.location.href = '../v{{ site.data.versions[0] }}/';
</script>
</body>
</html>
Loading
Loading