{"_id":"@donach/mattermost-mcp","name":"@donach/mattermost-mcp","dist-tags":{"latest":"1.1.2"},"versions":{"1.1.2":{"name":"@donach/mattermost-mcp","version":"1.1.2","description":"Mattermost MCP Server","repository":{"type":"git","url":"git+https://github.com/dhavli/mattermost-mcp.git"},"author":{"name":"donach"},"main":"build/index.js","type":"module","bin":{"mattermost-mcp":"build/index.js"},"scripts":{"build":"tsc","postbuild":"chmod +x build/index.js","start":"node build/index.js","dev":"tsc && node build/index.js"},"keywords":["mattermost","mcp","model-context-protocol"],"license":"MIT","dependencies":{"@modelcontextprotocol/sdk":"^0.7.0","node-cron":"^3.0.3","node-fetch":"^3.3.2"},"devDependencies":{"@types/node":"^20.11.0","@types/node-cron":"^3.0.11","typescript":"^5.3.3"},"_id":"@donach/mattermost-mcp@1.1.2","gitHead":"75204d23b5075caa973d08021525ff879c752b43","bugs":{"url":"https://github.com/dhavli/mattermost-mcp/issues"},"homepage":"https://github.com/dhavli/mattermost-mcp#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-UqFqEZXhDZm1qY2Z/kZ5+fqkxU+Agn39LhRTmbUOprwWXjqOdJ3PTXTRxsk4jFdky5VPLcU0fXpntjrh49kpBw==","shasum":"0e3aec9967c34ce24c826dfb7490c3b99307f381","tarball":"https://registry.npmjs.org/@donach/mattermost-mcp/-/mattermost-mcp-1.1.2.tgz","fileCount":14,"unpackedSize":73581,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIEaJFS+mywoV6asScw2dNLDzmnbgo1coS4/oUFGsbeVjAiEAxI3hVI4NHW/kEaNq+x4GoEl1JANBhFkVutAb5Sc0xDA="}]},"_npmUser":{"name":"donach","email":"donach.cz@gmail.com"},"directories":{},"maintainers":[{"name":"donach","email":"donach.cz@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mattermost-mcp_1.1.2_1772055676593_0.563685551674439"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-25T21:41:16.500Z","1.1.2":"2026-02-25T21:41:16.745Z","modified":"2026-02-25T21:41:16.984Z"},"maintainers":[{"name":"donach","email":"donach.cz@gmail.com"}],"description":"Mattermost MCP Server","homepage":"https://github.com/dhavli/mattermost-mcp#readme","keywords":["mattermost","mcp","model-context-protocol"],"repository":{"type":"git","url":"git+https://github.com/dhavli/mattermost-mcp.git"},"author":{"name":"donach"},"bugs":{"url":"https://github.com/dhavli/mattermost-mcp/issues"},"license":"MIT","readme":"# Mattermost MCP Server\n\nMCP Server for the Mattermost API, enabling Claude and other MCP clients to interact with Mattermost workspaces.\n\n## Quick Start\n\n### Using npx (recommended)\n\n```bash\nnpx @donach/mattermost-mcp --help\n```\n\n### Using environment variables\n\n```bash\nMATTERMOST_URL=https://your-mattermost.com/api/v4 \\\nMATTERMOST_TOKEN=your-token \\\nMATTERMOST_TEAM_ID=your-team-id \\\nnpx @donach/mattermost-mcp\n```\n\n### Using CLI arguments\n\n```bash\nnpx @donach/mattermost-mcp \\\n  --url https://your-mattermost.com/api/v4 \\\n  --token your-token \\\n  --team-id your-team-id\n```\n\n## Installation\n\n### Option 1: npx (no installation needed)\n\n```bash\nnpx @donach/mattermost-mcp\n```\n\n### Option 2: Global installation\n\n```bash\nnpm install -g @donach/mattermost-mcp\nmattermost-mcp --help\n```\n\n### Option 3: Clone and build\n\n```bash\ngit clone https://github.com/dhavli/mattermost-mcp.git\ncd mattermost-mcp\nnpm install\nnpm run build\nnpm start\n```\n\n## Configuration\n\nThe server supports multiple configuration methods with the following priority (highest to lowest):\n\n1. **CLI arguments** (`--url`, `--token`, `--team-id`)\n2. **Environment variables** (`MATTERMOST_URL`, `MATTERMOST_TOKEN`, `MATTERMOST_TEAM_ID`)\n3. **config.local.json** (for local overrides, gitignored)\n4. **config.json** (default configuration)\n\n### CLI Arguments\n\n| Argument | Description |\n|----------|-------------|\n| `--url <url>` | Mattermost API URL (e.g., https://mattermost.example.com/api/v4) |\n| `--token <token>` | Mattermost personal access token |\n| `--team-id <id>` | Mattermost team ID |\n| `--run-monitoring` | Run topic monitoring immediately on startup |\n| `--exit-after-monitoring` | Exit after running monitoring (use with --run-monitoring) |\n| `--help` | Show help message |\n\n### Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `MATTERMOST_URL` | Mattermost API URL |\n| `MATTERMOST_TOKEN` | Mattermost personal access token |\n| `MATTERMOST_TEAM_ID` | Mattermost team ID |\n\n### Configuration File\n\nCreate `config.local.json` (gitignored) or use `config.json`:\n\n```json\n{\n  \"mattermostUrl\": \"https://your-mattermost-instance.com/api/v4\",\n  \"token\": \"your-personal-access-token\",\n  \"teamId\": \"your-team-id\",\n  \"monitoring\": {\n    \"enabled\": false,\n    \"schedule\": \"*/15 * * * *\",\n    \"channels\": [\"town-square\", \"off-topic\"],\n    \"topics\": [\"tv series\", \"champions league\"],\n    \"messageLimit\": 50\n  }\n}\n```\n\n## Claude Code Integration\n\nAdd to your Claude Code MCP settings (`~/.claude/claude_desktop_config.json` or via `claude mcp add`):\n\n```json\n{\n  \"mcpServers\": {\n    \"mattermost\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@donach/mattermost-mcp@latest\"],\n      \"env\": {\n        \"MATTERMOST_URL\": \"https://your-mattermost.com/api/v4\",\n        \"MATTERMOST_TOKEN\": \"your-token\",\n        \"MATTERMOST_TEAM_ID\": \"your-team-id\"\n      }\n    }\n  }\n}\n```\n\nOr using a config file:\n\n```json\n{\n  \"mcpServers\": {\n    \"mattermost\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/mattermost-mcp/build/index.js\"]\n    }\n  }\n}\n```\n\n## Features\n\n### Channel Tools\n\n| Tool | Description |\n|------|-------------|\n| `mattermost_list_channels` | List channels in the workspace (public, private, and DMs) |\n| `mattermost_get_channel_history` | Get messages from a channel with filtering options |\n\n#### `mattermost_list_channels` Options\n\n- `limit` (default: 100): Maximum number of channels to return\n- `page` (default: 0): Page number for pagination\n- `include_private` (default: false): If true, returns all channels including private channels and direct messages (DMs)\n\n#### `mattermost_get_channel_history` Options\n\n- `channel_id` (required): The ID of the channel\n- `limit`: Number of messages to retrieve. **If not specified or 0, returns ALL messages**\n- `page` (default: 0): Page number for pagination (only used when limit > 0)\n- `since_date`: ISO 8601 date to get messages after (e.g., \"2025-01-15\")\n- `before_date`: ISO 8601 date to get messages before. Use with `since_date` for date ranges\n- `before_post_id`: Get messages before this post ID (cursor pagination)\n- `after_post_id`: Get messages after this post ID (cursor pagination)\n\n**Examples:**\n\n```javascript\n// Get ALL messages from a channel\n{ \"channel_id\": \"abc123\" }\n\n// Get last 50 messages\n{ \"channel_id\": \"abc123\", \"limit\": 50 }\n\n// Get all messages from December 18, 2025\n{ \"channel_id\": \"abc123\", \"since_date\": \"2025-12-18\", \"before_date\": \"2025-12-19\" }\n\n// Get messages from a specific date onwards\n{ \"channel_id\": \"abc123\", \"since_date\": \"2025-12-15\" }\n```\n\n### Message Tools\n\n| Tool | Description |\n|------|-------------|\n| `mattermost_post_message` | Post a new message to a channel |\n| `mattermost_reply_to_thread` | Reply to a specific message thread |\n| `mattermost_add_reaction` | Add an emoji reaction to a message |\n| `mattermost_get_thread_replies` | Get all replies in a thread |\n\n### User Tools\n\n| Tool | Description |\n|------|-------------|\n| `mattermost_get_users` | Get a list of users in the workspace |\n| `mattermost_get_user_profile` | Get detailed profile information for a user |\n\n### Monitoring Tools\n\n| Tool | Description |\n|------|-------------|\n| `mattermost_run_monitoring` | Trigger topic monitoring immediately |\n\n## Topic Monitoring\n\nThe server includes a topic monitoring system that can:\n- Monitor specified channels for messages containing topics of interest\n- Run on a configurable schedule (using cron syntax)\n- Send notifications when relevant topics are discussed\n\n### Configuration\n\n```json\n{\n  \"monitoring\": {\n    \"enabled\": true,\n    \"schedule\": \"*/15 * * * *\",\n    \"channels\": [\"general\", \"random\"],\n    \"topics\": [\"important\", \"urgent\"],\n    \"messageLimit\": 50,\n    \"notificationChannelId\": \"optional-channel-id\",\n    \"userId\": \"optional-user-id\"\n  }\n}\n```\n\n### Running Monitoring Manually\n\n```bash\n# Run monitoring and continue server\nmattermost-mcp --run-monitoring\n\n# Run monitoring and exit (useful for cron jobs)\nmattermost-mcp --run-monitoring --exit-after-monitoring\n```\n\n## Getting Your Credentials\n\n### Mattermost URL\nYour Mattermost API URL is typically: `https://your-mattermost-domain.com/api/v4`\n\n### Personal Access Token\n1. Go to **Account Settings** > **Security** > **Personal Access Tokens**\n2. Click **Create Token**\n3. Give it a description and create\n4. Copy the token (it won't be shown again)\n\n### Team ID\n1. Go to your team in Mattermost\n2. Open browser developer tools (F12)\n3. Go to **Network** tab\n4. Refresh the page\n5. Look for API calls containing `teams/` — the ID is in the URL\n\nOr use the Mattermost API:\n```bash\ncurl -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  https://your-mattermost.com/api/v4/teams\n```\n\n## Troubleshooting\n\n### Missing Configuration Error\n\n```\nMissing required configuration:\n  - mattermostUrl (--url or MATTERMOST_URL)\n  - token (--token or MATTERMOST_TOKEN)\n  - teamId (--team-id or MATTERMOST_TEAM_ID)\n```\n\nMake sure you've provided all required configuration via CLI arguments, environment variables, or config file.\n\n### Permission Errors\n\nVerify that:\n1. Your personal access token has the necessary permissions\n2. The token is correctly set\n3. The Mattermost URL and team ID are correct\n\n## License\n\nMIT License\n","readmeFilename":"README.md","_rev":"1-a0c51e635022fe2581b66f777cb096c1"}