Add API documentation with GitHub Pages deployment#181
Merged
koic merged 1 commit intomodelcontextprotocol:mainfrom Nov 27, 2025
Merged
Add API documentation with GitHub Pages deployment#181koic merged 1 commit intomodelcontextprotocol:mainfrom
koic merged 1 commit intomodelcontextprotocol:mainfrom
Conversation
This adds automated deployment of a versioned API documentation landing
page using GitHub Pages. The landing page links to documentation hosted
on RubyDoc.info, the de facto standard documentation site for the Ruby
ecosystem. The landing page will update to reflect new releases.
Changes
-------
1. **Documentation generation script** (see `bin/generate-gh-pages.sh`)
Copies and commits documentation files to the gh-pages branch. The
script uses git worktrees to isolate the process from the main
workspace.
The script:
- Creates the gh-pages branch as an orphan branch if it doesn't exist
- Parses semantic versions from tag names, ignoring arbitrary
prefixes (e.g., tags `1.2.3`, `v1.2.3`, and `release-1.2.3` all
create `v1.2.3`)
- Determines the latest version using semantic version sorting
- Copies static Jekyll template files from `docs/` to the gh-pages
root (for the latest version only)
- Generates `docs/_data/versions.yml` with a list of all versions
for the Jekyll templates to consume
2. **Jekyll template files** (see `docs/` directory)
- `docs/_config.yml` - Jekyll configuration
- `docs/index.md` - Landing page template that links to all versions
on RubyDoc.info based on generated `docs/_data/versions.yml`
- `docs/latest/index.html` - Redirect page template that redirects
to the latest documentation on RubyDoc.info
3. **GitHub Actions workflow** (see `.github/workflows/release.yml`)
Added a `publish_gh_pages` job that runs after the `publish_gem` job
on release events. The job invokes the generation script with the
release tag name, then pushes the updated gh-pages branch to deploy
the documentation.
4. **CI validation** (see `.github/workflows/ci.yml`)
Added a `yard` job that runs YARD validation with `--no-output`.
This ensures YARD can successfully parse the codebase (without
generating output), catching documentation issues early in CI.
5. **YARD dependencies** (see `Gemfile`)
Added `yard` and `yard-sorbet` gems as development dependencies to
support documentation validation in CI.
YARD documentation is automatically generated and hosted by
RubyDoc.info when the gem is published to RubyGems.org.
6. **Documentation links** (see `README.md` and `mcp.gemspec`)
Added links to the published API documentation on RubyDoc.info in
the README and gemspec metadata.
Documentation URL
-----------------
Custom documentation will be available at:
https://modelcontextprotocol.github.io/ruby-sdk/
RubyDoc.info documentation will be accessible at:
- https://rubydoc.info/gems/mcp (latest version)
- https://rubydoc.info/gems/mcp/1.2.3 (specific versions)
Co-Authored-By: Claude <noreply@anthropic.com>
koic
approved these changes
Nov 27, 2025
Member
koic
left a comment
There was a problem hiding this comment.
Custom documentation will be available at: https://modelcontextprotocol.github.io/ruby-sdk/
I confirmed that https://modelcontextprotocol.github.io/python-sdk/ already exists. Since users will likely refer to the documentation first, having this kind of documentation available should improve the overall user-friendly tool experience. Thank you for working on this!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds automated deployment of a versioned API documentation landing page using GitHub Pages. The landing page links to documentation hosted on RubyDoc.info, the de facto standard documentation site for the Ruby ecosystem. The landing page will update to reflect new releases.
Changes
Documentation generation script (see
bin/generate-gh-pages.sh)Copies and commits documentation files to the gh-pages branch. The script uses git worktrees to isolate the process from the main workspace.
The script:
1.2.3,v1.2.3, andrelease-1.2.3all createv1.2.3)docs/to the gh-pages root (for the latest version only)docs/_data/versions.ymlwith a list of all versions for the Jekyll templates to consumeJekyll template files (see
docs/directory)docs/_config.yml- Jekyll configurationdocs/index.md- Landing page template that links to all versions on RubyDoc.info based on generateddocs/_data/versions.ymldocs/latest/index.html- Redirect page template that redirects to the latest documentation on RubyDoc.infoGitHub Actions workflow (see
.github/workflows/release.yml)Added a
publish_gh_pagesjob that runs after thepublish_gemjob on release events. The job invokes the generation script with the release tag name, then pushes the updated gh-pages branch to deploy the documentation.CI validation (see
.github/workflows/ci.yml)Added a
yardjob that runs YARD validation with--no-output. This ensures YARD can successfully parse the codebase (without generating output), catching documentation issues early in CI.YARD dependencies (see
Gemfile)Added
yardandyard-sorbetgems as development dependencies to support documentation validation in CI.YARD documentation is automatically generated and hosted by RubyDoc.info when the gem is published to RubyGems.org.
Documentation links (see
README.mdandmcp.gemspec)Added links to the published API documentation on RubyDoc.info in the README and gemspec metadata.
Documentation URL
Custom documentation will be available at: https://modelcontextprotocol.github.io/ruby-sdk/
RubyDoc.info documentation will be accessible at:
You can see a preview of the landing page at: https://jonathan.hefner.pro/mcp-ruby-sdk/. (Ignore the v99.9.9 tag — I created that for testing purposes.)
Note that this page is fully customizable via
docs/index.md, and it can link to SDK-specific guides in the future.Eventually, I intend to link to this page from the
modelcontextprotocol.ioSDKs page. And, ultimately, I think it would be nice have something likesdks.modelcontextprotocol.iosuch thathttps://sdks.modelcontextprotocol.io/ruby-sdk/resolves tohttps://modelcontextprotocol.github.io/ruby-sdk/.If desired, I can also submit a PR for the
gh-pagesbranch to populatedocs/index.mdbefore the next release.