# fmsg MCP server

> Enables AI agents to communicate via federated messaging by sending messages, following threads, reacting, and exchanging attachments.

- Repository: https://github.com/markmnl/fmsg-mcp
- Page: https://hostedmcp.org/servers/markmnl/fmsg-mcp
- Transport: stdio, remote
- Stars: 5
- License: MIT
- Latest version: 1.6.0

## Install

### Claude Code

```sh
claude mcp add --env 'FMSG_API_KEY=<YOUR_FMSG_API_KEY>' --env 'FMSG_API_URL=<FMSG_API_URL>' fmsg-mcp -- npx -y @markmnl/fmsg-mcp
```

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

```json
{
  "mcpServers": {
    "fmsg-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@markmnl/fmsg-mcp"
      ],
      "env": {
        "FMSG_API_KEY": "<YOUR_FMSG_API_KEY>",
        "FMSG_API_URL": "<FMSG_API_URL>"
      }
    }
  }
}
```

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

```json
{
  "servers": {
    "fmsg-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@markmnl/fmsg-mcp"
      ],
      "env": {
        "FMSG_API_KEY": "<YOUR_FMSG_API_KEY>",
        "FMSG_API_URL": "<FMSG_API_URL>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"fmsg-mcp","type":"stdio","command":"npx","args":["-y","@markmnl/fmsg-mcp"],"env":{"FMSG_API_KEY":"<YOUR_FMSG_API_KEY>","FMSG_API_URL":"<FMSG_API_URL>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "fmsg-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@markmnl/fmsg-mcp"
      ],
      "env": {
        "FMSG_API_KEY": "<YOUR_FMSG_API_KEY>",
        "FMSG_API_URL": "<FMSG_API_URL>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add fmsg-mcp --env 'FMSG_API_KEY=<YOUR_FMSG_API_KEY>' --env 'FMSG_API_URL=<FMSG_API_URL>' -- npx -y @markmnl/fmsg-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.fmsg-mcp]
command = "npx"
args = ["-y", "@markmnl/fmsg-mcp"]

[mcp_servers.fmsg-mcp.env]
FMSG_API_KEY = "<YOUR_FMSG_API_KEY>"
FMSG_API_URL = "<FMSG_API_URL>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'FMSG_API_KEY=<YOUR_FMSG_API_KEY>' -e 'FMSG_API_URL=<FMSG_API_URL>' fmsg-mcp npx -- -y @markmnl/fmsg-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "fmsg-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@markmnl/fmsg-mcp"
      ],
      "env": {
        "FMSG_API_KEY": "<YOUR_FMSG_API_KEY>",
        "FMSG_API_URL": "<FMSG_API_URL>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `FMSG_API_KEY` | yes | yes | fmsg API key (fmsgk_...) for the address to send as |
| `FMSG_API_URL` | yes | no | Base URL of your hosting provider's or self-hosted fmsg Web API |
| `FMSG_DEFAULT_DOMAIN` | no | no | Optional: lets short names resolve to @name@<domain> |
| `FMSG_MCP_DOWNLOAD_DIR` | no | no | Optional local folder enabling streamed attachment saves over stdio |

## Tools (22)

- `whoami`
- `resolve_address`
- `list_messages`
- `list_sent`
- `get_message`
- `get_thread`
- `send_message`
- `reply`
- `create_draft`
- `send_draft`
- `delete_draft`
- `add_recipients`
- `react`
- `edit_message`
- `indicate`
- `mark_read`
- `download_attachment`
- `get_attachment_download_url`
- `get_attachment_upload_url`
- `save_attachment`
- `delivery_status`
- `wait_for_message`

## FAQ

### How can I connect my AI agent to fmsg?

You can connect via stdio for local hosts like Claude Desktop or Cursor, or through HTTP using an API key or configured OAuth.

### Can I self-host my fmsg messaging server?

Yes, you can use your choice of fmsg hosting provider or self-host using the fmsg-docker stack.
