Bale Bot

v0.3.2
io.github.sepehr071/bale-mcp Checked 4 days ago Published 18 days ago

Private, local Bale bot for agents: read, search and answer messages, ask and wait, files.

Values you need

VariableWhat it is
BALE_BOT_TOKENrequired secret Bot token from @botfather in Bale (https://ble.ir/botfather).
BALE_ALLOWED_CHATSoptional Comma-separated chat ids or @usernames the bot may read and message; all other chats are ignored. Recommended.
BALE_MCP_DBoptional Local message history file (default ~/.bale-mcp/messages.db); ':memory:' keeps nothing on disk.
BALE_MCP_SEND_DIRSoptional Folders bot_send_file may upload local files from (os.pathsep-separated); default is the download folder and the working directory.
BALE_MCP_PROXYoptional Optional HTTP proxy URL for every request; system proxy settings are ignored.

PyPI (uvx) discovery passed

Requires uv (https://docs.astral.sh/uv/)

Run in a terminal
claude mcp add bale-mcp -e 'BALE_BOT_TOKEN=<BALE_BOT_TOKEN>' -- uvx bale-mcp==0.3.2
Add to claude_desktop_config.json
{
  "mcpServers": {
    "bale-mcp": {
      "args": [
        "bale-mcp==0.3.2"
      ],
      "command": "uvx",
      "env": {
        "BALE_BOT_TOKEN": "<BALE_BOT_TOKEN>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "bale-mcp": {
      "args": [
        "bale-mcp==0.3.2"
      ],
      "command": "uvx",
      "env": {
        "BALE_BOT_TOKEN": "<BALE_BOT_TOKEN>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "BALE_BOT_TOKEN",
      "id": "bale-bot-token",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "bale-mcp": {
      "args": [
        "bale-mcp==0.3.2"
      ],
      "command": "uvx",
      "env": {
        "BALE_BOT_TOKEN": "${input:bale-bot-token}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.bale-mcp]
command = "uvx"
args = ["bale-mcp==0.3.2"]
env = { "BALE_BOT_TOKEN" = "<BALE_BOT_TOKEN>" }

For AI agents

  1. Ask the user for: BALE_BOT_TOKEN. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: bot_get_me, bot_get_chat, bot_get_webhook_info, bot_send_message, bot_send_file, bot_edit_message, bot_delete_message, bot_get_new_messages, ….
  5. If it fails, check that the required runtime is installed (uv (https://docs.astral.sh/uv/)) and that the values above are set.

Machine-readable: install.md · manifest.json