kafen-mcp
Enables AI agents to read and browse a Discourse forum, including listing topics and categories, reading topic posts as Markdown, searching with Discourse filters, viewing user profiles and notifications, and fetching images from posts.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@kafen-mcp search the forum for recent topics about credit card cashback"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
kafen-mcp
An MCP server that lets AI agents read 卡粉论坛 DocOfCard, a Discourse forum about credit cards, banking and payments.
The forum requires an account to read anything. kafen-mcp signs in with a Discourse User API key issued through the forum's own device authorization page: you approve it once in your browser, and the key is limited to the read scope, so the server can browse but never post, like, or change settings.
Tools
Tool | What it does |
| Latest / new / unread / top / hot feeds, optionally filtered by category and tag, paginated |
| A topic's posts as Markdown (author, time, reply target, likes, reactions, polls); accepts ids or URLs and pages by post number |
| Full-text search with Discourse filters ( |
| Category tree with slugs, ids, topic counts and descriptions |
| Profile, stats, bio and recent topics/replies of a user |
| The signed-in account's notifications (does not mark them read) |
| Fetches a screenshot or image from a post and returns it to the model |
| Start the browser authorization from inside the agent and check which account is active |
Post HTML is converted to compact Markdown: images link to the original upload (with the forum's AI caption as alt text when available), quotes name their source post, and oneboxes collapse to a titled link.
Related MCP server: Discourse MCP
Setup
Requires Node.js 22 or newer.
git clone https://github.com/ChrAlpha/kafen-mcp.git
cd kafen-mcp
pnpm install
pnpm buildAuthorize
node dist/cli.mjs loginThe command prints a link and a confirmation code. Open the link in a browser where you are logged in to the forum, check the code, and click Authorize. The key is stored in $XDG_CONFIG_HOME/kafen-mcp/credentials.json (usually ~/.config/kafen-mcp/, %APPDATA%\kafen-mcp\ on Windows) with 0600 permissions.
You can skip this step and let the agent call the login tool instead; it returns the same link and code for you to open, and auth_status waits for the approval.
node dist/cli.mjs status # which account is active
node dist/cli.mjs logout # revoke the key on the forum and delete it locallyThe key also appears under Preferences → Apps on your forum profile (/my/preferences/apps), where it can be revoked at any time.
Register with an MCP client
Claude Code:
claude mcp add kafen -- node /absolute/path/to/kafen-mcp/dist/cli.mjsClaude Desktop, Cursor and other clients that use an mcpServers JSON block:
{
"mcpServers": {
"kafen": {
"command": "node",
"args": ["/absolute/path/to/kafen-mcp/dist/cli.mjs"]
}
}
}Codex (~/.codex/config.toml):
[mcp_servers.kafen]
command = "node"
args = ["/absolute/path/to/kafen-mcp/dist/cli.mjs"]Configuration
Variable | Default | Purpose |
|
| Forum to read; any Discourse site with user API keys enabled works |
|
| Where |
| — | Use this key instead of the credential store (for CI or containers) |
|
| Client id the key in |
Rate limits
Discourse allows about 50 requests per minute and 4,000 per day for each User API key. The client keeps itself under 45 requests per minute, waits out short 429 responses once, and reports longer waits to the agent instead of blocking. Most tools cost one request; read_topic with a large limit and get_user cost up to three.
Development
pnpm typecheck
pnpm test # unit tests
pnpm build && KAFEN_E2E=1 KAFEN_BASE_URL=https://meta.discourse.org pnpm test e2eThe end-to-end suite drives the built server over stdio against a live forum. To run it against DocOfCard, log in first and pass the same KAFEN_MCP_CONFIG_DIR.
License
Available Tools
9 toolsauth_statusAuthorization statusARead-onlyIdempotent
Report whether the server can read the forum and as which user. With wait_seconds, first waits for a pending login to be approved.
Inputs: wait_seconds.
get_userGet user profileARead-onlyIdempotent
Show a user's profile, activity stats, bio, and their most recent topics and replies.
Inputs: username (required), recent.
list_categoriesList categoriesARead-onlyIdempotent
List all forum categories and subcategories with slugs, ids, topic counts and descriptions.
Inputs: no named parameters.
list_notificationsList notificationsARead-onlyIdempotent
List the logged-in account's notifications (replies, mentions, quotes, likes, messages, badges), newest first. Reading them does not mark them as read.
Inputs: limit, unread_only.
list_topicsList topicsARead-onlyIdempotent
List topics from a feed, optionally limited to a category and/or tag. Returns titles, ids, stats and last activity; use read_topic for content.
Inputs: tag, feed, page, order, +3 more.
loginLog in to the forumAIdempotent
Start a browser-based authorization that issues a read-only API key for this server. Returns an approval link and confirmation code that the user must open while logged in to the forum. Reuses an in-flight request; does nothing if a working key is already present.
Inputs: no named parameters.
read_topicRead topicARead-onlyIdempotent
Read a topic's posts as Markdown, with author, time, reply target, likes and polls. Accepts a topic id or any topic URL (a post number in the URL becomes the starting post).
Inputs: topic (required), limit, post_number.
searchSearchARead-onlyIdempotent
Full-text search over posts. Supports Discourse filters inside the query: @username, #category-slug, tags:a,b, in:title, in:first (first posts only), status:open|closed|solved|unsolved, after:YYYY-MM-DD, before:YYYY-MM-DD, order:latest|likes|views|latest_topic, min_posts:N. Chinese keywords work as-is.
Inputs: query (required), page.
view_imageView imageARead-onlyIdempotent
Fetch an image referenced in a post (forum uploads or external links) and return it so it can be looked at. PNG, JPEG, GIF and WebP up to 10 MB.
Inputs: url (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool targets a distinct resource or action: categories, topic feeds, topic content, full-text search, users, notifications, images, and the two auth operations. The only potential overlap (list_topics vs. search) is clearly resolved by the descriptions distinguishing feed browsing from full-text querying. login vs. auth_status are cleanly split into 'start' and 'check status'.
All names are consistent snake_case with meaningful verbs (list_categories, read_topic, get_user, view_image, list_notifications). Minor deviations exist where a bare verb is used without an object noun (login, search, auth_status), but the pattern remains predictable overall.
Nine tools is well within the ideal 3-15 range and every tool earns its place in a read-only forum client. No redundant or filler tools are present, and auth is handled with just two tools.
For a deliberately read-only forum surface, coverage is strong: categories, feeds, topic reading, search with rich filters, user profiles, notifications, images, and auth lifecycle. Minor gaps remain (e.g. no standalone tag listing or direct single-post fetch), and write operations are absent by design rather than omission.
Related MCP Connectors
Web search and page-reading for AI agents. One-click OAuth connect, or a Caesar API key.
Web search, data extraction and controlled browser automation for AI assistants via OAuth.
Query Reddit communities, posts, brands and trends from your AI agent. OAuth 2.1.
Search or monitor any Flarum-powered forum for discussions, replies, participants, dates, and…
Related MCP Servers
AlicenseAqualityCmaintenanceEnables AI agents to interact with Discourse forums through search, reading topics/posts, managing categories and users. Supports secure authentication and optional write operations with rate limiting.1411,259 npm79MIT- AlicenseAqualityDmaintenanceEnables AI agents to interact with Discourse forums through search, reading topics/posts, managing categories and tags, chat channels, and optionally creating content with safeguarded write operations.1511,259 npmMIT
- FlicenseAqualityCmaintenanceEnables an AI agent to read and act on a single Discourse forum as one user, including posting, private messages, likes, reactions, bookmarks, watch/track/mute, and reading its own notifications via a stdio MCP server.8-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to read public forum threads, start discussions, and post replies via HTTP and JSON, with optional authenticated write access.MIT