Skip to content

Mobile MCP: let AI agents drive your iOS and Android apps. MCP server for simulators, emulators and real devices. Works with Claude Code, Codex, Cursor and any MCP client.

feat: check if new version of mcp

gmegidish14b015f29ab4
diff --git a/src/server.ts b/src/server.ts
index 6e5b3b5..2ec73eb 100644
--- a/src/server.ts
+++ b/src/server.ts
@@ -15,6 +15,24 @@ const getAgentVersion = (): string => {
return json.version;
};
+const getLatestAgentVersion = async (): Promise<string> => {
+ const response = await fetch("https://api.github.com/repos/mobile-next/mobile-mcp/tags?per_page=1");
+ const json = await response.json();
+ return json[0].name;
+};
+
+const checkForLatestAgentVersion = async (): Promise<void> => {
+ try {
+ const latestVersion = await getLatestAgentVersion();
+ const currentVersion = getAgentVersion();
+ if (latestVersion !== currentVersion) {
+ trace(`You are running an older version of the agent. Please update to the latest version: ${latestVersion}.`);
+ }
+ } catch (error: any) {
+ // ignore
+ }
+};
+
export const createMcpServer = (): McpServer => {
const server = new McpServer({
@@ -352,5 +370,8 @@ export const createMcpServer = (): McpServer => {
}
);
+ // async check for latest agent version
+ checkForLatestAgentVersion().then();
+
return server;
};