Skip to content

Commit 92e7a82

Browse files
Merge pull request #11228 from srnagar/trimmed-azmcp
Use trimmed azmcp executable
2 parents 0fee3d4 + e630804 commit 92e7a82

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
All notable changes to "Azure Toolkit for IntelliJ IDEA" will be documented in this file.
44

55
- [Change Log](#change-log)
6+
- [3.96.2](#3962)
67
- [3.96.1](#3961)
78
- [3.95.0](#3950)
89
- [3.94.0](#3940)
@@ -118,6 +119,9 @@ All notable changes to "Azure Toolkit for IntelliJ IDEA" will be documented in t
118119
- [3.0.7](#307)
119120
- [3.0.6](#306)
120121

122+
## 3.96.2
123+
- Configure GitHub Copilot with trimmed Azure MCP server for faster startup and a smaller footprint.
124+
121125
## 3.96.1
122126
- Configure Azure MCP server for GitHub Copilot
123127
- Integrate azd to Azure Explorer

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-azuremcp/src/main/java/com/microsoft/azure/toolkit/intellij/azuremcp/AzureMcpPackageManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public synchronized File getAzureMcpExecutable() {
4040

4141
final Optional<GithubAsset> githubAsset = latestRelease.getAssets()
4242
.stream()
43-
.filter(asset -> asset.getName().contains(platform))
43+
.filter(asset -> asset.getName().startsWith("azure-mcp-" + platform))
4444
.findFirst();
4545

4646
if (githubAsset.isPresent()) {
@@ -189,5 +189,4 @@ private static String getArch() {
189189
throw new RuntimeException("Unsupported architecture: " + arch);
190190
}
191191

192-
193192
}

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-azuremcp/src/main/java/com/microsoft/azure/toolkit/intellij/azuremcp/GithubClient.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.fasterxml.jackson.databind.DeserializationFeature;
77
import com.fasterxml.jackson.databind.ObjectMapper;
88
import com.fasterxml.jackson.databind.SerializationFeature;
9+
import lombok.extern.slf4j.Slf4j;
910
import org.apache.http.client.methods.CloseableHttpResponse;
1011
import org.apache.http.client.methods.HttpUriRequest;
1112
import org.apache.http.client.methods.RequestBuilder;
@@ -18,13 +19,14 @@
1819
import java.io.IOException;
1920
import java.util.List;
2021

22+
@Slf4j
2123
public class GithubClient implements Closeable {
2224
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper()
2325
.configure(JsonParser.Feature.ALLOW_COMMENTS, true)
2426
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
2527
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
2628
.enable(SerializationFeature.INDENT_OUTPUT);
27-
private static final String AZURE_MCP_RELEASE_URL = "https://aka.ms/azmcp/releases";
29+
private static final String AZURE_MCP_RELEASE_URL = "https://api.github.com/repos/microsoft/mcp/releases";
2830
private static final TypeReference<List<GithubRelease>> GITHUB_RELEASE_LIST_TYPE = new TypeReference<>() {
2931
};
3032

@@ -36,6 +38,8 @@ public GithubRelease getLatestAzureMcpRelease() {
3638
final List<GithubRelease> releases = OBJECT_MAPPER.readValue(response.getEntity().getContent(), GITHUB_RELEASE_LIST_TYPE);
3739
return releases.stream().findFirst().orElse(null);
3840
} catch (final IOException exception) {
41+
log.error("Error getting latest Azure MCP release details: " + exception.getMessage());
42+
AzureMcpUtils.logErrorTelemetryEvent("azmcp-get-latest-release-failed", exception);
3943
return null;
4044
}
4145
}
@@ -47,6 +51,8 @@ public boolean downloadToFile(String downloadUrl, File downloadFile) {
4751
downloadResponse.getEntity().getContent().transferTo(fos);
4852
return true;
4953
} catch (final IOException exception) {
54+
log.error("Error downloading Azure MCP: " + exception.getMessage());
55+
AzureMcpUtils.logErrorTelemetryEvent("azmcp-download-executable-failed", exception);
5056
return false;
5157
}
5258
}

PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-azuremcp/src/main/java/com/microsoft/azure/toolkit/intellij/azuremcp/GithubCopilotMcpInitializer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,17 @@ private void configureMcpServer(File azMcpExe) throws Exception {
9393
log.info("Initializing Azure MCP Server");
9494
final String mcpConfigLocation = getConfigPath().getAbsolutePath() + "/mcp.json";
9595
final Path mcpConfigPath = Path.of(mcpConfigLocation);
96-
final McpConfig mcpConfig;
96+
McpConfig mcpConfig = new McpConfig();
9797
if (mcpConfigPath.toFile().exists()) {
9898
log.info("MCP configuration file already exists at: " + mcpConfigLocation);
9999
final String mcpContents = new String(Files.readAllBytes(mcpConfigPath));
100-
mcpConfig = OBJECT_MAPPER.readValue(mcpContents, McpConfig.class);
100+
if (!mcpContents.isEmpty()) {
101+
mcpConfig = OBJECT_MAPPER.readValue(mcpContents, McpConfig.class);
102+
}
101103
} else {
102104
// Generally, GitHub Copilot creates the mcp.json file. However, there is a possiblility that it's deleted.
103105
log.info("Creating MCP configuration directory: " + mcpConfigLocation);
104106
Files.createDirectories(mcpConfigPath.getParent());
105-
mcpConfig = new McpConfig();
106107
}
107108
Map<String, McpServer> servers = mcpConfig.getServers();
108109
if (servers == null) {

PluginsAndFeatures/azure-toolkit-for-intellij/src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<description><![CDATA[
99
<html>
1010
<p>The plugin allows Java developers to easily develop, configure, test, and deploy highly available and scalable Java applications to Azure. The plugin supports Azure App Service, Azure Functions, Azure Spring Apps, Azure Kubernetes, Azure Container Apps, Virtual Machines, Azure Database for MySQL, Azure Cosmos DB, SQL Server, Azure Storage, and Application Insights. It also supports Azure Synapse data engineers, Azure HDInsight developers and Apache Spark on SQL Server users to create, test and submit Apache Spark/Hadoop jobs to Azure from IntelliJ on all supported platforms.</p>
11+
<p>This plugin also includes Azure MCP Server that adds smart, context-aware AI tools right inside GitHub Copilot for IntelliJ IDEA to help you work more efficiently with Azure resources. The Azure MCP Server supercharges your agents with Azure context across all the popular Azure services. For more details, please refer to <a href="https://learn.microsoft.com/azure/developer/azure-mcp-server/">Azure MCP Server documentation.</a></p>
1112
<ul>
1213
<li><a href="https://learn.microsoft.com/en-us/azure/developer/java/toolkit-for-intellij/create-hello-world-web-app">Azure Web App Workflow:</a> Run your web applications on Azure Web App and view logs.</li>
1314
<li><a href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-maven-intellij?toc=%2Fazure%2Fdeveloper%2Fjava%2Ftoolkit-for-intellij%2Ftoc.json&bc=%2Fazure%2Fdeveloper%2Fjava%2Ftoolkit-for-intellij%2Fbreadcrumb%2Ftoc.json">Azure Functions Workflow:</a> Scaffold, run, debug your Functions App locally and deploy it on Azure.</li>

0 commit comments

Comments
 (0)