Skip to content

Improve MCP Extension Support#2551

Merged
Flanker32 merged 15 commits intomicrosoft:developfrom
ahmedmuhsin:mcp-improved
Nov 2, 2025
Merged

Improve MCP Extension Support#2551
Flanker32 merged 15 commits intomicrosoft:developfrom
ahmedmuhsin:mcp-improved

Conversation

@ahmedmuhsin
Copy link
Copy Markdown
Contributor

@ahmedmuhsin ahmedmuhsin commented Sep 3, 2025

This pull request introduces support for MCP (Model Context Protocol) annotations in Azure Functions and refactors binding name handling to improve consistency and validation. The most significant changes are the addition of MCP-related binding types and annotation processing, centralization of system-reserved binding name logic, and stricter validation for user-defined binding names.

MCP Annotation Support

  • Added new MCP binding types (McpToolTrigger, McpToolProperty) to the BindingEnum and their corresponding annotation constants in AzureFunctionsAnnotationConstants.java. [1] [2]
  • Implemented McpAnnotationProcessor.java, which processes MCP annotations by patching trigger and property bindings, aggregates tool properties, and ensures correct function.json generation.
  • Integrated MCP annotation processing into the function configuration generation flow in AnnotationHandlerImpl.java.

Binding Name Handling and Validation

  • Centralized the definition of the system-reserved binding name ($return) in AzureFunctionsAnnotationConstants.java and updated all usages to reference this constant instead of hardcoding the string. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Added validation logic in AnnotationHandlerImpl.java to ensure all user-defined binding names within a function are unique, while allowing duplicates for system-reserved names like $return.

Dependency Update

  • Updated the Maven plugin version in azure-functions-maven-plugin/pom.xml from 1.39.0 to 1.40.0.

Flanker32
Flanker32 previously approved these changes Sep 28, 2025
Copy link
Copy Markdown
Member

@Flanker32 Flanker32 left a comment

Choose a reason for hiding this comment

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

LGTM

@Flanker32
Copy link
Copy Markdown
Member

@ahmedmuhsin Thanks for your efforts, the PR look fine.

One more question about the template, shall we add a return value to the function so that it could return something to mcp clients? Currently the void function will return empty to mcp clients, while usually mcp tools should return some messages.

Flanker32
Flanker32 previously approved these changes Oct 9, 2025
Copy link
Copy Markdown
Member

@Flanker32 Flanker32 left a comment

Choose a reason for hiding this comment

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

LGTM

Flanker32
Flanker32 previously approved these changes Oct 31, 2025
Copy link
Copy Markdown
Member

@Flanker32 Flanker32 left a comment

Choose a reason for hiding this comment

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

LGTM

@Flanker32 Flanker32 merged commit f99694c into microsoft:develop Nov 2, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants