# Connecting hermes-mcp to opencode AI

The server is deployed at `https://hermes.squaremcp.com` with a Streamable HTTP MCP endpoint (MCP 1.x).

## Quick setup

An `opencode.json` is already in this repo with the connection pre-configured. Open opencode in this directory and hermes-mcp will be available automatically.

## Manual configuration

### Project-level (`opencode.json` in project root)

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "hermes": {
      "type": "remote",
      "url": "https://hermes.squaremcp.com/mcp",
      "headers": {
        "x-api-key": "YOUR_MCP_API_KEY"
      }
    }
  }
}
```

### Global (`~/.config/opencode/config.json`)

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "hermes": {
      "type": "remote",
      "url": "https://hermes.squaremcp.com/mcp",
      "headers": {
        "x-api-key": "YOUR_MCP_API_KEY"
      }
    }
  }
}
```

Replace `YOUR_MCP_API_KEY` with the value of `MCP_API_KEY` from your `.env` or Kubernetes secret.

## Connection details

| Field | Value |
|-------|-------|
| Transport | Streamable HTTP (MCP 1.x) |
| Endpoint | `https://hermes.squaremcp.com/mcp` |
| Auth | `x-api-key` header (or `?key=` query param, or `Authorization: Bearer`) |
| Legacy SSE | `https://hermes.squaremcp.com/sse` |

## Fallback: SSE transport

If opencode requires SSE transport instead of Streamable HTTP:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "hermes": {
      "type": "sse",
      "url": "https://hermes.squaremcp.com/sse",
      "headers": {
        "x-api-key": "YOUR_MCP_API_KEY"
      }
    }
  }
}
```

## Available tools

| Tool | Description |
|------|-------------|
| `get_profile` | Get email address for an account |
| `search_messages` | Search INBOX by keyword / sender / subject |
| `read_message` | Read full message body by UID |
| `list_folders` | List all mailbox folders |
| `create_draft` | Save a draft to the Drafts folder |
| `send_email` | Send an email |
| `whatsapp_send_message` | Send a WhatsApp message |
| `whatsapp_send_template` | Send an approved WhatsApp template message |
| `whatsapp_get_message_status` | Check WhatsApp message delivery status |
| `whatsapp_list_templates` | List approved WhatsApp templates |
| `obsidian_search_notes` | Search notes in the Obsidian vault |
| `obsidian_read_note` | Read a specific note |
| `obsidian_append_to_note` | Append content to a note |
| `obsidian_update_note` | Overwrite a note |
| `obsidian_sync_status` | Check Obsidian sync status |
