Skip to content

Remove requirement for FWR to be custom for MCP custom-handler to run locally #4704

@lilyjma

Description

@lilyjma

Problem Statement

Currently, Functions worker runtime (FWR) must be set to custom for custom handlers that are self-hosted MCP servers (i.e., with "configurationProfile": "mcp-custom-handler") in order to run the server locally.

However, when deploying the server to Azure, FWR must be set to a specific language (such as dotnet-isolated, python) and the AzureWebJobsFeatureFlags app setting must also be added. Attempting to add the feature flag to local.settings.json locally does not work, and FWR must be set to custom. This introduces a discrepancy between local development and cloud deployment requirements, causing confusion and extra manual steps.

image1

Requirements

  • Local development consistency: When running locally, FWR should support a specific language value (e.g., dotnet-isolated) if configurationProfile = mcp-custom-handler or AzureWebJobsFeatureFlags=EnableMcpCustomHandlerPreview is present, instead of requiring FWR to be custom.
  • Deployment consistency: Both local and cloud deployment flows honor the same requirements for configuration.
  • Backward compatibility: Solutions do not break existing workflows for users not using MCP custom handlers, i.e. if configurationProfile in host.json doesn't have value mcp-custom-handler, then FWR should be custom.

User Experience

Projects with local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
    "AzureWebJobsFeatureFlags": "EnableMcpCustomHandlerPreview"
  }
}

and host.json...

{
   "version": "2.0",
    "configurationProfile": "mcp-custom-handler",
    "customHandler": {
        "description": {
            "defaultExecutablePath": "python",
            "arguments": ["weather.py"] 
        },
        "http": {
            "DefaultAuthorizationLevel": "anonymous"
        },
        "port": "8000"
    }
}

should run locally without error.

Validation & Diagnostics

  • If FWR is set to custom when configurationProfile=mcp-custom-handler, show clear message about FWR needing to be dotnet-isolated|python|node

Acceptance Criteria

  • Local development with configurationProfile = mcp-custom-handler or AzureWebJobsFeatureFlags=EnableMcpCustomHandlerPreview works with FWR set to a specific language
  • Cloud deployment preserves the same configuration requirements.
  • Clear diagnostic errors for invalid FWR configuration.

Work Items

  • Remove requirement for FWR to be custom in local MCP custom-handler scenarios.

FYI @fabiocav @soninaren

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions