io.github.sriramnatrajhen/humsana-mcp

编码与调试

by sriramnatrajhen

通过键盘输入检测开发者的压力、专注度与疲劳状态,并在疲劳时阻止危险命令执行。

什么是 io.github.sriramnatrajhen/humsana-mcp

通过键盘输入检测开发者的压力、专注度与疲劳状态,并在疲劳时阻止危险命令执行。

README

@humsana/mcp-server

Cognitive Security for AI-assisted development.

🛡️ "The breathalyzer for your terminal."

Humsana prevents you from running dangerous commands or accepting large AI code rewrites when you're fatigued. Think of it as an industrial safety interlock, but for your brain.

What It Does

Command Protection (safe_execute_command)

SituationResult
You're fresh, running ls✅ Runs normally
You're fresh, running rm -rf⚠️ Warning, allowed
You're tired, running rm -rfBLOCKED — requires override

AI Rewrite Protection (safe_write_file)

SituationResult
AI writes new file✅ Allowed
AI rewrites 10 lines✅ Allowed
You're tired + AI deletes 30+ lines⚠️ Warning
You're tired + AI deletes 50+ linesBLOCKED — saved for review

Quick Start

1. Install the Daemon

bash
pip install humsana-daemon
humsana start

Keep this running in a terminal tab.

2. Install the MCP Server

bash
npm install -g @humsana/mcp-server

3. Configure Claude Desktop

Create/edit ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{
  "mcpServers": {
    "humsana": {
      "command": "node",
      "args": ["/path/to/humsana-mcp/dist/index.js"]
    }
  }
}

4. Restart Claude Desktop

Quit (Cmd+Q) and reopen.

5. Test It

Ask Claude: "What's my current state?"


Execution Modes

Humsana starts in dry-run mode for safety. Commands are simulated, not executed.

Dry-Run Mode (Default)

code
✅ [DRY RUN] Safety check passed.
Command: `kubectl delete pods`
This command WOULD have been executed.
(Execution skipped: dry_run mode active)

Switching to Live Mode

When you trust the system, enable real execution:

Step 1: Create/edit ~/.humsana/config.yaml:

yaml
# Change this from 'dry_run' to 'live'
execution_mode: live

# Optional: adjust thresholds
fatigue_threshold: 70
write_warn_threshold: 30
write_block_threshold: 50

Step 2: Restart Claude Desktop (Cmd+Q, reopen)

Step 3: Test with a safe command first:

code
Run `echo "live mode working"`

You should see actual output instead of "WOULD have been executed."


Configuration Reference

Create ~/.humsana/config.yaml:

yaml
# === EXECUTION MODE ===
# 'dry_run' (default) - Simulates commands, nothing executed
# 'live' - Actually executes commands and writes files
execution_mode: dry_run

# === FATIGUE THRESHOLDS ===
# Fatigue level (0-100) above which dangerous commands are blocked
fatigue_threshold: 70

# Lines removed to trigger warning (when fatigued)
write_warn_threshold: 30

# Lines removed to trigger hard block (when fatigued)
write_block_threshold: 50

# === CUSTOM PATTERNS ===
# Additional dangerous commands to block
deny_patterns:
  - "aws ec2 terminate"
  - "docker rm -f"

# === NOTIFICATIONS ===
# Webhook for Slack/PagerDuty (fires on safety overrides)
webhook_url: https://hooks.slack.com/services/XXX/YYY/ZZZ

Override Protocol

When blocked, say:

code
OVERRIDE SAFETY PROTOCOL: [reason]

Example:

code
OVERRIDE SAFETY PROTOCOL: P0 production outage, need to restart pods

This is logged to ~/.humsana/audit.json and sent to your webhook.


Tools Available

ToolPurpose
get_user_stateGet current stress, focus, fatigue levels
check_dangerous_commandCheck if a command would be blocked
safe_execute_commandExecute shell commands with interlock
safe_write_fileWrite files with AI rewrite protection

Files & Folders

PathPurpose
~/.humsana/signals.dbBehavioral data from daemon
~/.humsana/config.yamlYour configuration
~/.humsana/activity.jsonActivity heartbeats (for fatigue)
~/.humsana/audit.jsonSafety event log
~/.humsana/pending_reviews/Blocked AI writes saved here

Privacy

🔒 100% Local.

  • All data stays on your machine
  • No network calls (except optional webhook)
  • No telemetry, no tracking
  • Fully auditable open-source code

Troubleshooting

"Daemon not running" error

Start the daemon in a terminal:

bash
humsana start

Commands not executing

Check your mode:

bash
cat ~/.humsana/config.yaml | grep execution_mode

If it says dry_run, change to live and restart Claude.

MCP not connecting

Verify your Claude Desktop config path:

  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Ensure the path to dist/index.js is correct

License

MIT

常见问题

io.github.sriramnatrajhen/humsana-mcp 是什么?

通过键盘输入检测开发者的压力、专注度与疲劳状态,并在疲劳时阻止危险命令执行。

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描123.0k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描123.0k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描123.0k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
84.2k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
53.3k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.4k

评论