hfr mcp
工具去 forum.hardware.fr :服务器 主控程序 对于Claude和独立CLI。
从Claude Code、Claude Desktop或终端阅读主题、发布回复、编辑消息、引用、发送MPS。
功能
| 操作 | MCP工具 | CLI |
|---|---|---|
| 阅读主题 | hfr_read | `hfr read |
| [page]` | ||
| 在打印模式下读取 | hfr_read (打印=真) | `hfr print |
| [page]` | ||
| 列出类别的主题 | hfr_topics | hfr topics [subcat] |
| 发布回复 | hfr_reply | `hfr reply |
| ` | ||
| 编辑帖子 | hfr_edit | `hfr edit |
| ` | ||
| 引用消息 | hfr_quote | `hfr quote |
| ` | ||
| 多报价 | hfr_quote (麻木地) | `hfr quote |
| ...` | ||
| 发送MP | hfr_mp | hfr mp |
| 版本 | -- | hfr version / hfr-mcp --version |
内容使用BBCode HFR([b], [url=], [quotemsg=...],笑脸 :o, [:pseudo]等等)。
快速启动
# Installation
go install github.com/XaaT/hfr-mcp/cmd/hfr-mcp@latest # serveur MCP
go install github.com/XaaT/hfr-mcp/cmd/hfr@latest # CLI
# Ou depuis les sources
go build -o hfr-mcp ./cmd/hfr-mcp/
go build -o hfr ./cmd/hfr/配置MCP(克劳德代码)
添加到 .mcp.json 在项目的根上,或通过 claude mcp add --scope user :
{
"mcpServers": {
"hfr": {
"command": "/chemin/vers/hfr-mcp",
"env": {
"HFR_LOGIN": "pseudo",
"HFR_PASSWD": "motdepasse"
}
}
}
}登录是懒惰的:HFR连接仅在第一次工具调用时完成。会话在整个过程期间保持在内存(cookie jar)中。
认证
配置文件(先找到):
./hfr.conf(曲目库)~/.config/hfr/config
login=pseudo
passwd=motdepasse环境变量 HFR_LOGIN / HFR_PASSWD 接管文件。启动时检查文件权限:如果其他用户可以读取,则会显示警告。
使用CLI
# Lecture anonyme
hfr read 13 120036 350
# Derniere page
hfr read 13 120036 last
# Range de pages (concurrent)
hfr read 13 120036 340:350
# Dernieres pages relatives (les 5 dernieres)
hfr read 13 120036 last-4:last
# Mode print (~1000 posts/page, sans signatures, ~4x plus leger)
hfr print 13 120036
hfr print 13 120036 --last 20
# Lister les topics d'une categorie
hfr topics 13
hfr topics 13 431
# Lecture authentifiee
hfr --auth read 13 120036 350
# Poster une reponse (auth automatique)
hfr reply 13 120036 "Hello HFR :o"
# Citer (retourne le BBCode [quotemsg=...])
hfr quote 13 120036 74497677
# Multiquote
hfr quote 13 120036 74497677 74497680 74497685
# Editer un post
hfr edit 13 120036 74497677 "contenu modifie"
# Envoyer un MP
hfr mp pseudo "Sujet" "Corps du message"写入命令(回复、编辑、引用、mp)需要(自动)身份验证。 read, print et topics 默认情况下匿名工作, --auth 倒se连接器。
MCP工具
| 输出 | 描述 |
|---|---|
hfr_read | 阅读主题。 page=0 对于最后一页, page_from/page_to 同时倾倒杜批, print=true pour le模式印象, last=N 发布新的帖子 |
hfr_topics | 用分页列出类别/子类别的主题 |
hfr_reply | 海报回应(BBCode) |
hfr_edit 编辑现有文章(检测第一篇文章,保留主题) | |
hfr_quote | 引用一条或多条消息(numreponse 或 numreponses[]) |
hfr_mp | 发送私人消息 |
优化令牌
- 模式打印 :
print=true加载约1000篇文章/页,而不是40篇,无签名(每篇文章轻约4倍) - 内容物的清洁 :签名、编辑记录和引用计数器自动删除
- 批处理并发 :页面行并行加载(GOroutines)
- 分页 :
TotalPages返回每个响应以导航,无需额外请求
路线图
gantt
title hfr-mcp roadmap
dateFormat YYYY-MM-DD
axisFormat %b %Y
section v1.0.0
Core MCP + CLI :done, v100, 2026-03-28, 2026-04-06
section v1.1.0
Liste des topics :active, v110a, 2026-04-07, 2026-04-15
Liste des categories :v110b, after v110a, 5d
Sortie fichier :v110c, after v110a, 5d
section v1.2.0
Get BBCode (lire avant edit) :v120a, 2026-05-01, 5d
Creation de topic :v120b, after v120a, 7d
Convertisseur Markdown-BBCode:v120c, after v120a, 10d
Preview avant publication :v120d, after v120c, 5d
BBCode avance :v120e, after v120b, 5d
section v1.3.0
Drapeaux (lire/poser/retirer):v130a, 2026-06-01, 7d
Recherche :v130b, after v130a, 7d
MPs (lire/repondre/lister) :v130c, after v130a, 10d
section v1.4.0
Smileys :v140a, 2026-07-01, 7d
Culture et slang HFR :v140b, after v140a, 7d
Skill resume de topic :v140c, after v140a, 7d
Documentation du protocole :v140d, after v140b, 7d
section v2.0.0
Transport HTTP Streamable :crit, v200a, 2026-08-01, 10d
GitHub OAuth + linking HFR :crit, v200b, after v200a, 14d
Sessions multi-utilisateurs :crit, v200c, after v200b, 7d
Deploiement (Fly.io) :crit, v200d, after v200c, 5d
Sync repos GitHub :v200e, after v200d, 14dv1.0.0——核心MCP+CLI *(已出版)*
功能MCP和CLI服务器:读取、响应、编辑、引用、MP打印模式、并发批处理读取、内容清理、身份验证延迟。
v1.1.0-导航和效率
探索论坛并优化大型阅读的输出。
v1.2.0-内容管理
编辑智能,创建主题,转换Markdown/BBCode,管理第一篇帖子。
V1.3.0-发现和通信
搜索、标志和完整的MPS。
v1.4.0--文化与智能
论坛知识和自动化技能。
v2.0.0——MCP远程
可从claude.ai web、claude code web和任何远程MCP客户端访问。
建筑
cmd/hfr/main.go CLI : sous-commandes, parsing args, --auth
cmd/hfr-mcp/main.go Serveur MCP : lazy login, transport stdio
internal/hfr/client.go Client HTTP, login, hash_check, cookie jar
internal/hfr/reader.go Lecture de topics, mode print, batch concurrent
internal/hfr/parser.go Parsing HTML (goquery), nettoyage du contenu
internal/hfr/post.go Reply + Edit (detection first post)
internal/hfr/mp.go Messages prives
internal/hfr/models.go Post, Topic, TopicListItem, EditInfo
internal/hfr/errors.go Types d'erreurs HFR
internal/hfr/version.go Constante de version
internal/config/config.go Fichier de config + env vars + verif permissions
internal/mcp/tools.go Declaration des outils MCP
internal/mcp/helpers.go Formatage des resultats两个独立的二进制文件:CLI(hfr)和MCP服务器(hfr-mcp)具有独立的生命周期和构建目标。
家属
许可证
麻省理工学院
