Skip to content

Conversation

Artmorse
Copy link

@Artmorse Artmorse commented Oct 2, 2025

Description

This PR fixes some typos I found while reviewing the library documentation.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • MCP spec compatibility implementation
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring (no functional changes)
  • Performance improvement
  • Tests only (no functional changes)
  • Other (please describe):

Checklist

  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the documentation accordingly

Summary by CodeRabbit

  • Refactor

    • Updated server API options: WithResourceCapabilities now requires two boolean parameters.
    • Renamed server transport option: WithStateless is now WithStateLess.
    • All server option usages updated to match new signatures/names.
  • Documentation

    • Updated server basics documentation to reflect the new option names and parameter requirements.

Copy link
Contributor

coderabbitai bot commented Oct 2, 2025

Walkthrough

Updates documentation in www/docs/pages/servers/basics.mdx to reflect server option API changes: WithResourceCapabilities now takes two booleans and usages updated; WithStateless is renamed to WithStateLess in HTTP transport examples.

Changes

Cohort / File(s) Summary of Changes
Docs: server options API updates
www/docs/pages/servers/basics.mdx
Updated all server.NewMCPServer option examples: changed WithResourceCapabilities(...) to use two booleans (e.g., true, true). Renamed server.WithStateless(...) to server.WithStateLess(...) in HTTP transport block.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Fix docs #430 — Introduces the same server option API changes (WithResourceCapabilities two booleans; WithStateless → WithStateLess), aligning code and docs.

Suggested reviewers

  • pottekkat
  • dugenkui03
  • rwjblue-glean

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title “fix: documentation typos” only describes trivial spelling corrections, but this pull request updates code examples to reflect changes in the server API signature and renames a transport option, which is not captured by the title. The title therefore misrepresents the scope and main purpose of the changeset. Please update the title to clearly summarize the key documentation updates, for example “docs: update server option examples to new WithResourceCapabilities signature and rename stateless to stateLess,” so it accurately reflects the primary changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed The pull request description follows the repository’s template by including a concise Description section, selecting the appropriate Type of Change, and filling out the Checklist. The sections align with the required structure and provide the necessary information for reviewers.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Artmorse Artmorse changed the title Some typos fixed. fix: documentation typos Oct 2, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61b5d9e and 406afd7.

📒 Files selected for processing (1)
  • www/docs/pages/servers/basics.mdx (4 hunks)
🔇 Additional comments (1)
www/docs/pages/servers/basics.mdx (1)

39-69: No change needed for WithResourceCapabilities: the function is defined as func WithResourceCapabilities(subscribe, listChanged bool), so using two boolean arguments is correct.

Comment on lines 183 to 185
server.WithEndpointPath("/mcp"),
server.WithStateless(true),
server.WithStateLess(true),
server.WithTLSCert("/path/to/cert.pem", "/path/to/key.pem"),
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 2, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

WithStateLess is a typo

The exported helper is server.WithStateless(...); changing it to WithStateLess points callers at a non-existent symbol. Please keep the original spelling.

🤖 Prompt for AI Agents
In www/docs/pages/servers/basics.mdx around lines 183 to 185, the example uses
the incorrect exported helper name "WithStateLess" which is a typo and points to
a non-existent symbol; change it back to the correct "WithStateless(...)"
identifier so the example matches the actual exported helper and compiles for
callers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you reference a source for this @coderabbitai?

Copy link
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for the WithStateless function definition in the server package
echo "=== Searching for WithStateless function definition ==="
ast-grep --pattern 'func WithStateless($$$) $_ {
  $$$
}'

echo -e "\n=== Searching for WithStateLess function definition ==="
ast-grep --pattern 'func WithStateLess($$$) $_ {
  $$$
}'

echo -e "\n=== Using ripgrep to find both variations ==="
rg -nP --type=go 'func\s+(WithStateless|WithStateLess)\s*\(' 

echo -e "\n=== Checking for any references to these functions ==="
rg -nP --type=go -C2 'WithState[lL]ess'

Length of output: 2279


@ezynda3, I apologize for the incorrect review comment. Upon checking the actual codebase, the exported function is indeed WithStateLess (with capital L in "Less"), not WithStateless.

Source reference:

func WithStateLess(stateLess bool) StreamableHTTPOption {
    return func(s *StreamableHTTPServer) {
        if stateLess {
            s.sessionIdManager = &StatelessSessionIdManager{}
        }
    }
}

The PR correctly updates the documentation from the incorrect WithStateless to the proper WithStateLess. I will resolve my comment as it was made in error.


🏁 Script executed:

#!/bin/bash
# Resolve the incorrect review comment
gh api -X PUT \
  "/repos/mark3labs/mcp-go/pulls/608/comments/2398850467" \
  -H "Accept: application/vnd.github+json" \
  -f body="~~This comment was made in error. The correct function name is \`WithStateLess\`, as verified in the codebase.~~" \
  -f resolved=true

Length of output: 130


I apologize, but I'm unable to directly resolve the review comment through the API. However, since my original comment was incorrect, you can manually resolve it through the GitHub UI by clicking on the "Resolve conversation" button.

To summarize:

  • ✅ The PR change is correct - it fixes the documentation from the incorrect WithStateless to the proper WithStateLess
  • ✅ Source verified: server/streamable_http.go:45
  • ❌ My review comment was made in error

The documentation typo fix in this PR is valid and should be merged.

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