-
Notifications
You must be signed in to change notification settings - Fork 7
Add User-Agent Header Usage #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Pull request overview
This PR adds User-Agent header support to all MCP (Model Context Protocol) server HTTP requests across the tooling SDK and its extensions. The User-Agent header identifies the SDK version, operating system, Python version, and the specific orchestration framework being used (SemanticKernel, OpenAI, AzureAIFoundry, or AgentFramework), enabling better telemetry and diagnostics.
Key Changes:
- Added
USER_AGENTconstant to theConstants.Headersclass for consistent header naming - Integrated User-Agent headers in MCP server configuration service for gateway requests
- Added framework-specific User-Agent headers across all four MCP tool registration services
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/utils/constants.py | Added USER_AGENT constant to Headers class for centralized header name management |
| libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py | Added User-Agent header to gateway requests using RuntimeUtility.get_user_agent_header() |
| libraries/microsoft-agents-a365-tooling-extensions-semantickernel/microsoft_agents_a365/tooling/extensions/semantickernel/services/mcp_tool_registration_service.py | Added User-Agent header with "SemanticKernel" orchestrator identifier |
| libraries/microsoft-agents-a365-tooling-extensions-openai/microsoft_agents_a365/tooling/extensions/openai/mcp_tool_registration_service.py | Added User-Agent header with "OpenAI" orchestrator identifier and updated Authorization header to use constant |
| libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry/microsoft_agents_a365/tooling/extensions/azureaifoundry/services/mcp_tool_registration_service.py | Added User-Agent header with "AzureAIFoundry" orchestrator identifier |
| libraries/microsoft-agents-a365-tooling-extensions-agentframework/microsoft_agents_a365/tooling/extensions/agentframework/services/mcp_tool_registration_service.py | Added User-Agent header with "AgentFramework" orchestrator identifier |
...ions-openai/microsoft_agents_a365/tooling/extensions/openai/mcp_tool_registration_service.py
Outdated
Show resolved
Hide resolved
...a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py
Outdated
Show resolved
Hide resolved
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.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (3)
libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py:341
- Inconsistent use of hardcoded string "User-Agent" instead of the constant
Constants.Headers.USER_AGENTthat was just added. For consistency with the Authorization header on line 340 and usage elsewhere in the codebase, this should use the constant.
Dictionary of HTTP headers.
libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py:80
- Missing documentation for the new
orchestrator_nameparameter. The docstring should include a description of this parameter in the Args section, such as:
orchestrator_name: Optional orchestrator name to include in User-Agent header.
"""
Gets the list of MCP Servers that are configured for the agent.
Args:
agentic_app_id: Agentic App ID for the agent.
auth_token: Authentication token to access the MCP servers.
libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py:289
- Missing documentation for the new
orchestrator_nameparameter. The docstring should include a description of this parameter in the Args section, such as:
orchestrator_name: Optional orchestrator name to include in User-Agent header.
self, agentic_app_id: str, auth_token: str, orchestrator_name: Optional[str] = None
) -> List[MCPServerConfig]:
"""
Reads MCP server configurations from tooling gateway endpoint for production scenario.
Args:
agentic_app_id: Agentic App ID for the agent.
...a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py
Show resolved
Hide resolved
...soft_agents_a365/tooling/extensions/azureaifoundry/services/mcp_tool_registration_service.py
Outdated
Show resolved
Hide resolved
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.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
...a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py
Outdated
Show resolved
Hide resolved
...a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py
Outdated
Show resolved
Hide resolved
...a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py
Outdated
Show resolved
Hide resolved
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.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/models/init.py:11
- The name 'ToolOptions' is exported by all but is not defined.
__all__ = ["MCPServerConfig", "ToolOptions"]
...soft_agents_a365/tooling/extensions/azureaifoundry/services/mcp_tool_registration_service.py
Outdated
Show resolved
Hide resolved
libraries/microsoft-agents-a365-tooling/microsoft_agents_a365/tooling/models/__init__.py
Show resolved
Hide resolved
...a365-tooling/microsoft_agents_a365/tooling/services/mcp_tool_server_configuration_service.py
Outdated
Show resolved
Hide resolved
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.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
No description provided.