mihomo-ai-failover
Enables automatic failover for OpenAI services by monitoring connectivity to OpenAI endpoints and switching the active proxy node when failures are detected, ensuring reliable access to ChatGPT and the OpenAI API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mihomo-ai-failoverCheck the health of the AI proxy group and show current failover status."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Mihomo AI Failover
OpenAI-aware failover for Mihomo on macOS. It keeps a working selected node and switches a dedicated AI proxy group only after two consecutive, verified hard failures against the same OpenAI target.
Version
0.1.0is an early public preview for macOS, Clash Verge Rev, and Mihomo. It keeps the macOS system proxy and never enables TUN automatically.
中文说明 · AI agent contract · Agent integration · Architecture · Validation
AI agents: read the
openai-network-failoverskill before using any MCP tool. It is the canonical machine-facing contract for supported environments, safety boundaries, tool order, stop conditions, and result reporting. This README is not a substitute for that contract.
Why
Generic url-test groups optimize latency. They do not prove that ChatGPT
login, the OpenAI API, streaming connections, or a particular exit region are
usable. This project validates the real OpenAI path and:
ignores small latency changes and isolated soft anomalies;
excludes local-network and controller failures from blind switching;
maintains active, warm, and cold pools deduplicated by observed exit IP;
ranks health, success history, exit/ASN diversity, cooldown, and stability before latency;
waits after a switch, then closes only stale OpenAI connections on the old chain;
notifies once per all-unavailable outage episode and backs off;
exposes the same behavior through a CLI, local stdio MCP, Codex plugin, and Claude Code plugin.
A silent or spinning Codex UI is only an auxiliary symptom. It never triggers a switch by itself. GitHub, Git, npm, Docker, and ordinary websites are outside the OpenAI failure trigger.
Related MCP server: sieve-map
Install
Install uv, then:
uv tool install \
'mihomo-ai-failover[mcp] @ git+https://github.com/doublebearoliver-cyber/mihomo-ai-failover@v0.1.0'Diagnose and preview before writing:
mihomo-ai-failover diagnose
mihomo-ai-failover check
mihomo-ai-failover profile-previewApply the persistent Clash Verge enhancements and install the user LaunchAgent:
mihomo-ai-failover install \
--confirm INSTALL_MIHOMO_AI_FAILOVERIf restart_required is true, restart Clash Verge, then:
mihomo-ai-failover check
mihomo-ai-failover inventory
mihomo-ai-failover service-startThe installer never edits generated clash-verge.yaml. It backs up and updates
the selected profile's persistent Groups and Rules enhancements.
Codex plugin
codex plugin marketplace add doublebearoliver-cyber/mihomo-ai-failover
codex plugin add mihomo-ai-failover@mihomo-ai-failoverClaude Code plugin
claude plugin marketplace add doublebearoliver-cyber/mihomo-ai-failover
claude plugin install mihomo-ai-failover@mihomo-ai-failoverBoth plugins bundle the same openai-network-failover skill and local MCP
server. MCP mutations are disabled by default and require both local opt-in and
an exact server-enforced confirmation.
Agents without native plugin support can use the generic stdio MCP definition
and load the same SKILL.md as instructions. The skill does not grant access to
the Mac: the agent still needs a trusted local MCP client. See
Agent integration.
Roll back
mihomo-ai-failover service-stop
mihomo-ai-failover profile-rollback \
--confirm ROLLBACK_PROFILE_INTEGRATION
mihomo-ai-failover service-uninstall \
--confirm UNINSTALL_LAUNCH_AGENTRestart Clash Verge after restoring the enhancement backup. The LaunchAgent plist is moved to Trash rather than permanently deleted.
Safety and privacy
Controls only the dedicated AI group.
Uses the local Unix-domain Mihomo controller by default.
Reads the controller secret at runtime and never returns it.
Does not store subscription URLs, proxy server addresses, or proxy credentials.
MCP never returns exit IPs and hides node names by default.
Does not expose a TCP control listener.
A hosted model cannot directly reach a user's localhost. An authenticated remote-to-local bridge is intentionally outside version 0.1. See PRIVACY.md for exact network destinations and local data.
Development
uv sync --all-extras --dev
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run python scripts/scan_sensitive.py
uv run python -m buildLicense
MIT. See LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityCmaintenanceAn MCP server that functions as an intelligent gateway for multiple LLM backends including OpenAI, Claude, and Ollama. It supports automatic provider fallback, streaming responses via Server-Sent Events, and real-time monitoring for robust AI integration.Last updatedMIT
- AlicenseAqualityCmaintenanceLocal MCP server for macOS that scans AI coding tool history (Claude Code, Cursor, Copilot, Cline, Codex, Gemini CLI) for leaked secrets. Finds API keys in chat transcripts, redacts with sieve:// placeholders, and runs commands with Keychain-injected secrets - no plaintext values ever returned.Last updated91MIT
- Flicense-qualityDmaintenanceUnified local MCP AI Gateway that routes across Groq, OpenRouter, Mistral, and local Ollama providers, with OpenAI-compatible APIs, MCP tools, fallback/racing router, monitoring, and web dashboard.Last updated
- Alicense-qualityBmaintenanceA local macOS MCP server for AI Agents that exposes safe endpoints for shell commands, files, processes, macOS automation, browser control, and more.Last updated2MIT
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Uptime, SSL, DNS and domain monitoring you can talk to from Claude or any MCP client.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/doublebearoliver-cyber/mihomo-ai-failover'
If you have feedback or need assistance with the MCP directory API, please join our Discord server