ahk-mcp
AutoHotkey v2 MCP 服务器
一个用于 AutoHotkey v2 开发的 TypeScript MCP 服务器。它为 Claude Desktop 等 MCP 客户端提供脚本分析、文件操作、文档搜索和脚本执行工具。
架构

Related MCP server: Hotkeyless AHK MCP
亮点
25+ 个用于 AutoHotkey 工作流的
AHK_*工具聚焦文件发现和活动文件感知操作
带进程跟踪和窗口检测的脚本执行
本地 AutoHotkey 验证和诊断工具
内置 AutoHotkey 文档和提示/上下文辅助工具
Stdio 和 Streamable HTTP 传输(有状态或无状态),以及传统 SSE 端点
可选的不记名令牌认证和 HTTP 模式的 DNS 重绑定保护
环境要求
Node.js 18+
npm
AutoHotkey v2(用于运行/验证工具)
安装
git clone https://github.com/truecrimedev/ahk-mcp.git
cd ahk-mcp
npm install
npm run build运行
npm start开发模式:
npm run dev冒烟测试:
npm run smoke:mcpHTTP 模式和环境变量
npm start 使用 stdio 协议(Claude Desktop)。要在 /mcp 上暴露 Streamable HTTP(以及传统 SSE 端点),请设置 PORT 或传入 --sse:
npm run start:sse行为通过环境变量控制:
变量 | 默认值 | 用途 |
|
| HTTP 端口;设置后启用 HTTP 模式 |
| 关闭 |
|
| 未设置 | 设置后,每个 HTTP 请求都必须发送 |
| 未设置 | 逗号分隔的 |
| 未设置 | 面向浏览器客户端的逗号分隔 |
|
| 已完成任务记录的保留时长(30 分钟); |
|
|
|
安全说明:工具面包含文件写入和进程执行。如果 HTTP 端口可被除本机以外的任何设备访问,请设置 AHK_MCP_AUTH_TOKEN(例如 openssl rand -hex 32)以及两个白名单——默认情况下端点接受所有请求。
有关会话流程、无状态模式详情和 cURL 示例,请参阅 docs/MCP_TRANSPORT_COMPATIBILITY.md。
Claude Desktop 配置
将此内容添加到 claude_desktop_config.json:
{
"mcpServers": {
"ahk": {
"command": "C:\\Program Files\\nodejs\\node.exe",
"args": ["C:\\Users\\YourUsername\\path\\to\\ahk-mcp\\dist\\index.js"],
"env": {
"NODE_ENV": "production",
"AHK_MCP_LOG_LEVEL": "warn"
}
}
}
}在 JSON 中使用绝对路径并转义反斜杠。
配置 AutoHotkey 路径和启动行为
使用 AHK_Config 设置可执行文件路径和非阻塞启动行为:
{
"action": "set",
"ahkPath": "C:\\Users\\YourUsername\\Documents\\Design\\Coding\\AutoHotkey\\bin\\AutoHotkey64.exe",
"waitForStdoutLine": true,
"stdoutLineTimeoutMs": 300
}这由 AHK_Run(以及 AHK_Cloud_Validate 的路径解析)使用。
核心工具
AHK_Smart_Orchestrator:简化多步骤编辑/分析工作流AHK_File_List、AHK_File_View、AHK_File_Edit:文件操作AHK_Analyze、AHK_Diagnostics:分析和诊断AHK_Run:执行脚本(等待、非等待、窗口检测)AHK_Cloud_Validate:基于本地执行的验证AHK_Doc_Search、AHK_Tools_Search:文档和工具查找AHK_Config:MCP 服务器配置
开发命令
npm run build
npm run clean
npm run lint
npm run test
npm run test:integration
npm run smoke:mcp文档
docs/README.mddocs/QUICK_START.mddocs/QUICKREFERENCE.mddocs/MCP_TRANSPORT_COMPATIBILITY.mddocs/ARCHITECTURE_DIAGRAMS.mddocs/RELEASE_NOTES.md
贡献
请参阅 CONTRIBUTING.md 和 AGENTS.md。
许可证
MIT。请参阅 LICENSE。
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
- AlicenseNot gradedqualityCmaintenanceA comprehensive utility MCP server that enables AI assistants to execute system commands, manage files, integrate with Google Sheets and Tasks, perform AI-powered text processing, and load dynamic prompts from markdown files.MIT
- AlicenseAqualityAmaintenanceMCP server for Hotkeyless AHK HTTP API. It lets your agent control your whole computer using hotkeys.42MIT
- AlicenseNot gradedqualityCmaintenanceLocal MCP server bridging ChatGPT Web to local tools for file, shell, git, test, and process management with secure policy controls.MIT
- AlicenseNot gradedqualityAmaintenanceMCP server for advanced PowerShell integration with AI agents, enabling autonomous script execution, code analysis, and IntelliSense.3MIT
Related MCP Connectors
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
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/TrueCrimeDev/ahk-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server