PTTSAFE
The best PTT MCP server
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
PTT MCP Server
The best MCP server for Ptt. Proudly built by PyPtt developer.
📖 專案介紹 (Description)
本專案是一個 PTT MCP (Model Context Protocol) 伺服器,它基於功能強大的 `PyPtt` 函式庫。這使得您的 MCP 客戶端能夠真正登入 PTT 並透過 MCP 協定與 PTT 批踢踢實業坊進行實際互動,並實現自動化操作。
🚀 快速開始 (Quick Start)
使用 Docker 部署 PTT MCP Server 是最推薦的方式,它提供了環境隔離和簡化的設定。
- 安裝 Docker:
如果您的系統尚未安裝 Docker,請參考 Docker 官方文件 進行安裝。
- 設定 MCP 客戶端:
將以下設定加入您的 MCP 客戶端設定檔 (例如:~/.gemini/settings.json)。此配置會讓 MCP 客戶端在需要時自動拉取並運行 Docker 容器。
{
"mcpServers": {
"PTT": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "PTT_ID",
"-e", "PTT_PW",
"ghcr.io/pyptt/ptt_mcp_server:latest"
],
"env": {
"PTT_ID": "YOUR_PTT_ID", // 請換成您自己的 PTT 帳號
"PTT_PW": "YOUR_PTT_PW" // 請換成您自己的 PTT 密碼
}
}
}
}說明:
"command": "docker": 指示 MCP 客戶端使用docker命令來啟動伺服器。"args": 包含docker run命令的參數。-i: 保持標準輸入 (stdin) 開啟,以便 MCP 伺服器可以接收指令。--rm: 容器停止後自動刪除,保持系統整潔。-e PTT_ID和-e PTT_PW: 告訴 Docker 將PTT_ID和PTT_PW環境變數傳遞給容器。ghcr.io/pyptt/ptt_mcp_server:latest: 指定要運行的 Docker 映像檔。"env": 將PTT_ID和PTT_PW直接設定為環境變數。請務必替換為您自己的 PTT 帳號和密碼。
**多帳號設
7cd6cda7b334OBSERVED · 2026-10-08Exposed tools (29)
22 read · 7 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
bucket | read | 將指定使用者水桶。 |
change_pw | read | 更改 PTT 登入密碼。 |
comment | read | 對文章進行推文、噓文或箭頭。 |
del_mail | read | 刪除信件。 |
del_post | write | 刪除文章。 |
get_aid_from_url | read | 從 PTT 文章網址中解析出看板名稱與文章 AID。 |
get_all_boards | read | 取得 PTT 全站看板清單。 |
get_board_info | read | 取得看板資訊。 |
get_board_rules | read | |
get_bottom_post_list | write | 取得看板置底文章清單。 |
get_favourite_boards | read | 取得我的最愛看板清單。 |
get_mail | read | 取得信件。 |
get_newest_index | read | 取得最新文章或信箱編號。 |
get_post | write | 從 PTT 取得指定文章。 |
get_post_index_range | write | |
get_time | read | 取得 PTT 系統時間。 |
get_user | read | 取得使用者資訊。 |
get_version | read | |
give_money | read | 轉帳 Ptt 幣給指定使用者。 |
list_accounts | read | 列出已在環境變數設定的 PTT 帳號名稱(不含密碼),以及目前登入中的帳號名稱。 |
login | read | Logs into the PTT service using credentials from environment variables. |
logout | read | Logs out from the PTT service. |
mail | read | 寄送站內信。 |
post | write | 到看板發佈文章。 |
reply_post | write | 到看板回覆文章。 |
search_user | read | 搜尋使用者。 |
set_board_title | write | 設定看板標題。 |
switch_account | read | 切換到指定名稱的 PTT 帳號並登入。 |
whoami | read | 回傳目前登入中的 PTT 帳號資訊,實際登入狀態直接向 PyPtt 查詢。 |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- declared (1 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (2)
black, flake8, mypy, flake8-pyproject, types-setuptools, types-requests
pyptt, fastmcp
Gates applied: no_behavioural_pass.
7cd6cda7b334full audit observations/trust-audit/mcp-server/pyptt__ptt.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 7cd6cda7b334 | SAFE | B | 89 | first audit |
Questions
What is the PTT MCP server?
The best PTT MCP server
What tools does PTT expose?
29 in total: 22 read-only, 7 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is PTT safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does PTT need?
No credential environment variables were found in its source, so it appears to need none.
How current is this page?
The grade is for one exact copy of the source (7cd6cda7b334), read on 2026-10-08. The repository is watched and re-audited when it changes.