[v2] Use the documented middleware accessor in the tracing opt-out example

オープン 初心者向け
#3,934 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
91/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
documentation

調査の方向性

docs/run/opentelemetry.mdの「Turning it off」の例を開き、docs/advanced/middleware.mdに記載されているミドルウェアアクセサーと比較してください。mcp._lowlevel_server.middlewareの両方の使用箇所をmcp.middlewareに置き換え、APIが暫定的である旨の警告とOpenTelemetryMiddlewareのimportを維持してください。例の両方の箇所でドキュメントに記載されたアクセサーを使い、それらの注記を維持できたら完了です。

索引モデルが issue の本文から書いたものです。

説明

v2
What happened?

While integrating the SDK into mcpstat, I needed to disable the SDK's inbound server spans while preserving other middleware.

The "Turning it off" example uses mcp._lowlevel_server.middleware. This works, but MCPServer exposes the same list through the documented mcp.middleware accessor.

Could the example use mcp.middleware in both places, retaining the existing provisional API warning? This would avoid accessing the internal _lowlevel_server attribute.

AI assisted with source review and wording.

What did you expect?

Use mcp.middleware in both places in the example, retaining the existing warning about the provisional middleware API and OpenTelemetryMiddleware import.

This would be a documentation-only change. I would be happy to contribute it if the maintainers consider it useful.

Code to reproduce

SDK version

Integration: mcp 2.3.0. Documentation and accessor checked on main at 77001c9.

Area

Documentation

主要言語
Python
スター
25k
フォーク
4.2k
平均マージ
10分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/python-sdk のほかの issue

modelcontextprotocol/python-sdk の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。