Humsana Mcp

io.github.sriramnatrajhen由 GitHub 账号 sriramnatrajhen 发布v1.1.3更新于 Oct 24, 2026

Detect developer stress, focus, fatigue from typing. Block dangerous commands when tired.

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

一个本地 MCP 服务器,根据打字行为读取开发者的压力、专注度和疲劳度,并对 shell 命令和 AI 文件改写设置安全联锁。

可以做什么
从本地守护进程的行为数据读取开发者当前的压力、专注度和疲劳水平,并在执行前检查某条 shell 命令是否会被拦截。通过安全联锁执行 shell 命令,疲劳度高时对危险命令发出警告或直接阻止。写入文件时防止 AI 大规模改写,删除行数超过配置阈值时警告或阻止,并将被阻止的写入保存待审。将安全覆盖记录到本地审计文件,并可选地通知 webhook。
适用场景
适合希望在疲惫时避免执行破坏性命令或接受 AI 大规模改写的开发者,尤其是桌面端的 AI 辅助编码场景。
运行要求
作为本地 stdio 进程由桌面客户端启动(npm 包需要 Node.js)。需要单独安装的 Humsana 守护进程(通过 pip 安装)在终端中运行。配置保存在本地配置文件中;未声明任何 API 密钥或环境变量。
安装前请注意
默认处于 dry-run 模式,命令仅被模拟;切换到 live 模式后会真正执行 shell 命令并写入文件。被阻止的命令可用覆盖语句绕过,该操作会被记录并可能发送到已配置的 webhook。行为数据保留在本地,可选 webhook 除外。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Humsana Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 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 -rf⛔ BLOCKED — 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+ lines⛔ BLOCKED — saved for review

Quick Start

1. Install the Daemon

bash
pip install humsana-daemonhumsana 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)

✅ [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 thresholdsfatigue_threshold: 70write_warn_threshold: 30write_block_threshold: 50

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

Step 3: Test with a safe command first:

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 filesexecution_mode: dry_run
# === FATIGUE THRESHOLDS ===# Fatigue level (0-100) above which dangerous commands are blockedfatigue_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 blockdeny_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:

OVERRIDE SAFETY PROTOCOL: [reason]

Example:

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

来源:README.md,提交 58003d1

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.1.3最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。