UNPKG

arbitrum-mcp-tools

Version:

A comprehensive collection of Model Context Protocol (MCP) tools for interacting with the Arbitrum blockchain. Enables AI assistants like Claude, Cursor, Windsurf, VS Code, Gemini CLI, and OpenAI Codex to perform blockchain operations including account an

70 lines (69 loc) 2.6 kB
import os from "os"; import fs from "fs"; export function getPlatform() { const platform = os.platform(); if (platform === "darwin" || platform === "win32" || platform === "linux") { return platform; } return "linux"; // Default fallback } export function getHomeDir() { return os.homedir(); } export function directoryExists(path) { try { return fs.existsSync(path) && fs.statSync(path).isDirectory(); } catch (_a) { return false; } } export function fileExists(path) { try { return fs.existsSync(path) && fs.statSync(path).isFile(); } catch (_a) { return false; } } export function isAppInstalled(appName) { const platform = getPlatform(); switch (appName) { case "claude-desktop": if (platform === "darwin") { return directoryExists("/Applications/Claude.app") || fileExists(`${getHomeDir()}/Library/Application Support/Claude/claude_desktop_config.json`); } else if (platform === "win32") { return directoryExists(`${process.env.LOCALAPPDATA}/Programs/Claude`) || fileExists(`${process.env.APPDATA}/Claude/claude_desktop_config.json`); } return fileExists(`${getHomeDir()}/.config/Claude/claude_desktop_config.json`); case "claude-code": // Claude Code CLI - check if .claude.json exists or claude command is available return fileExists(`${getHomeDir()}/.claude.json`) || fileExists(`${getHomeDir()}/.claude/settings.json`); case "cursor": if (platform === "darwin") { return directoryExists("/Applications/Cursor.app") || directoryExists(`${getHomeDir()}/.cursor`); } return directoryExists(`${getHomeDir()}/.cursor`); case "windsurf": return directoryExists(`${getHomeDir()}/.codeium/windsurf`); case "vscode": if (platform === "darwin") { return directoryExists("/Applications/Visual Studio Code.app") || directoryExists(`${getHomeDir()}/.vscode`); } return directoryExists(`${getHomeDir()}/.vscode`); case "gemini": return directoryExists(`${getHomeDir()}/.gemini`); case "antigravity": return directoryExists(`${getHomeDir()}/.gemini/antigravity`); case "codex": return directoryExists(`${getHomeDir()}/.codex`); default: return false; } }