{
  "markdown": "# Nefesh MCP + A2A Server\n\nA [Model Context Protocol](https://modelcontextprotocol.io) and [Agent-to-Agent (A2A)](https://a2a-protocol.org) server that gives AI agents real-time awareness of human physiological state.\n\n## What it does\n\nSend sensor data (heart rate, voice, facial expression, text sentiment), get back a unified state with a machine-readable action your agent can follow directly. Zero prompt engineering required.\n\nOn the 2nd+ call, the response includes `adaptation_effectiveness` — telling your agent whether its previous approach actually worked. A closed-loop feedback system for self-improving agents.\n\n## Adaptation Effectiveness (Closed-Loop)\n\nMost APIs give you a state. Nefesh tells you whether your reaction to that state actually worked.\n\nOn the 2nd+ call within a session, every response includes:\n\n```json\n{\n  \"state\": \"focused\",\n  \"stress_score\": 45,\n  \"suggested_action\": \"simplify_and_focus\",\n  \"adaptation_effectiveness\": {\n    \"previous_action\": \"de-escalate_and_shorten\",\n    \"previous_score\": 68,\n    \"current_score\": 45,\n    \"stress_delta\": -23,\n    \"effective\": true\n  }\n}\n```\n\nYour agent can read `effective: true` and know its previous de-escalation worked. If `effective: false`, the agent adjusts its strategy. No other human-state system provides this feedback loop.\n\n## Setup\n\n### Option A: Connect first, get a key through your agent (fastest)\n\nAdd the config **without an API key** — your agent will get one automatically.\n\n```json\n{\n  \"mcpServers\": {\n    \"nefesh\": {\n      \"url\": \"https://mcp.nefesh.ai/mcp\"\n    }\n  }\n}\n```\n\nThen ask your agent:\n\n> \"Get me a free Nefesh API key using my email address\"\n\nThe agent calls `request_api_key` → you click one email link → the agent picks up the key. No signup form, no manual copy-paste. After that, add the key to your config for future sessions:\n\n```json\n{\n  \"mcpServers\": {\n    \"nefesh\": {\n      \"url\": \"https://mcp.nefesh.ai/mcp\",\n      \"headers\": {\n        \"X-Nefesh-Key\": \"nfsh_free_...\"\n      }\n    }\n  }\n}\n```\n\n### Option B: Get a key first, then connect\n\nSign up at [nefesh.ai/signup](https://nefesh.ai/signup) (1,000 calls/month, no credit card), then add the config with your key:\n\n```json\n{\n  \"mcpServers\": {\n    \"nefesh\": {\n      \"url\": \"https://mcp.nefesh.ai/mcp\",\n      \"headers\": {\n        \"X-Nefesh-Key\": \"YOUR_API_KEY\"\n      }\n    }\n  }\n}\n```\n\n### Agent-specific config files\n\n| Agent | Config file |\n|-------|-------------|\n| **Cursor** | `~/.cursor/mcp.json` |\n| **Windsurf** | `~/.codeium/windsurf/mcp_config.json` |\n| **Claude Desktop** | `~/Library/Application Support/Claude/claude_desktop_config.json` |\n| **Claude Code** | `.mcp.json` (project root) |\n| **VS Code (Copilot)** | `.vscode/mcp.json` or `~/Library/Application Support/Code/User/mcp.json` |\n| **Cline** | `cline_mcp_settings.json` (via UI: \"Configure MCP Servers\") |\n| **Continue.dev** | `.continue/config.yaml` |\n| **Roo Code** | `.roo/mcp.json` |\n| **Kiro (Amazon)** | `~/.kiro/mcp.json` |\n| **OpenClaw** | `~/.config/openclaw/mcp.json` |\n| **JetBrains IDEs** | Settings > Tools > MCP Server |\n| **Zed** | `~/.config/zed/settings.json` (uses `context_servers`) |\n| **OpenAI Codex CLI** | `~/.codex/config.toml` |\n| **Goose CLI** | `~/.config/goose/config.yaml` |\n| **ChatGPT Desktop** | Settings > Apps > Add MCP Server (UI) |\n| **Gemini CLI** | Settings (UI) |\n| **Augment** | Settings Panel (UI) |\n| **Replit** | Integrations Page (web UI) |\n| **LibreChat** | `librechat.yaml` (self-hosted) |\n\n<details>\n<summary><strong>VS Code (Copilot)</strong> — uses <code>servers</code> instead of <code>mcpServers</code></summary>\n\n```json\n{\n  \"servers\": {\n    \"nefesh\": {\n      \"type\": \"http\",\n      \"url\": \"https://mcp.nefesh.ai/mcp\",\n      \"headers\": {\n        \"X-Nefesh-Key\": \"<YOUR_API_KEY>\"\n      }\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary><strong>Zed</strong> — uses <code>context_servers</code> in settings.json</summary>\n\n```json\n{\n  \"context_servers\": {\n    \"nefesh\": {\n      \"settings\": {\n        \"url\": \"https://mcp.nefesh.ai/mcp\",\n        \"headers\": {\n          \"X-Nefesh-Key\": \"<YOUR_API_KEY>\"\n        }\n      }\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary><strong>OpenAI Codex CLI</strong> — uses TOML in <code>~/.codex/config.toml</code></summary>\n\n```toml\n[mcp_servers.nefesh]\nurl = \"https://mcp.nefesh.ai/mcp\"\n```\n</details>\n\n<details>\n<summary><strong>Continue.dev</strong> — uses YAML in <code>.continue/config.yaml</code></summary>\n\n```yaml\nmcpServers:\n  - name: nefesh\n    type: streamable-http\n    url: https://mcp.nefesh.ai/mcp\n```\n</details>\n\nAll agents connect via [Streamable HTTP](https://modelcontextprotocol.io/specification/2025-11-25/basic/transports) — no local installation required.\n\n## A2A Integration (Agent-to-Agent Protocol v1.0)\n\nNefesh is also available as an A2A-compatible agent. While MCP handles tool-calling (your agent calls Nefesh), A2A enables agent-collaboration — other AI agents can communicate with Nefesh as a peer.\n\n**Agent Card:** [`/.well-known/agent-card.json`](https://mcp.nefesh.ai/.well-known/agent-card.json)\n\n**A2A Endpoint:** `POST https://mcp.nefesh.ai/a2a` (JSON-RPC 2.0)\n\n| A2A Skill | Description |\n|-----------|-------------|\n| `get-human-state` | Stress state (0-100), suggested_action, adaptation_effectiveness |\n| `ingest-signals` | Send biometric signals, receive unified state |\n| `get-trigger-memory` | Psychological trigger profile (active vs resolved) |\n| `get-session-history` | Timestamped history with trend |\n\nSame authentication as MCP — `X-Nefesh-Key` header or `Authorization: Bearer` token. Free tier works on both protocols.\n\nSource: [nefesh-ai/nefesh-a2a](https://github.com/nefesh-ai/nefesh-a2a) · Docs: [nefesh.ai/docs/a2a](https://nefesh.ai/docs/a2a)\n\n## MCP Tools\n\n| Tool | Auth | Description |\n|------|:---:|-------------|\n| `request_api_key` | No | Request a free API key. You MUST ask the user for their real email first. Do not invent or guess emails. The user receives a verification link they must click. Poll with `check_api_key_status` until ready. |\n| `check_api_key_status` | No | Poll for API key activation using the same email the user provided. Returns `pending` or `ready` with API key. |\n| `get_human_state` | Yes | Get stress state (0-100), `suggested_action` (maintain/simplify/de-escalate/pause), and `adaptation_effectiveness` — a closed-loop showing whether your previous action reduced stress. |\n| `ingest` | Yes | Send biometric signals (heart rate, HRV, voice tone, expression, sentiment, 30+ fields) and get unified state back. Include `subject_id` for trigger memory. |\n| `get_trigger_memory` | Yes | Get psychological trigger profile — which topics cause stress (active) and which have been resolved over time. |\n| `get_session_history` | Yes | Get timestamped state history with trend (rising/falling/stable). |\n\n## How self-provisioning works\n\nYour AI agent can get a free API key autonomously. You only click one email link.\n\n1. Agent asks you: \"What is your email address?\"\n2. Agent calls `request_api_key(your_real_email)`. No API key needed for this call.\n3. You receive a verification email and click the link\n4. Agent polls `check_api_key_status(your_real_email)` every 10 seconds\n5. Once verified, the agent receives the API key and can use all other tools\n\n**Important:** The agent must use your real, accessible email address. Disposable emails are blocked. The verification link must be clicked by you to activate the key.\n\nFree tier: 1,000 calls/month, all signal types, 10 req/min. No credit card.\n\n## Quick test\n\nAfter adding the config, ask your AI agent:\n\n> \"What tools do you have from Nefesh?\"\n\nIt should list the 6 tools above.\n\n## Pricing\n\n| Plan | Price | API Calls |\n|------|-------|-----------|\n| **Free** | $0 | 1,000/month, no credit card |\n| **Solo** | $25/month | 50,000/month |\n| **Enterprise** | Custom | Custom SLA |\n\n## CLI Alternative\n\nPrefer the terminal over MCP? Use the Nefesh CLI (10-32x lower token cost than MCP for AI agents):\n\n```bash\nnpm install -g @nefesh/cli\nnefesh ingest --session test --heart-rate 72 --tone calm\nnefesh state test --json\n```\n\nGitHub: [nefesh-ai/nefesh-cli](https://github.com/nefesh-ai/nefesh-cli)\n\n## Gateway Alternative\n\nWant the AI to adapt automatically? Use the [Nefesh Cognitive Compute Router](https://gateway.nefesh.ai). Change your LLM base URL to `gateway.nefesh.ai` and the gateway adjusts system prompt and temperature based on biometric state. Three modes: OpenAI-compatible (`/v1/chat/completions`), Anthropic passthrough (`/v1/messages`), and Unified Anthropic for any backend. Zero code changes.\n\nGitHub: [nefesh-ai/nefesh-gateway](https://github.com/nefesh-ai/nefesh-gateway)\n\n## Human State Protocol (HSP)\n\nNefesh implements and maintains the [Human State Protocol](https://github.com/nefesh-ai/human-state-protocol), an open specification for exchanging human physiological state between AI systems. HSP defines a standard JSON format for stress scores, behavioral recommendations, and adaptation feedback so any agent can produce or consume human state data interoperably. Apache 2.0.\n\nGitHub: [nefesh-ai/human-state-protocol](https://github.com/nefesh-ai/human-state-protocol) · Docs: [nefesh.ai/docs/hsp](https://nefesh.ai/docs/hsp)\n\n## Documentation\n\n- [Full API Reference](https://nefesh.ai/llms-full.txt)\n- [Quick Start](https://nefesh.ai/docs/quickstart)\n- [State Mapping](https://nefesh.ai/docs/states)\n- [MCP Server](https://nefesh.ai/docs/mcp) · [Source](https://github.com/nefesh-ai/nefesh-mcp-server)\n- [A2A Server](https://nefesh.ai/docs/a2a) · [Source](https://github.com/nefesh-ai/nefesh-a2a)\n- [Cognitive Compute Router (Gateway)](https://nefesh.ai/docs/gateway) · [Source](https://github.com/nefesh-ai/nefesh-gateway)\n- [CLI](https://nefesh.ai/docs/cli) · [Source](https://github.com/nefesh-ai/nefesh-cli)\n- [Human State Protocol (HSP)](https://nefesh.ai/docs/hsp) · [Source](https://github.com/nefesh-ai/human-state-protocol)\n- [A2A Agent Card](https://mcp.nefesh.ai/.well-known/agent-card.json)\n- [A2A Protocol Spec](https://a2a-protocol.org/latest/specification/)\n\n## Privacy\n\n- No video or audio uploads — edge processing runs client-side\n- No PII stored\n- GDPR/BIPA compliant — cascading deletion via `delete_subject`\n- Not a medical device — for contextual AI adaptation only\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n",
  "bytes": 10327,
  "sha": "11e03196c8215995eaf691e72435793d835b16c0144606f2b381430705952684",
  "repo_slug": "nefesh-ai/nefesh-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_ai_nefesh_human_state_5f20e998/readme"
}