hap.servers.agentยถ

AgentServer implementation for exposing Haive agents via HAP protocol.

This module provides a HAP server that wraps any Haive agent and exposes its functionality through tools, resources, and prompts.

Classesยถ

AgentServer

HAP server that exposes a Haive agent via MCP-like protocol.

Module Contentsยถ

class hap.servers.agent.AgentServer(agent, name=None, description=None, expose_tools=True, expose_state=True)ยถ

Bases: hap.server.HAPServer

HAP server that exposes a Haive agent via MCP-like protocol.

This server wraps any Haive agent and provides: - Tool for executing the agent - Resources for agent state and configuration - Tools for individual agent tools (if applicable) - Structured output schema access

Initialize AgentServer.

Parameters:
  • agent (Any) โ€“ The Haive agent to expose

  • name (Optional[str]) โ€“ Server name (defaults to agent-{agent.name})

  • description (Optional[str]) โ€“ Server description

  • expose_tools (bool) โ€“ Whether to expose agentโ€™s individual tools

  • expose_state (bool) โ€“ Whether to expose agent state as resource

get_capabilities()ยถ

Get server capabilities including agent-specific ones.

Return type:

List[hap.types.ServerCapability]