Skip to main content

FastMCP App Closer

MCP 服务器,用于关闭正在运行的应用程序。

功能特性

  • 🔍 智能进程查找 - 支持模糊匹配进程名
  • 🎯 别名支持 - 内置常见应用别名(微信、飞书、钉钉等)
  • 🛡️ 安全保护 - 防止关闭系统关键进程
  • 🌍 跨平台 - 支持 Windows、macOS、Linux

Installation

From PyPI (Recommended)

pip install fastmcp-app-closer

From Source

git clone https://github.com/yourusername/fastmcp-app-closer.git
cd fastmcp_app_closer
pip install -e .

使用方法

启动 MCP 服务器

fastmcp-app-closer

可用工具

1. close_app - 关闭应用

关闭指定名称的应用程序。

参数:

  • appName (string, required) - 应用名称或进程名

示例:

{
  "tool": "close_app",
  "arguments": {
    "appName": "微信"
  }
}

支持的匹配方式:

  • 精确匹配:WeChat.exe
  • 模糊匹配:wechat、WeChat
  • 别名匹配:微信、weixin

2. list_running_apps - 列出运行的应用

列出所有正在运行的应用程序。

示例:

{
  "tool": "list_running_apps"
}

支持的应用别名

应用名 别名
微信 wechat, weixin, wechat.exe
飞书 lark, feishu, lark.exe
钉钉 dingtalk, dingtalk.exe
QQ qq.exe, qqprotect.exe
QQ音乐 qqmusic, qqmusicexternal
网易云音乐 cloudmusic, neteasecloudmusic
日历 (macOS) calendar
备忘录 (macOS) notes

更多别名请查看 ALIAS_GUIDE.md

故障排除

应用无法识别?

如果遇到 "No matching process found" 错误:

  1. 查看实际进程名

    # Windows
    Get-Process | Select-Object Name
    
    # macOS/Linux
    ps aux | grep -i "app_name"
    
  2. 添加自定义别名

    编辑 src/app_closer_mcp/aliases.py,在 PROCESS_ALIASES 中添加:

    "应用中文名": {"actual_process_name"},
    
  3. 使用实际进程名

    直接使用进程名而不是应用名:

    {"appName": "qqmusic"}  // 而不是 "QQ音乐"
    

详细指南请参考 ALIAS_GUIDE.md

安全限制

以下系统关键进程无法被关闭:

  • Windows: explorer.exe, winlogon.exe, csrss.exe, services.exe, svchost.exe
  • macOS: Finder, WindowServer, loginwindow
  • Linux: systemd, init, Xorg

开发

运行测试

pip install -e ".[dev]"
pytest

代码格式化

black src/
ruff check src/

许可证

MIT License

Metadata

Release files for fastmcp-app-closer 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastmcp-app-closer 0.1.2
File Size Uploaded
fastmcp_app_closer-0.1.2.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastmcp-app-closer 0.1.2
File Interpreter ABI Platform
fastmcp_app_closer-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 28.2 kB

Release files / fastmcp_app_closer-0.1.2.tar.gz

Download URL fastmcp_app_closer-0.1.2.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
37fa1f89f2174296d1161e440d819ed7ebe4ebbe794aae698e3b2531f5fbeaf0
BLAKE2b-256 checksum
How to use checksums
ad0a8c283905b785d54412fd6cf38702255dcebaef0f1d5d01ea48b2de165bcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / fastmcp_app_closer-0.1.2-py3-none-any.whl

Download URL fastmcp_app_closer-0.1.2-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d07146b9814f9711d20a51e3cd674ae26434b7eb9f65c9730d9d790fa2821a55
BLAKE2b-256 checksum
How to use checksums
a6c6a9d128d82f46b12343b8b8cd1a12f86b1e8dd8e839daf57bc3be46fe30df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page