Add MCP tooling to Claude Python sample agent#200
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds MCP-based tooling and full observability instrumentation to the Claude Python sample agent, bringing it in line with the Agent365 SDK and CrewAI sample patterns.
Changes:
- Introduces
turn_context_utils.pyto normalize extraction of agent, caller, tenant, and request details for observability scopes. - Adds
mcp_tool_registration_service.pyto discover MCP servers (via SDK orToolingManifest.jsonfallback), list tools, and execute tools over HTTP/SSE with retry and timeout handling. - Updates
agent.py,ToolingManifest.json,README.md, and.env.templateto wire in MCP tooling, switch to BaggageBuilder + Invoke/Inference scopes, and document/configure MCP and observability options.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
python/claude/sample-agent/turn_context_utils.py |
New shared helper for extracting TurnContext details and constructing observability models (AgentDetails, CallerDetails, TenantDetails, Request, InvokeAgentDetails). |
python/claude/sample-agent/mcp_tool_registration_service.py |
New Claude-specific MCP registration service that discovers MCP servers, parses SSE responses, lists tools, and executes tools with retry/timeout logic and Claude-compatible configuration shapes. |
python/claude/sample-agent/agent.py |
Wires in MCP discovery/execution, replaces ad-hoc observability with BaggageBuilder + InvokeAgentScope/InferenceScope, and adds ExecuteToolScope instrumentation for tool calls, but introduces signature mismatches with the existing host/interface. |
python/claude/sample-agent/ToolingManifest.json |
Expands manifest to include additional MCP servers (Mail, M365 Copilot, Calendar) for the Claude sample. |
python/claude/sample-agent/README.md |
Documents MCP tooling support, manifest-based configuration, and MCP-related environment variables and auth flows. |
python/claude/sample-agent/.env.template |
Updates environment template with MCP-related settings (ENVIRONMENT, MCP platform endpoint) and observability log-level configuration. |
pontemonti
reviewed
Jan 29, 2026
pontemonti
reviewed
Jan 29, 2026
pontemonti
reviewed
Jan 29, 2026
nikhilNava
requested changes
Jan 29, 2026
nikhilNava
left a comment
There was a problem hiding this comment.
Please address all the changes asked by the Johan/Claud agent.
juliomenendez
requested changes
Jan 30, 2026
nikhilNava
approved these changes
Jan 30, 2026
|
Be sure to change the target branch to your other open branch. |
juliomenendez
approved these changes
Jan 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds Model Context Protocol (MCP) tooling integration and complete observability instrumentation to the Claude Python sample agent, aligning it with the Agent365 SDK best practices demonstrated in the CrewAI sample.
Changes
MCP Tooling Integration
- Uses [McpToolServerConfigurationService] for production MCP server discovery
- Falls back to [ToolingManifest.json] for local development
- Handles SSE (Server-Sent Events) parsing for MCP responses
- Provides tool discovery (tools/list) and execution (tools/call) with retry logic
- Converts MCP servers to Claude SDK's [mcp_servers] format
Observability Implementation
- [ExecuteToolScope] for individual tool execution tracking
Testing
✅ Verified MCP tool discovery and connection
✅ Verified observability spans are created correctly
✅ All Python files pass syntax validation
✅ All files have Microsoft copyright headers
✅ No "Kairo" legacy references