Skip to content

docs(service): clarify startup and stdio lifecycle - #1387

Merged
DaleSeo merged 1 commit into
modelcontextprotocol:mainfrom
theamodhshetty:docs/serve-startup-lifecycle
Nov 8, 2026
Merged

DaleSeo merged 1 commit into
modelcontextprotocol:mainfrom
theamodhshetty:docs/serve-startup-lifecycle

Conversation

@theamodhshetty

@theamodhshetty theamodhshetty commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Clarify when ServiceExt::serve() returns and how to run the counter stdio example with a real MCP client.

Motivation and Context

Refs #1143. Starting the counter executable directly in a terminal can leave serve().await waiting for peer input, which looks like a stalled server. The API docs, README and example now explain protocol startup, background message handling, waiting(), startup cancellation and Tokio stdin's blocking-read shutdown limitation. The example also gets a working Inspector command and a corrected stderr logging comment.

This addresses the issue's documentation request; lifecycle and shutdown behavior are unchanged.

How Has This Been Tested?

On macOS arm64 with Rust 1.96.1:

  • All 22 existing server-initialization tests passed.
  • Built servers_counter_stdio and ran the documented command through Inspector CLI 2.12.0: initialization succeeded, tools/list returned eight tools, and the service stopped after input-stream closure.
  • Built rmcp API docs with broken intra-doc links denied and the relevant transport features enabled.
  • Nightly workspace formatting and git diff --check passed.

Breaking Changes

None; documentation and comments only.

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

No runtime error-handling changes are involved. Initially submitted as a draft under the repository's one-open-ready-PR limit. #1386 has now merged, so this documentation change is ready for maintainer review. Hosted CI, conformance, CodeQL and Scorecard now pass on a0fdcad; maintainer review remains pending. Developed with Codex assistance; validation was run locally.

@github-actions github-actions Bot added T-documentation Documentation improvements T-core Core library changes T-examples Example code changes T-transport Transport layer changes labels Oct 22, 2026
@github-actions
github-actions Bot requested a review from DaleSeo October 22, 2026 20:20
@github-actions

Copy link
Copy Markdown
Contributor

@DaleSeo (assignment failed) is on triage rotation this week and is the reviewer for this one.

Labels come from the PR labeler. Please review the change.

Automated triage. Labels are a first pass and the assigned maintainer has the final say.

@theamodhshetty
theamodhshetty marked this pull request as ready for review October 23, 2026 05:05
@theamodhshetty
theamodhshetty requested a review from a team as a code owner October 23, 2026 05:05
@DaleSeo
DaleSeo merged commit f2b0ddf into modelcontextprotocol:main Nov 8, 2026
28 checks passed
This was referenced Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-documentation Documentation improvements T-examples Example code changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants