KosmoKrator

communication

Mattermost CLI for AI Agents

Use the Mattermost CLI from KosmoKrator to call Mattermost tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 6 read 1 write Bearer token auth

Mattermost CLI Setup

Mattermost can be configured headlessly with `kosmokrator integrations:configure mattermost`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure mattermost --set access_token="$MATTERMOST_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor mattermost --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token MATTERMOST_ACCESS_TOKEN Secret secret yes Access Token
url MATTERMOST_URL URL url no Server URL

Call Mattermost Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call mattermost.mattermost_list_channels '{
  "page": 1,
  "per_page": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:mattermost mattermost_list_channels '{
  "page": 1,
  "per_page": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs mattermost --json
kosmo integrations:docs mattermost.mattermost_list_channels --json
kosmo integrations:schema mattermost.mattermost_list_channels --json
kosmo integrations:search "Mattermost" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Mattermost.

mattermost.mattermost_list_channels

Read read

List channels the current user belongs to in Mattermost. Returns channel IDs, names, types, and team associations. Use this to discover available channels before posting messages or reading posts.

Parameters
page, per_page

Generic CLI call

kosmo integrations:call mattermost.mattermost_list_channels '{"page":1,"per_page":1}' --json

Provider shortcut

kosmo integrations:mattermost mattermost_list_channels '{"page":1,"per_page":1}' --json

mattermost.mattermost_get_channel

Read read

Get details of a specific Mattermost channel by ID. Returns channel name, display name, type, header, purpose, and member counts.

Parameters
channel_id

Generic CLI call

kosmo integrations:call mattermost.mattermost_get_channel '{"channel_id":"example_channel_id"}' --json

Provider shortcut

kosmo integrations:mattermost mattermost_get_channel '{"channel_id":"example_channel_id"}' --json

mattermost.mattermost_create_post

Write write

Post a message to a Mattermost channel. Provide the channel_id and the message text. Returns the created post with its ID and timestamp.

Parameters
channel_id, message

Generic CLI call

kosmo integrations:call mattermost.mattermost_create_post '{"channel_id":"example_channel_id","message":"example_message"}' --json

Provider shortcut

kosmo integrations:mattermost mattermost_create_post '{"channel_id":"example_channel_id","message":"example_message"}' --json

mattermost.mattermost_list_posts

Read read

List posts in a Mattermost channel. Returns post IDs, messages, author info, and timestamps. Use page and per_page for pagination.

Parameters
channel_id, page, per_page

Generic CLI call

kosmo integrations:call mattermost.mattermost_list_posts '{"channel_id":"example_channel_id","page":1,"per_page":1}' --json

Provider shortcut

kosmo integrations:mattermost mattermost_list_posts '{"channel_id":"example_channel_id","page":1,"per_page":1}' --json

mattermost.mattermost_get_post

Read read

Get a specific Mattermost post by ID. Returns the full post including message content, author, channel, and timestamps.

Parameters
post_id

Generic CLI call

kosmo integrations:call mattermost.mattermost_get_post '{"post_id":"example_post_id"}' --json

Provider shortcut

kosmo integrations:mattermost mattermost_get_post '{"post_id":"example_post_id"}' --json

mattermost.mattermost_list_teams

Read read

List teams the current user belongs to in Mattermost. Returns team IDs, names, display names, and types. Use this to discover available teams before working with channels.

Parameters
page, per_page

Generic CLI call

kosmo integrations:call mattermost.mattermost_list_teams '{"page":1,"per_page":1}' --json

Provider shortcut

kosmo integrations:mattermost mattermost_list_teams '{"page":1,"per_page":1}' --json

mattermost.mattermost_get_current_user

Read read

Get the profile of the currently authenticated Mattermost user. Returns username, email, display name, roles, and locale.

Parameters
none

Generic CLI call

kosmo integrations:call mattermost.mattermost_get_current_user '{}' --json

Provider shortcut

kosmo integrations:mattermost mattermost_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

mattermost.mattermost_list_channels

List channels the current user belongs to in Mattermost. Returns channel IDs, names, types, and team associations. Use this to discover available channels before posting messages or reading posts.

Operation
Read read
Schema command
kosmo integrations:schema mattermost.mattermost_list_channels --json
ParameterTypeRequiredDescription
page integer no Page number (0-indexed). Default: 0.
per_page integer no Number of channels per page. Default: 60.

mattermost.mattermost_get_channel

Get details of a specific Mattermost channel by ID. Returns channel name, display name, type, header, purpose, and member counts.

Operation
Read read
Schema command
kosmo integrations:schema mattermost.mattermost_get_channel --json
ParameterTypeRequiredDescription
channel_id string yes The channel ID.

mattermost.mattermost_create_post

Post a message to a Mattermost channel. Provide the channel_id and the message text. Returns the created post with its ID and timestamp.

Operation
Write write
Schema command
kosmo integrations:schema mattermost.mattermost_create_post --json
ParameterTypeRequiredDescription
channel_id string yes The channel ID to post the message in.
message string yes The message text to post. Supports Markdown formatting.

mattermost.mattermost_list_posts

List posts in a Mattermost channel. Returns post IDs, messages, author info, and timestamps. Use page and per_page for pagination.

Operation
Read read
Schema command
kosmo integrations:schema mattermost.mattermost_list_posts --json
ParameterTypeRequiredDescription
channel_id string yes The channel ID to list posts from.
page integer no Page number (0-indexed). Default: 0.
per_page integer no Number of posts per page. Default: 60.

mattermost.mattermost_get_post

Get a specific Mattermost post by ID. Returns the full post including message content, author, channel, and timestamps.

Operation
Read read
Schema command
kosmo integrations:schema mattermost.mattermost_get_post --json
ParameterTypeRequiredDescription
post_id string yes The post ID.

mattermost.mattermost_list_teams

List teams the current user belongs to in Mattermost. Returns team IDs, names, display names, and types. Use this to discover available teams before working with channels.

Operation
Read read
Schema command
kosmo integrations:schema mattermost.mattermost_list_teams --json
ParameterTypeRequiredDescription
page integer no Page number (0-indexed). Default: 0.
per_page integer no Number of teams per page. Default: 60.

mattermost.mattermost_get_current_user

Get the profile of the currently authenticated Mattermost user. Returns username, email, display name, roles, and locale.

Operation
Read read
Schema command
kosmo integrations:schema mattermost.mattermost_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.