Mattermost MCP Server
Enables Claude to fetch RSS feeds and post messages to a self-hosted Mattermost server using OAuth authentication.
README
Mattermost MCP server
A custom MCP connector that lets Claude (including scheduled Cowork tasks, from
any device) fetch an RSS feed and post messages to your self-hosted Mattermost
server at https://mattermost.your-domain.example.
It runs as a remote HTTP server on your VPS, fronted by nginx + HTTPS, and authenticates Claude with OAuth 2.1 (Dynamic Client Registration + PKCE) — the scheme Claude's "Add custom connector" dialog actually supports. (Claude does not support user-pasted static bearer tokens for custom connectors, which is why OAuth is required here.)
Why a connector at all
Claude's built-in sandbox can only reach an allowlist of domains and cannot
reach your private Mattermost server. The MCP server runs on infrastructure you
control, so it talks to Mattermost directly. Claude still makes the fetching
decisions and does the summarizing/analysis; the connector just provides the
fetch_rss and post_* actions.
Tools exposed
whoami— verify the bot token (auth/connectivity check).fetch_rss(feed_url, max_articles=5)— fetch and parse an RSS/Atom feed.post_to_channel(channel, message, team=None)— post to a channel.post_to_user(username, message)— send a direct message.
Files
server.py— MCP server (stdio + HTTP transports, pluggable auth).auth.py— self-contained OAuth 2.1 authorization server.requirements.txt— Python dependencies.mattermost-mcp.env.example— env template for the VPS.mattermost-mcp.service— systemd unit.nginx-mattermost-mcp.conf— nginx HTTP reverse proxy (certbot-ready).Caddyfile.example— alternative HTTPS reverse-proxy config.
1. Mattermost bot token
System Console → Integrations → Bot Accounts → create a bot → copy its Access
Token. Add the bot to the team (YOUR-TEAM) and the channel (YOUR-CHANNEL). The
token needs permission to create posts.
If you pasted a token into a chat earlier, rotate it and use only the fresh one here.
2. Install on the VPS
sudo useradd --system --create-home --home-dir /opt/mattermost-mcp mcp
sudo install -d -o mcp -g mcp /opt/mattermost-mcp
# copy server.py, auth.py, requirements.txt into /opt/mattermost-mcp/
sudo -u mcp python3 -m venv /opt/mattermost-mcp/.venv
sudo -u mcp /opt/mattermost-mcp/.venv/bin/pip install -r /opt/mattermost-mcp/requirements.txt
3. Configure
sudo cp mattermost-mcp.env.example /etc/mattermost-mcp.env
sudo nano /etc/mattermost-mcp.env
sudo chown mcp:mcp /etc/mattermost-mcp.env
sudo chmod 600 /etc/mattermost-mcp.env
Set at minimum:
MATTERMOST_TOKEN— the fresh bot token.MCP_AUTH=oauthMCP_ISSUER=https://mcp.your-domain.example— must exactly match the public hostname you serve over HTTPS (scheme + host, no trailing slash).MCP_OWNER_PASSWORD— the password you'll type on the consent screen when connecting Claude. Generate a strong one:openssl rand -base64 24.MCP_OAUTH_DB=/var/lib/mattermost-mcp/oauth.db— persisted by the unit'sStateDirectory, so connections survive restarts.
The server binds to 127.0.0.1:8000; nginx is the public front door.
4. Run as a service
sudo cp mattermost-mcp.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now mattermost-mcp
curl http://127.0.0.1:8000/healthz # -> ok
5. HTTPS front door (nginx + certbot)
Point a DNS A record (mcp.your-domain.example) at the VPS, then:
sudo cp nginx-mattermost-mcp.conf /etc/nginx/sites-available/mattermost-mcp
sudo ln -s /etc/nginx/sites-available/mattermost-mcp /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d mcp.your-domain.example # adds the 443/SSL block in place
The supplied nginx config sets proxy_http_version 1.1, proxy_buffering off,
and a long read timeout — required, or the streamed (SSE) MCP responses stall.
(Caddy alternative: Caddyfile.example.)
Sanity-check the OAuth discovery endpoints from your laptop:
curl https://mcp.your-domain.example/healthz
curl https://mcp.your-domain.example/.well-known/oauth-protected-resource
curl https://mcp.your-domain.example/.well-known/oauth-authorization-server
Allowlisting note: Claude's servers connect to yours from the public
internet, originating from 160.79.104.0/21. If you firewall the MCP host,
allow that range.
6. Add the connector in Claude
This is the part that confused you — there are two different features:
- Developer tab → "Local MCPs" edits
claude_desktop_config.jsonand is only for local stdio servers. Not what you want here. - Settings → Connectors → "Add custom connector" is for remote servers. Use this one.
Steps:
- Settings → Connectors → scroll down → Add custom connector.
- URL:
https://mcp.your-domain.example/mcp - Leave OAuth Client ID/Secret blank — the server supports Dynamic Client Registration, so Claude registers itself automatically.
- Click Add. Claude opens the consent screen served by your server; enter
your
MCP_OWNER_PASSWORDand click Allow. - Claude completes the OAuth exchange and the
mattermosttools appear.
Because Claude connects from its cloud (not your device), this works from the desktop app, web, and mobile alike.
7. Test it
Ask Claude:
- "Use the mattermost connector's whoami tool." → returns the bot username.
- "Fetch 5 items from https://news.ycombinator.com/rss and post a bullet summary of each to the YOUR-CHANNEL channel."
8. Then schedule it
Once a manual post works, ask Claude to create the scheduled task that runs
fetch_rss → summarize → post_to_channel at 8am, 1pm, 4pm, 6pm, 8pm and 10pm
daily. Note: a Cowork scheduled task only fires while the Claude app is running
on some device; the connector itself stays up on the VPS regardless. For a
fully device-independent schedule, a cron job on the VPS calling the Anthropic
API directly is the alternative.
Security model
- OAuth 2.1 + PKCE gate the MCP endpoint; only
/healthzand the OAuth discovery/registration endpoints are open. Every connection requires enteringMCP_OWNER_PASSWORDon the consent screen. - Access tokens expire (1h) and refresh-tokens rotate on use; revoke everything
by deleting
oauth.dband restarting. - HTTPS (via nginx/certbot) protects tokens in transit.
MATTERMOST_TOKENauthorizes posting to Mattermost and never leaves the VPS. Scope the bot to only the channels it needs.- Keep
/etc/mattermost-mcp.envatchmod 600.
Local (stdio) alternative
For a single machine without hosting, add to claude_desktop_config.json
(Developer tab) and skip OAuth entirely:
{
"mcpServers": {
"mattermost": {
"command": "/abs/path/mattermost-mcp/.venv/bin/python",
"args": ["/abs/path/mattermost-mcp/server.py"],
"env": {
"MATTERMOST_URL": "https://mattermost.your-domain.example",
"MATTERMOST_TOKEN": "YOUR_BOT_TOKEN",
"MATTERMOST_TEAM": "YOUR-TEAM"
}
}
}
}
(MCP_TRANSPORT defaults to stdio.) This only works on that machine while
Claude is running.
Bearer mode (testing only)
Set MCP_AUTH=bearer and MCP_API_KEY=... to gate the HTTP server with a
static token — useful for curl/inspector testing, but not usable from Claude's
custom-connector dialog.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.