The best MCP server for Ptt. Proudly built by PyPtt developer.
This is a PTT MCP (Model Context Protocol) server powered by the PyPtt library. It enables any MCP client to authenticate with and interact directly with PTT bulletin board system, allowing for the automation of tasks through the MCP protocol.
Using Docker is the most recommended way to deploy the PTT MCP Server, as it provides environment isolation and a simplified setup.
-
Install Docker:
If Docker is not already installed on your system, please refer to the official Docker documentation for installation instructions. -
Configure Your MCP Client:
Add the following configuration to your MCP client's settings file (e.g.,~/.gemini/settings.json). This setup allows the MCP client to automatically pull and run the Docker container when needed.{ "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", // Please replace with your PTT account ID "PTT_PW": "YOUR_PTT_PW" // Please replace with your PTT password } } } }Explanation:
- "command": "docker": Instructs the MCP client to use the
dockercommand to start the server. - "args": Contains the arguments for the
docker runcommand.-i: Keeps standard input (stdin) open so the MCP server can receive commands.--rm: Automatically removes the container when it stops, keeping your system clean.-e PTT_IDand-e PTT_PW: Tells Docker to pass thePTT_IDandPTT_PWenvironment variables to the container.ghcr.io/PyPtt/ptt_mcp_server:latest: Specifies the Docker image to run.
env: SetsPTT_IDandPTT_PWdirectly as environment variables. Be sure to replace these with your own PTT account ID and password.
- "command": "docker": Instructs the MCP client to use the
-
Launch and Test:
Your MCP client should now be able to start the PTT MCP server automatically. You can try a simple command, such as asking it to log into PTT, to test the connection.
Once your MCP client (e.g., Gemini CLI) is configured, you can interact with PTT like this:
Your input:
Help me log into PTT
MCP Client Execution (Behind the Scenes):
- The Gemini CLI calls the
loginfunction via the MCP protocol. ptt-mcp-serverreceives the command and uses the PyPtt library to perform the login.ptt-mcp-serverreturns the login success or failure result to the Gemini CLI.
You will see:
Login successful
This project acts as a middle layer. Your MCP client (e.g., Gemini CLI) connects to the ptt-mcp-server running on your local machine. When the server receives a command, it uses the PyPtt library to connect to PTT and execute the corresponding action, finally returning the result to your client.
graph LR
A["MCP Client"]
subgraph B ["PTT MCP Server"]
D["PyPtt"]
end
C["PTT"]
A <--> B
B <--> C
| Category | Operation | Status |
|---|---|---|
| Account Management | Login, Logout | ✅ |
| Post Management | Get post list, Read post content, Create new post, Delete post | ✅ |
| Post Interaction | Push, Boo, Arrow, Reply to post | ✅ |
| Mailbox System | Read mail, Send new mail, Delete mail | ✅ |
| Finance System | Check P-coins, Transfer P-coins | ✅ |
| Information Query | Query user info, Query board info, Get post index range | ✅ |
This project provides powerful PTT automation capabilities. However, please note that all actions are based on your authorization, and you are fully responsible for the consequences of all operations. To use this tool safely and effectively, we strongly recommend following these best practices:
Best Practice: Read Before You Write, Confirm Before You Execute
Before using any function that modifies PTT content (such as posting, replying, sending mail, pushing, etc.), always use a read function first to gather and confirm information.
- Example: Instead of directly ordering "delete violating posts," first "list all violating posts." After you have reviewed the list and confirmed it is correct, then execute the deletion.
This simple workflow can significantly reduce the risks associated with automation errors (e.g., accidental deletion of posts, posting incorrect content). Although the PTT MCP Server includes a final confirmation prompt before execution, it cannot completely prevent operational mistakes. Please double-check the content carefully before submitting!
Please remember that the developers of this project are not responsible for any loss or liability caused by the use of this server.
- Support more PTT features (e.g., digest operations).
- Provide a Docker image to simplify the deployment process.
- Write more comprehensive documentation and examples.
- Optimize performance and connection stability.
We welcome your suggestions via Issues!
We warmly welcome contributions of any kind!
- Have questions or suggestions? Please open an issue on GitHub Issues.
- Want to contribute code?
- Fork the project.
- Create your feature branch (git checkout -b feature/AmazingFeature).
- Commit your changes (git commit -m 'Add some AmazingFeature').
- Push to your branch (git push origin feature/AmazingFeature).
- Open a Pull Request.
Join our community to connect with other developers!
|
Pichu Chen |
denkeni |
CodingMan |
- PyPtt - The core library that drives this project's interaction with PTT.
- fastmcp - Provides a high-performance MCP server framework.
For third-party libraries used in this project and their license terms, please see the licenses folder.
This project is licensed under the BSD 3-Clause License.