Skip to main content

HACS CLI

Command-line interface for Healthcare Agent Communication Standard

Currently in development - use MCP server for full functionality

🚧 Development Status

The HACS CLI is under development. Current healthcare operations are available through:

  1. MCP Server - 42+ Hacs Tools via JSON-RPC
  2. Docker Compose - Infrastructure deployment and configuration
  3. LangGraph Agent - Interactive AI workflows via examples

🚀 Current Functionality

Deployment & Setup

# Start infrastructure with Docker Compose
docker-compose up -d

# Manual MCP server startup
python -m hacs_utils.mcp.cli

# FastMCP server for streamable HTTP
python -m hacs_utils.mcp.fastmcp_server

# Environment configuration
export HACS_MCP_SERVER_URL=http://127.0.0.1:8000
export DATABASE_URL=postgresql://hacs:hacs_dev@localhost:5432/hacs

Service Management

# Docker Compose operations
docker-compose up -d              # Start all services
docker-compose down               # Stop services
docker-compose logs hacs-mcp-server  # View logs

# Health checks
curl $HACS_MCP_SERVER_URL         # MCP server
curl http://localhost:8001/       # LangGraph agent (if running)

🛠️ MCP Server Interface

All healthcare operations use the Model Context Protocol server:

# List available Hacs Tools (42 tools)
curl -X POST -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/list","id":1}' \
  $HACS_MCP_SERVER_URL

# Create patient record
curl -X POST -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "create_resource",
      "arguments": {
        "resource_type": "Patient",
        "resource_data": {
          "full_name": "John Smith",
          "birth_date": "1980-05-15",
          "gender": "male"
        }
      }
    },
    "id": 1
  }' \
  $HACS_MCP_SERVER_URL

📋 Planned CLI Features

Future development will include:

  • hacs validate - Resource validation
  • hacs convert - Format conversion (HACS ↔ FHIR)
  • hacs memory - Memory management commands
  • hacs evidence - Evidence and knowledge operations
  • hacs auth - Authentication and permissions
  • hacs export - Data export utilities

🏥 Healthcare Workflows

Use Python requests for programmatic access:

import requests

def use_hacs_tool(tool_name, arguments):
    """Call HACS tools"""
    import os
    server_url = os.getenv('HACS_MCP_SERVER_URL', 'http://127.0.0.1:8000')
    response = requests.post(server_url, json={
        "jsonrpc": "2.0",
        "method": "tools/call",
        "params": {
            "name": tool_name,
            "arguments": arguments
        },
        "id": 1
    })
    return response.json()

# Clinical memory management
memory_result = use_hacs_tool("create_memory", {
    "content": "Patient shows improvement after medication adjustment",
    "memory_type": "episodic",
    "importance_score": 0.8
})

# Search clinical memories
search_result = use_hacs_tool("search_memories", {
    "query": "medication response",
    "limit": 5
})

⚙️ Configuration

Environment Setup

# Healthcare organization configuration
export HACS_ORGANIZATION="your_health_system"
export HEALTHCARE_SYSTEM_NAME="Your Health System"
export DATABASE_URL="postgresql://hacs:password@localhost:5432/hacs"

# LLM Provider (for AI operations)
export ANTHROPIC_API_KEY="sk-ant-..."  # Recommended for healthcare
export OPENAI_API_KEY="sk-..."         # Alternative

Virtual Environment

# Activate HACS environment
source .venv/bin/activate

# Check environment status
which python
pip list | grep hacs

🔍 Troubleshooting

Common Issues

# Check MCP server status
curl http://localhost:8000/

# View server logs
docker-compose logs hacs-mcp-server

# Restart services
docker-compose restart hacs-mcp-server

Health Checks

# Complete system health check
echo "📡 MCP Server:"
curl -s http://localhost:8000/ && echo "✅ Running" || echo "❌ Not responding"

echo "🗄️ PostgreSQL:"
docker-compose exec postgres pg_isready -U hacs && echo "✅ Ready" || echo "❌ Not ready"

📊 Current Tool Categories

Available via MCP server:

  • 🔍 Resource Discovery & Development (5 tools)
  • 📋 Record Management (8 tools)
  • 🧠 Memory Management (5 tools)
  • ✅ Validation & Schema (3 tools)
  • 🎨 Advanced Tools (3 tools)
  • 📚 Knowledge Management (1 tool)

📄 License

Apache-2.0 License - see LICENSE for details.


For immediate healthcare AI development, use the MCP server interface - it provides complete access to all HACS functionality through a standardized protocol.

Metadata

Release files for hacs-cli 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hacs-cli 0.4.3
File Size Uploaded Provenance
hacs_cli-0.4.3.tar.gz 13.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hacs-cli 0.4.3
File Interpreter ABI Platform
hacs_cli-0.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 26.8 kB

Release files / hacs_cli-0.4.3.tar.gz

Download URL hacs_cli-0.4.3.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4aff4239faeefd4fbb95afc6d336027755e426c379711d098f901ac30640837e
BLAKE2b-256 checksum
How to use checksums
3cc88159df66beb3f3722ad80433eeca7b5f3dd93a16700d64a02eee77ae5ad2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.6

Release files / hacs_cli-0.4.3-py3-none-any.whl

Download URL hacs_cli-0.4.3-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b2b781ef0bfc4ce33e5225e47f2e8cad14355e333fa7fb9f28d66e3636244ce
BLAKE2b-256 checksum
How to use checksums
014d232b008ee047535c867e93153bd4a0721b7e6ce254a7a7796b409e815ea6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.6

Security for hacs-cli 0.4.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page