AI agents (MCP)

veilmesh-bot-mcp lets an agent that speaks the Model Context Protocol, such as Claude, read and answer a group through your bot.

It is a small server on standard input and output, next to the bot's daemon, with the Python standard library only. The agent gets four tools and nothing else. Take mcp/veilmesh_bot_mcp.py from github.com/veilmesh/veilmesh-bot.

python3 veilmesh_bot_mcp.py --token-file token.json \
  --group <group id> [--group <another>] [--files-dir /srv/bot-out]

With Claude Desktop

{
  "mcpServers": {
    "veilmesh-ops": {
      "command": "python3",
      "args": ["/opt/veilmesh-bot/mcp/veilmesh_bot_mcp.py",
               "--token-file", "/etc/veilmesh-bot/token.json",
               "--group", "<group id>"]
    }
  }
}

Tools

  • list_groups — the allowed groups the bot is in.
  • read_messages(group, wait_seconds) — new messages of one allowed group (none from before the session).
  • send_message(group, text, reply_to) — into a group the agent has read in this session; a reply only to a message seen there; up to 4000 characters.
  • send_file(group, name, caption) — only with --files-dir, a file from that folder (which must lie inside the daemon's own --files-dir).

What it cannot do

  • See or touch any group not given with --group; the list is required.
  • Leave groups, change webhooks, tokens or commands, or reach the bot's account and keys.
  • Read files outside the folder you name.

Every message in a group is input to the agent. A member can write one that tries to make it do something else: give a bot in a group no tool or access you would not give every member of that group. See Security.