MCP Resources

MCP Resources

In addition to tools, the Nefesh MCP server exposes resources that agents can subscribe to for live state updates.

Session State Resource

nefesh://session/{session_id}/state

Returns the current human state for a session as a JSON object. Agents can read this resource to check state without making a tool call.

Example

// Resource URI:
nefesh://session/sess_abc123/state

// Returns:
{
  "session_id": "sess_abc123",
  "state": "focused",
  "stress_score": 45,
  "confidence": 0.78,
  "signals_received": ["cardiovascular"],
  "suggested_action": "simplify_and_focus",
  "action_reason": "heart rate signal",
  "recommendation": "Reduce complexity. 2-3 sentences. Actionable."
}

When to Use Resources vs. Tools

Use CaseApproach
Quick state check before respondingResource (read-only, fast)
Send new sensor dataingest tool
Detailed state with recommendationget_human_state tool
Historical trend analysisget_session_history tool