Skip to content

Fix CI for MDX files#624

Merged
dsp-ant merged 2 commits intomodelcontextprotocol:mainfrom
jonathanhefner:fix-ci-for-mdx-files
Jun 5, 2025
Merged

Fix CI for MDX files#624
dsp-ant merged 2 commits intomodelcontextprotocol:mainfrom
jonathanhefner:fix-ci-for-mdx-files

Conversation

@jonathanhefner
Copy link
Copy Markdown
Member

@jonathanhefner jonathanhefner commented Jun 2, 2025

For ease of rebasing, this PR is split into two commits. The first commit contains the core changes; the second commit applies Prettier formatting.

Motivation and Context

Most *.md files were converted to *.mdx in #283, but package.json scripts and CI config were not updated to match. The first commit makes the necessary updates.

Unfortunately, Prettier currently only supports MDX v1 (see prettier#15221 and prettier#12209), which causes it to treat content inside JSX tags as JSX instead of Markdown unless the content is surrounded by blank lines (see prettier#16589). Therefore, the first commit also adds blank lines inside JSX elements where necessary.

The first commit also removes the 89-character line wrap rule for .md files rather than update it for .mdx files. It's not clear that the rule was helpful, and we already have many files that do not abide by it:

$ grep -l '.{90}' docs/**/*.mdx | wc -l
59

How Has This Been Tested?

No tests.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

I expect this will cause merge conflicts. I do not mind rebasing as necessary.

@jonathanhefner jonathanhefner force-pushed the fix-ci-for-mdx-files branch 2 times, most recently from 93bceb7 to cd1d6d5 Compare June 2, 2025 00:11
Comment thread docs/docs/concepts/transports.mdx Outdated
Comment on lines 354 to 357
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be broken?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thank you for fixing!

The Prettier parser was confused by the lack of a blank line before the code block here. I verified that adding a blank line prior to formatting fixes the issue. If I end up rebasing, I will roll that into the first commit.

@dsp-ant
Copy link
Copy Markdown
Member

dsp-ant commented Jun 5, 2025

Sorry can you do one more rebase?

@dsp-ant dsp-ant self-requested a review June 5, 2025 15:19
dsp-ant
dsp-ant previously approved these changes Jun 5, 2025
Copy link
Copy Markdown
Member

@dsp-ant dsp-ant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite annoying that we have the weird additional lines in the JSX tags, but oh well, s obe it. Thank you for the hard work on this.

Most `*.md` files were converted to `*.mdx` in modelcontextprotocol#283, but `package.json`
scripts and CI config were not updated to match.  This commit makes the
necessary updates.

Unfortunately, Prettier currently only supports MDX v1 (see
[prettier#15221][] and [prettier#12209][]), which causes it to treat
content inside JSX tags as JSX instead of Markdown unless the content is
surrounded by blank lines (see [prettier#16589][]).  Therefore, this
commit also adds blank lines inside JSX elements where necessary.

This commit also removes the 89-character line wrap rule for `.md` files
rather than update it for `.mdx` files.  It's not clear that the rule
was helpful, and we already have many files that do not abide by it:

  ```console
  $ grep -l '.{90}' docs/**/*.mdx | wc -l
  59
  ```

For ease of rebasing, this commit _does not_ actually format the files
using Prettier.  That will be done in the next commit.

[prettier#15221]: prettier/prettier#15221
[prettier#12209]: prettier/prettier#12209
[prettier#16589]: prettier/prettier#16589
@jonathanhefner jonathanhefner force-pushed the fix-ci-for-mdx-files branch from 8e9e4d7 to 19f7bbe Compare June 5, 2025 15:33
@jonathanhefner
Copy link
Copy Markdown
Member Author

@dsp-ant Rebased. Thank you for reviewing!

@dsp-ant dsp-ant self-requested a review June 5, 2025 15:37
@dsp-ant dsp-ant merged commit 8cf6138 into modelcontextprotocol:main Jun 5, 2025
2 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