PTT MCP 服务器 logo

PTT MCP 服务器

Organization
PyPtt

The best PTT MCP server

PublisherPyPtt
Repositoryptt_mcp_server
LanguagePython
Forks
7
Stars
39
Available tools
0
Transport typestdio
Categories
LicenseBSD-3-Clause
Links
  • Connect tools to AI workflows

    PTT MCP 服务器 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    39 stars and 7 forks from the linked repository.

English Version

📖 專案介紹 (Description)

本專案是一個 PTT MCP (Model Context Protocol) 伺服器,它基於功能強大的 PyPtt 函式庫。這使得您的 MCP 客戶端能夠真正登入 PTT 並透過 MCP 協定與 PTT 批踢踢實業坊進行實際互動,並實現自動化操作。

🚀 快速開始 (Quick Start)

使用 Docker 部署 PTT MCP Server 是最推薦的方式,它提供了環境隔離和簡化的設定。

  1. 安裝 Docker: 如果您的系統尚未安裝 Docker,請參考 Docker 官方文件 進行安裝。

  2. 設定 MCP 客戶端: 將以下設定加入您的 MCP 客戶端設定檔 (例如:~/.gemini/settings.json)。此配置會讓 MCP 客戶端在需要時自動拉取並運行 Docker 容器。

    json
    {
      "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 帳號和密碼。

    多帳號設定(選用): 若您有多組 PTT 帳號,可改用環境變數 PTT_ACCOUNTS(格式:名稱=帳號:密碼,多組以逗號分隔)一次設定多組,之後即可用 switch_account("名稱") 切換帳號、list_accounts() 查詢可用名稱:

    PTT_ACCOUNTS=default=acc1:pw1,alt=acc2:pw2

    名稱不可含 =、帳號不可含 :、密碼不可含 ,(PTT 帳密實務上不會用到這些字元)。使用 Docker 時,請在 args 中同時加上 "-e", "PTT_ACCOUNTS"。原本的單一 PTT_ID/PTT_PW 設定仍然相容,會自動成為名為 default 的帳號。

  3. 啟動與測試: 您的 MCP 客戶端現在應該能自動啟動 PTT MCP 伺服器了。您可以嘗試一個簡單的指令來測試連線,例如要求它登入 PTT。

💡 使用範例 (Usage Example)

當您的 MCP 客戶端 (例如 Gemini CLI) 設定完成後,您可以像這樣與 PTT 互動:

您輸入:

幫我登入 PTT

MCP 客戶端執行 (背後流程):

  1. Gemini CLI 透過 MCP 協定呼叫 login 功能。
  2. ptt-mcp-server 接收到指令,使用 PyPtt 函式庫執行登入。
  3. ptt-mcp-server 將登入成功或失敗的結果回傳給 Gemini CLI。

您會看到:

登入成功

⚙️ 運作原理 (How it Works)

本專案扮演一個中間層的角色。您的 MCP 客戶端 (例如 Gemini CLI 等) 會連線到本機執行的 ptt-mcp-server。伺服器收到指令後,會透過 PyPtt 函式庫與 PTT 進行連線並執行相應操作,最後將結果回傳給您的客戶端。

✨ 詳細功能 (Features in Detail)

功能分類具體操作支援狀態
帳號管理登入、登出✅
文章管理取得文章列表、讀取文章內容、發表新文章、刪除文章✅
文章互動推文、噓文、給予箭頭、回覆文章✅
信箱系統讀取信件、傳送新信件、刪除信件✅
金融系統查詢 P幣、轉帳 P幣✅
資訊查詢查詢使用者資訊、查詢看板資訊、取得文章索引範圍✅

⚠️ 重要建議與免責聲明 (Important Suggestion & Disclaimer)

本專案提供強大的 PTT 自動化操作能力,但請注意,所有操作皆基於您的授權,您將對所有操作的後果負全部責任。為了安全且有效地使用本工具,我們強烈建議您遵循以下最佳實踐:

最佳實踐:先讀後寫,確認再執行

在使用任何會修改 PTT 內容的功能(如發文、回文、寄信、推文等)之前,請務必先使用讀取功能來收集和確認資訊。

  • 範例: 與其直接下令「刪除違規文章」,不如先「列出所有違規文章」,在您審核列表確認無誤後,再執行刪除操作。

這個簡單的流程可以大幅降低因自動化操作失誤(例如:誤刪文章、發錯內容)而導致的風險。雖然 PTT MCP Server 已經加入執行前會提示您進行最終確認,但仍無法完全避免誤操作的可能。請在送出前仔細核對內容!

請記住,任何因使用本伺服器而造成的損失或責任,本專案開發者概不負責。

🗺️ 未來藍圖 (Roadmap)

  • 支援更多 PTT 功能 (例如:精華區操作)。
  • 提供 Docker 映像檔,簡化部署流程。
  • 撰寫更完整的文件與範例。
  • 優化效能與連線穩定性。

歡迎透過 Issues 提供您的建議!

🤝 貢獻 (Contributing)

我們非常歡迎任何形式的貢獻!

  • 有問題或建議? 請到 GitHub Issues 提出。
  • 想貢獻程式碼?
    1. Fork 本專案。
    2. 建立您的功能分支 (git checkout -b feature/AmazingFeature)。
    3. Commit 您的變更 (git commit -m 'Add some AmazingFeature')。
    4. Push 到您的分支 (git push origin feature/AmazingFeature)。
    5. 開啟一個 Pull Request。

💬 社群 (Community)

歡迎加入我們的社群,與其他開發者交流!

👥 貢獻者 (Contributors)

🙏 致謝 (Acknowledgements)

  • PyPtt - 驅動本專案與 PTT 互動的核心函式庫。
  • fastmcp - 提供高效能 MCP 伺服器框架。

本專案使用的第三方函式庫及其授權條款,請參閱 licenses 資料夾。

📄 授權條款 (License)

本專案採用 BSD 3-Clause License 授權.

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "pyptt-ptt_mcp_server": {
      "command": "uvx",
      "args": [
        "ptt_mcp_server"
      ]
    }
  }
}

Use PTT MCP 服务器 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once PTT MCP 服务器 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add PTT MCP 服务器 as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the PTT MCP 服务器 MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "pyptt-ptt_mcp_server": {
      "command": "npx",
      "args": [
        "-y",
        "ptt_mcp_server"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the PTT MCP 服务器 MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the PTT MCP 服务器 MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use PTT MCP 服务器 to help me with this task?
PTT MCP 服务器
Sure. I read it.
Here is what I found using PTT MCP 服务器.

Frequently asked questions

What is the PTT MCP 服务器 MCP server used for?

PTT MCP 服务器 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use PTT MCP 服务器 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use PTT MCP 服务器 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use PTT MCP 服务器 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With PTT MCP 服务器 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect PTT MCP 服务器 MCP to TypingMind?

PTT MCP 服务器 runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does PTT MCP 服务器 MCP provide in TypingMind?

PTT MCP 服务器 exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use PTT MCP 服务器 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If PTT MCP 服务器 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇