Skip to content

Comments

fix: silence mkdocs social plugin warnings in strict mode#2109

Merged
Kludex merged 1 commit intomodelcontextprotocol:mainfrom
jonathanhefner:fix-mkdocs-warnings
Feb 19, 2026
Merged

fix: silence mkdocs social plugin warnings in strict mode#2109
Kludex merged 1 commit intomodelcontextprotocol:mainfrom
jonathanhefner:fix-mkdocs-warnings

Conversation

@jonathanhefner
Copy link
Member

The social plugin (mkdocs-material) requires cairosvg for generating Open Graph social card images. This dependency was never included in the docs dependency group, so the plugin emitted a warning on every page. With strict mode enabled, these warnings aborted the build.

Changes:

  • Add mkdocs-material[imaging] extra to the docs dependency group, which pulls in cairosvg, cairocffi, cssselect2, defusedxml, and tinycss2. This requires the system Cairo library (libcairo2), which is pre-installed on GitHub Actions ubuntu-latest runners.
  • Gate the social plugin behind an ENABLE_SOCIAL_CARDS env var (defaults to false) so local development does not require Cairo.
  • Set ENABLE_SOCIAL_CARDS=true in the docs publish workflow so social cards are generated for the published site.

The other approach is to set cards: false on the social plugin in mkdocs.yml. According to Claude, that would disable social card generation (which is what requires cairosvg) but keep the plugin active for metadata. I don't have a strong preference.

The social plugin (`mkdocs-material`) requires cairosvg for generating
Open Graph social card images. This dependency was never included in the
docs dependency group, so the plugin emitted a warning on every page.
With strict mode enabled, these warnings aborted the build.

Changes:

- Add `mkdocs-material[imaging]` extra to the docs dependency group,
  which pulls in `cairosvg`, `cairocffi`, `cssselect2`, `defusedxml`,
  and `tinycss2`. This requires the system Cairo library (`libcairo2`),
  which is pre-installed on GitHub Actions ubuntu-latest runners.
- Gate the social plugin behind an `ENABLE_SOCIAL_CARDS` env var
  (defaults to false) so local development does not require Cairo.
- Set `ENABLE_SOCIAL_CARDS=true` in the docs publish workflow so social
  cards are generated for the published site.
@Kludex
Copy link
Member

Kludex commented Feb 19, 2026

We should move away from mkdocs, maybe zensical?

@Kludex Kludex merged commit 0fe16dd into modelcontextprotocol:main Feb 19, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants