GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs: stop presenting the in-memory client as the way to connect by maxisbey · Pull Request #3443 · modelcontextprotocol/python-sdk

Conversation

@maxisbey

@maxisbey maxisbey commented Sep 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Client(server_object) connects in-process. That is how the SDK's own tests run and it is a fine test harness, but a lot of the documentation led with it: the client page's first example, the first section of the transports page, most "what Client accepts" lists, and most feature pages' client snippets. A reader came away thinking that importing the server object is how you write a client, with a URL as the variation.

This makes the docs show clients the way people write them: a server.py you serve, and a client.py that connects to http://localhost:8000/mcp (or a StdioServerParameters). In-memory stays where it belongs: the Testing page, "in tests" asides, and the transports page's "In memory" section.

Motivation and Context

Follows #3315 (README) and #3321 (Client(StdioServerParameters)), which came out of #3313. With those in, a real connection is one line either way, so the docs no longer need the in-memory form to keep examples short.

What changed:

  • Client examples are real clients. On every page that had in-process client snippets, the server is shown once as server.py with the command that serves it (uv run mcp run server.py --transport streamable-http, or uvicorn server:app --port 8000 for a low-level Server), and each client snippet is its own client.py connecting by URL. That covers the client page (one Bookshop server.py, six clients), protocol versions (four clients against that same server), progress, extensions and MCP Apps (server/client pairs), pagination and caching (uvicorn-served low-level servers; the caching handler prints each real fetch so "four calls, three fetches" is visible across the process boundary), serving legacy clients (both eras from one client program), the low-level Server Try-it, and the inline fragments on the troubleshooting page. Where a client has logic worth testing (the pagination loop, the caching demo) it is a function that tests/docs_src drives in-process against the server module, the pattern the subscriptions page already used.
  • Ordering. docs/client/transports.md leads with Streamable HTTP and stdio and moves "In memory" below them, scoped to tests and embedding. Enumerations that listed the server object first now put it last with "in tests" (whats-new.md, session-groups.md, multi-round-trip.md, callbacks.md, asgi.md, authorization.md, oauth-clients.md, four story READMEs). The Client docstring example is a URL client.
  • Stale statements fixed along the way: callbacks.md "the first argument to Client(...) is a transport object", testing.md's "In-process by default" heading (now "Era-neutral by default") and intro, first-steps.md's description of what Client is.

Deliberately untouched: docs/migration.md, the translations under i18n/ (they regenerate; several now include docs_src files whose role changed and will show as outdated until then), and the examples/stories/README.md status table.

How Has This Been Tested?

  • tests/docs_src retargeted rather than reduced: each page's claims are asserted in-process against its server module, and the factored client functions (list_all_tools, list_all_resources, the caching demo) are driven the same way. ./scripts/test passes at 100% coverage, scripts/docs/build.sh (strict) passes.
  • Ran every new server/client pair by hand the way the pages say to: served each server.py with its stated command and ran each client.py against it (the client page's seven, protocol-versions' four, pagination, caching, legacy-clients, apps, four extensions pairs, progress, low-level). All exit cleanly and the pages' output blocks are the observed output; the caching server logs exactly three fetches for the client's four calls, and the legacy-clients client reserves in both eras over HTTP.

Breaking Changes

None. Documentation and examples only; the one src/ change is the Client docstring example.

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

Two commits: the first reorders and reframes, the second replaces the in-process example code (an earlier draft of this PR had added a sentence per page explaining the in-process snippets instead of changing them; that is gone). New docs_src files: client/tutorial001_client.py, apps/tutorial001_client.py, extensions/tutorial00{3,4,6,7}_client.py, legacy_clients/tutorial001_client.py.

AI Disclaimer

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Sep 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

📚 Documentation preview

Preview https://pr-3443.mcp-python-docs.pages.dev
Deployment https://bd03967e.mcp-python-docs.pages.dev
Commit 1d1d60b
Triggered by @maxisbey
Updated 2026-09-05 02:31:01 UTC
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@maxisbey
maxisbey marked this pull request as ready for review September 4, 2026 16:20
@maxisbey
docs: stop presenting the in-memory client as the way to connect
af72034
Client(server_object) connects in-process, which is a testing technique,
but much of the documentation led with it: the client page's first example,
the transports page's first section, several "what Client accepts" lists,
and a number of feature pages whose snippets connect that way so they can
run as-is.

This reframes all of that around URL and stdio as the normal ways to
connect. The client page now starts a small server over HTTP and connects
to it by URL, then says once that the remaining snippets build their
server inline the way a test would. The transports page leads with
Streamable HTTP and stdio and moves the in-memory section down, scoped to
tests and embedding. Enumerations put the server object last, "in tests".
Feature pages whose snippets connect in-process get one sentence saying
so instead of a rewrite, and fences that define a server are no longer
titled client.py. The progress page, the prior_discover example and the
low-level Try-it now use real connections, since their point depends on
one. A few stale statements found along the way are corrected (the
callbacks page's "first argument is a transport object", the testing
page's "In-process by default" heading, the Client docstring example).
@maxisbey
maxisbey force-pushed the docs/client-connect-framing branch from 52230cc to af72034 Compare September 4, 2026 16:21
cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed Sep 4, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread docs/client/transports.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/client/caching.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/handlers/progress.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

claude[bot]
claude Bot reviewed Sep 4, 2026
View reviewed changes

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

No new blocking issues. Nothing in this review needs a push before merging.

1 further finding on code this push did not change was outside the scope of this re-review and not posted.

One verified lower-impact observation (a convention, logging or cleanup point) was not posted.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@maxisbey
docs: give every client example a served server and a real connection
1d358db
The previous commit left most feature pages' snippets connecting to the
server object in-process and explained that away with a sentence per page.
That was a disclaimer, not a fix. This replaces it: each affected page now
shows its server once as server.py with the command that serves it, and
every client snippet is its own client.py that connects to
http://localhost:8000/mcp. Where a client has logic worth testing (the
pagination loop, the caching demo) it is a function the tests drive
in-process against the server module, the pattern the subscriptions page
already used.

Pages: the client page (one Bookshop server, six clients), protocol
versions (four clients against that same server), extensions and MCP Apps
(server/client pairs), pagination and caching (uvicorn-served low-level
servers, the caching handler prints each real fetch), serving legacy
clients (both eras from one client program over HTTP), and the inline
fragments on the troubleshooting page. The framing sentences are gone.
cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed Sep 4, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

All reported issues were addressed across 44 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread docs/client/index.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/troubleshooting.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

claude[bot]
claude Bot reviewed Sep 4, 2026
View reviewed changes

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

2 verified lower-impact observations (convention, logging or cleanup points) were not posted.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@maxisbey
docs: name the server the -32021 troubleshooting fragment runs against
193b512
No-Verification-Needed: doc-only wording change in docs/troubleshooting.md
cubic-dev-ai[bot]
cubic-dev-ai Bot reviewed Sep 4, 2026
View reviewed changes

@cubic-dev-ai cubic-dev-ai Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread docs/troubleshooting.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

claude[bot]
claude Bot reviewed Sep 4, 2026
View reviewed changes

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
maxisbey added 2 commits September 5, 2026 01:19
@maxisbey
docs: make the first-steps capabilities check a real client too
26cf9c7
The reader's first Client in the docs was still an inline Client(mcp)
against the imported server object. Serve server.py over HTTP and connect
by URL from a docs_src client file instead, like the rest of the docs now
do, and move the in-memory mention into the pointer to Testing.
@maxisbey
docs: show the resolver server in the -32021 troubleshooting entry
1d1d60b
The entry linked down to a section whose first server.py is the ctx.elicit
variant, which produces a different error. Include the resolver-based
Bistro directly so the entry has its own server.
claude[bot]
claude Bot reviewed Sep 5, 2026
View reviewed changes

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@maxisbey
maxisbey merged commit 7bb486a into main Sep 5, 2026
38 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@maxisbey
maxisbey deleted the docs/client-connect-framing branch September 5, 2026 03:16
@maxisbey maxisbey mentioned this pull request Sep 6, 2026
docs: refresh translations, and translate pages in parallel #3458
Merged
6 of 9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cubic-dev-ai cubic-dev-ai[bot] cubic-dev-ai[bot] left review comments
@claude claude[bot] claude[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@maxisbey
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.