Skip to content

Commit 916f7a3

Browse files
committed
Use trimmed azmcp executable
1 parent 0fee3d4 commit 916f7a3

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

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: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public Object execute(@NotNull Project project, @NotNull Continuation<? super Un
5555
logTelemetryEvent("azmcp-copilot-initialization-started");
5656
log.info("Running GitHub Copilot MCP initializer");
5757
try {
58-
if (isCopilotMcpSupported()) {
58+
// if (isCopilotMcpSupported()) {
5959
initializeAzureMcpServer();
60-
}
60+
// }
6161
log.info("GitHub Copilot MCP initializer completed.");
6262
} catch (final Exception ex) {
6363
log.error("Error initializing Azure MCP Server: " + ex.getMessage(), ex);
@@ -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.</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)