René's URL Explorer Experiment


Title: OTel client spans: add `server.address` (and other semconv client attributes) so tool calls can be attributed to a server · Issue #3836 · modelcontextprotocol/python-sdk · GitHub

Open Graph Title: OTel client spans: add `server.address` (and other semconv client attributes) so tool calls can be attributed to a server · Issue #3836 · modelcontextprotocol/python-sdk

X Title: OTel client spans: add `server.address` (and other semconv client attributes) so tool calls can be attributed to a server · Issue #3836 · modelcontextprotocol/python-sdk

Description: Description The MCP send [] CLIENT span created in JSONRPCDispatcher.send_raw_request only carries mcp.method.name and jsonrpc.request.id: # src/mcp/shared/jsonrpc_dispatcher.py (v2.3.0 / main) with otel_span( span_name,...

Open Graph Description: Description The MCP send [] CLIENT span created in JSONRPCDispatcher.send_raw_request only carries mcp.method.name and jsonrpc.request.id: # src/mcp/shared/jsonrpc_dispatcher.py (v...

X Description: Description The MCP send <method> [<target>] CLIENT span created in JSONRPCDispatcher.send_raw_request only carries mcp.method.name and jsonrpc.request.id: # src/mcp/shared/jsonrpc_disp...

Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/3836

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"OTel client spans: add `server.address` (and other semconv client attributes) so tool calls can be attributed to a server","articleBody":"### Description\n\nThe `MCP send \u003cmethod> [\u003ctarget>]` CLIENT span created in `JSONRPCDispatcher.send_raw_request` only carries `mcp.method.name` and `jsonrpc.request.id`:\n\n```python\n# src/mcp/shared/jsonrpc_dispatcher.py (v2.3.0 / main)\nwith otel_span(\n    span_name,\n    kind=SpanKind.CLIENT,\n    attributes={\"mcp.method.name\": method, \"jsonrpc.request.id\": str(request_id)},\n) as span:\n```\n\nA client connected to several MCP servers therefore can't tell from its own telemetry which server a call went to. The span name includes the tool name, but tool names aren't unique across servers, and when the server doesn't emit traces (third-party hosted servers, servers without OTel) the client span is the only record of the call.\n\n**Use case.** I run Open WebUI with three MCP servers (a Playwright-based fetch server, a smart-home server, and a hosted third-party server). Tempo's span-metrics processor turns the `MCP send tools/call \u003ctool>` spans into per-tool call counts and latency in Grafana. I'd like to group/filter those by server, but the only option today is guessing from tool-name patterns. Only one of the three servers emits its own SERVER spans, so following child spans doesn't help for the others.\n\n**What the semantic conventions say.** The GenAI MCP semantic conventions define these on MCP client spans, none of which are currently set:\n\n- `server.address` / `server.port` (`Recommended`; for client spans, the address of the server behind any intermediaries, if known)\n- `network.transport` (`Recommended`; `tcp` for HTTP, `pipe` for stdio), `network.protocol.name` / `network.protocol.version` (`Recommended` where applicable)\n- `mcp.session.id`, `mcp.protocol.version` (`Recommended`)\n- `gen_ai.tool.name` (`Conditionally Required` when the operation relates to a specific tool, i.e. every `tools/call`) and `gen_ai.operation.name` (`Recommended`). Both were added to the server-side `OpenTelemetryMiddleware` in #2970 but are still missing on the client span.\n\n`server.address` / `server.port` are the important ones here: with them, a span-metrics or service-graph processor can break tool calls down by server with no client-side changes.\n\n**Implementation note.** I realise the dispatcher is transport-agnostic and doesn't know the URL. The TODO right there (`move the otel span + inject into an outbound middleware once that seam exists`) and #3715 point in the same direction. Some options:\n\n- The transport could expose connection metadata (address, port, transport kind) to the session/dispatcher when it's created, and the dispatcher adds it to every outbound span. For Streamable HTTP this comes from the URL; for stdio, `server.address` doesn't apply but `network.transport=pipe` (and perhaps the command name) does.\n- Or this lands as part of the client-side outbound seam proposed in #3715.\n\nA smaller stopgap that would also help: an optional, user-supplied set of extra span attributes on `Client` / `ClientSession` (e.g. `Client(..., otel_attributes={\"server.address\": ...})`), so applications like Open WebUI can tag spans with the connection they already know about.\n\n### References\n\n- GenAI MCP semantic conventions, client span attributes: https://github.com/open-telemetry/semantic-conventions-genai/blob/main/docs/gen-ai/mcp.md\n- #2387: open PR adding `rpc.*`, `mcp.resource.uri`, `mcp.session.id` to client/server spans (related, but no server identity)\n- #2970: merged, GenAI semconv attributes on the server-side middleware only\n- #3715: client outbound request seam, the natural home for transport-aware span enrichment\n- #1233: middleware support\n","author":{"url":"https://github.com/mihai-dinculescu","@type":"Person","name":"mihai-dinculescu"},"datePublished":"2026-11-08T11:15:38Z","url":"https://github.com/modelcontextprotocol/python-sdk/issues/3836"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:533a23ba-f204-217e-5de9-febea3b5dd1b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD16C:248DA8:2B5475B:3900AB1:6B0568AB
html-safe-nonce171e18974eab02369d0e05932dba1742e83af33b3ad01d32b04668db96eff618
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTZDOjI0OERBODoyQjU0NzVCOjM5MDBBQjE6NkIwNTY4QUIiLCJ2aXNpdG9yX2lkIjoiNzg4MTY4NDgzOTE2ODM0OTg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb4deea6df6e678f281ae5fd6f138a7875ec97274202287654eb49086b33c8de5
hovercard-subject-tagissue:6270343655
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/3836/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a40e0e16cda927b9112d99e0e96e8620e9697776e80d6744bfdb9e1a19aa0b18/modelcontextprotocol/python-sdk/issues/3836
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a40e0e16cda927b9112d99e0e96e8620e9697776e80d6744bfdb9e1a19aa0b18/modelcontextprotocol/python-sdk/issues/3836
og:image:altDescription The MCP send [] CLIENT span created in JSONRPCDispatcher.send_raw_request only carries mcp.method.name and jsonrpc.request.id: # src/mcp/shared/jsonrpc_dispatcher.py (v...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemihai-dinculescu
hostnamegithub.com
expected-hostnamegithub.com
None1be5cc09efdd4833c24a4ffa71d698e3999fa09071e159fe14c2c08e41c98331
turbo-cache-controlno-preview
go-importgithub.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git
octolytics-dimension-user_id182288589
octolytics-dimension-user_loginmodelcontextprotocol
octolytics-dimension-repository_id862584018
octolytics-dimension-repository_nwomodelcontextprotocol/python-sdk
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id862584018
octolytics-dimension-repository_network_root_nwomodelcontextprotocol/python-sdk
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef6d69234e682c947a48074340e69d45d5901de31
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/modelcontextprotocol/python-sdk/issues/3836#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3836
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmodelcontextprotocol%2Fpython-sdk%2Fissues%2F3836
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=modelcontextprotocol%2Fpython-sdk
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3836
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3836
Reloadhttps://github.com/modelcontextprotocol/python-sdk/issues/3836
modelcontextprotocolhttps://github.com/modelcontextprotocol
python-sdkhttps://github.com/modelcontextprotocol/python-sdk
Codehttps://github.com/modelcontextprotocol/python-sdk
Issues320 (320)https://github.com/modelcontextprotocol/python-sdk/issues
Pull requests112 (112)https://github.com/modelcontextprotocol/python-sdk/pulls
Actionshttps://github.com/modelcontextprotocol/python-sdk/actions
Projectshttps://github.com/modelcontextprotocol/python-sdk/projects
Security and quality12 (12)https://github.com/modelcontextprotocol/python-sdk/security
Insightshttps://github.com/modelcontextprotocol/python-sdk/insights
https://github.com/modelcontextprotocol/python-sdk
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3836
New issuehttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3836
OTel client spans: add server.address (and other semconv client attributes) so tool calls can be attributed to a serverhttps://github.com/modelcontextprotocol/python-sdk/issues/3836#top
enhancementhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/mihai-dinculescu
mihai-dinculescuhttps://github.com/mihai-dinculescu
on Nov 8, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3836#issue-6270343655
Add GenAI semantic-convention attributes to OpenTelemetryMiddleware #2970https://github.com/modelcontextprotocol/python-sdk/pull/2970
#3715https://github.com/modelcontextprotocol/python-sdk/issues/3715
Client: expose an outbound request seam (the send_raw_request TODO) so observers can see a request before it is written #3715https://github.com/modelcontextprotocol/python-sdk/issues/3715
https://github.com/open-telemetry/semantic-conventions-genai/blob/main/docs/gen-ai/mcp.mdhttps://github.com/open-telemetry/semantic-conventions-genai/blob/main/docs/gen-ai/mcp.md
Add richer OTel MCP span attributes #2387https://github.com/modelcontextprotocol/python-sdk/pull/2387
Add GenAI semantic-convention attributes to OpenTelemetryMiddleware #2970https://github.com/modelcontextprotocol/python-sdk/pull/2970
Client: expose an outbound request seam (the send_raw_request TODO) so observers can see a request before it is written #3715https://github.com/modelcontextprotocol/python-sdk/issues/3715
Middleware Support in MCP #1233https://github.com/modelcontextprotocol/python-sdk/issues/1233
claudehttps://github.com/apps/claude
enhancementhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22enhancement%22
on Nov 8, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3836#event-35489730256
https://github.com/Pranjulchaurasiya
Pranjulchaurasiyahttps://github.com/Pranjulchaurasiya
on Nov 10, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3836#issuecomment-6758863388
#3715https://github.com/modelcontextprotocol/python-sdk/issues/3715
Add GenAI semantic-convention attributes to OpenTelemetryMiddleware #2970https://github.com/modelcontextprotocol/python-sdk/pull/2970
https://github.com/media-ctrl
media-ctrlhttps://github.com/media-ctrl
on Nov 10, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3836#issuecomment-6773745002
https://github.com/Pranjulchaurasiya
Pranjulchaurasiyahttps://github.com/Pranjulchaurasiya
on Nov 11, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3836#issuecomment-6783963866
@media-ctrlhttps://github.com/media-ctrl
@davidsphttps://github.com/davidsp
@maxisbeyhttps://github.com/maxisbey
https://github.com/media-ctrl
media-ctrlhttps://github.com/media-ctrl
on Nov 11, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3836#issuecomment-6784069743
https://github.com/Pranjulchaurasiya
Pranjulchaurasiyahttps://github.com/Pranjulchaurasiya
on Nov 19, 2026https://github.com/modelcontextprotocol/python-sdk/issues/3836#issuecomment-7020099288
@davidsphttps://github.com/davidsp
@maxisbeyhttps://github.com/maxisbey
Sign up for freehttps://github.com/signup?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3836
Sign in to commenthttps://github.com/login?return_to=https://github.com/modelcontextprotocol/python-sdk/issues/3836
enhancementhttps://github.com/modelcontextprotocol/python-sdk/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.