Skip to content

Commit d16e9c5

Browse files
committed
Fix McpWeatherApp: bump azure-functions-maven-plugin to 1.42.0
Plugin 1.41.0 does not generate a binding for @McpResourceTrigger, so the GetWeatherWidget function failed to start with 'At least one binding must be declared'. 1.42.0 (toolkit-appservice-lib 0.56.0) adds McpResourceTrigger, McpMetadata, McpPromptTrigger, and McpPromptArgument to the binding enum. Also document the required local.settings.json in the README.
1 parent 9275970 commit d16e9c5

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

samples/McpWeatherApp/README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,25 @@ cd ..
3838

3939
This creates a bundled `app/dist/index.html` file that the function serves.
4040

41-
### 2. Build and Run the Function App
41+
### 2. Add a `local.settings.json`
42+
43+
The MCP tool trigger is not an HTTP trigger, so the Functions host requires an `AzureWebJobsStorage` connection. Create `local.settings.json` in the project root (next to `host.json`):
44+
45+
```json
46+
{
47+
"IsEncrypted": false,
48+
"Values": {
49+
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
50+
"FUNCTIONS_WORKER_RUNTIME": "java"
51+
}
52+
}
53+
```
54+
55+
`UseDevelopmentStorage=true` points at [Azurite](https://learn.microsoft.com/azure/storage/common/storage-use-azurite); start it in another terminal (`azurite`) or via the VS Code Azurite extension. Alternatively, paste a real Azure Storage connection string.
56+
57+
> The maven plugin copies `local.settings.json` into `target/azure-functions/<appname>/` during `package`. If you add or change the file after building, re-run `mvn clean package` so the staged copy is refreshed.
58+
59+
### 3. Build and Run the Function App
4260

4361
```bash
4462
mvn clean package
@@ -47,11 +65,11 @@ mvn azure-functions:run
4765

4866
The MCP server will be available at `http://localhost:7071/runtime/webhooks/mcp`.
4967

50-
### 3. Connect from VS Code
68+
### 4. Connect from VS Code
5169

5270
Open **.vscode/mcp.json** at the repo root. Find the server called *local-mcp-function* and click **Start** above the name.
5371

54-
### 4. Prompt the Agent
72+
### 5. Prompt the Agent
5573

5674
Ask Copilot: "What's the weather in Seattle?"
5775

samples/McpWeatherApp/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<properties>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<java.version>17</java.version>
15-
<azure.functions.maven.plugin.version>1.41.0</azure.functions.maven.plugin.version>
15+
<azure.functions.maven.plugin.version>1.42.0</azure.functions.maven.plugin.version>
1616
<azure.functions.java.library.version>3.2.4</azure.functions.java.library.version>
1717
<functionAppName>McpWeatherApp</functionAppName>
1818
</properties>

0 commit comments

Comments
 (0)