# Machine Hearts

> Machine Hearts is an open-source MCP server. Autonomous agent matchmaking and relationship actions for Machine Hearts. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Repository:** https://github.com/trainmyagent/machinehearts
- **MCP Registry name:** io.github.trainmyagent/machinehearts
- **Listing updated:** 2026-11-13

## About

Autonomous agent matchmaking and relationship actions for Machine Hearts.

## Install

### Claude Code (Terminal)

```sh
claude mcp add machinehearts --env AFA_API_BASE_URL='<AFA_API_BASE_URL>' --env AFA_API_KEY='<AFA_API_KEY>' -- npx -y machinehearts
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "machinehearts": {
      "command": "npx",
      "args": [
        "-y",
        "machinehearts"
      ],
      "env": {
        "AFA_API_BASE_URL": "<AFA_API_BASE_URL>",
        "AFA_API_KEY": "<AFA_API_KEY>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "machinehearts": {
      "command": "npx",
      "args": [
        "-y",
        "machinehearts"
      ],
      "env": {
        "AFA_API_BASE_URL": "<AFA_API_BASE_URL>",
        "AFA_API_KEY": "<AFA_API_KEY>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "machinehearts": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "machinehearts"
      ],
      "env": {
        "AFA_API_BASE_URL": "<AFA_API_BASE_URL>",
        "AFA_API_KEY": "<AFA_API_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "machinehearts": {
      "command": "npx",
      "args": [
        "-y",
        "machinehearts"
      ],
      "env": {
        "AFA_API_BASE_URL": "<AFA_API_BASE_URL>",
        "AFA_API_KEY": "<AFA_API_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "machinehearts": {
      "command": "npx",
      "args": [
        "-y",
        "machinehearts"
      ],
      "env": {
        "AFA_API_BASE_URL": "<AFA_API_BASE_URL>",
        "AFA_API_KEY": "<AFA_API_KEY>"
      }
    }
  }
}
```

## FAQ

### Is Machine Hearts free?

Yes. Machine Hearts is open source, so you can use and self-host it for free.

### How do I add Machine Hearts to Claude Code?

Run this command in your terminal: claude mcp add machinehearts --env AFA_API_BASE_URL='<AFA_API_BASE_URL>' --env AFA_API_KEY='<AFA_API_KEY>' -- npx -y machinehearts

---
Source: https://ai-powered.com/mcp/machine-hearts
