Skip to content

Commit d188fa1

Browse files
Feat/reduce image size (#17)
* doc: update readme. * feat: reduce image size. * chore: adjust python base image. * Update README_ENG.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update README_ENG.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent cdd9d98 commit d188fa1

File tree

4 files changed

+59
-25
lines changed

4 files changed

+59
-25
lines changed

.dockerignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Git
2+
.git
3+
.gitignore
4+
5+
# Python virtual environments
6+
.venv*
7+
venv/
8+
9+
# Python caches
10+
__pycache__/
11+
*.pyc
12+
*.pyo
13+
*.pyd
14+
15+
# IDE and editor specific
16+
.idea/
17+
.vscode/
18+
19+
# Test and cache files
20+
.pytest_cache/
21+
.mypy_cache/
22+
23+
# OS-specific
24+
.DS_Store
25+
Thumbs.db
26+
27+
# Documentation and dev requirements
28+
docs/
29+
README.md
30+
README_ENG.md
31+
requirements-dev.txt
32+
run_code_quality.sh

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use an official Python runtime as a parent image
2-
FROM python:3.12-alpine3.18
2+
FROM python:3.12-alpine3.22
33

44
# Set the working directory in the container
55
WORKDIR /app

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ The best MCP server for Ptt. Proudly built by <a href="https://pyptt.cc/">PyPtt<
8484

8585
```mermaid
8686
graph LR
87-
A["MCP 客戶端 (Client)"]
87+
A["MCP Client"]
8888

8989
subgraph B ["PTT MCP Server"]
90-
D["PyPtt 函式庫"]
90+
D["PyPtt"]
9191
end
9292

9393
C["PTT"]

README_ENG.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,32 @@
22

33
<h1 align="center">PTT MCP Server</h1>
44

5-
<p align="center">
6-
The best MCP server for PTT. Proudly built by <a href="https://pyptt.cc/">PyPtt</a> developers.
7-
<br />
8-
<br />
9-
<a href="https://github.com/PyPtt/ptt_mcp_server/actions/workflows/code_quality.yml">
10-
<img src="https://github.com/PyPtt/ptt_mcp_server/actions/workflows/code_quality.yml/badge.svg" alt="Code Quality">
11-
</a>
12-
<a href="https://github.com/PyPtt/ptt_mcp_server/blob/main/LICENSE">
13-
<img src="https://img.shields.io/badge/license-BSD_3--Clause-blue.svg" alt="License">
14-
</a>
5+
<p align="center">
6+
The best MCP server for PTT. Proudly built by <a href="https://pyptt.cc/">PyPtt</a> developer.
7+
<br />
8+
<br />
9+
10+
<a href="https://github.com/PyPtt/ptt_mcp_server/actions/workflows/code_quality.yml">
11+
<img src="https://github.com/PyPtt/ptt_mcp_server/actions/workflows/code_quality.yml/badge.svg" alt="Code Quality">
12+
</a>
13+
14+
<a href="https://github.com/PyPtt/ptt_mcp_server/blob/main/LICENSE">
15+
<img src="https://img.shields.io/badge/license-BSD_3--Clause-blue.svg" alt="License">
16+
</a>
1517
</p>
1618

1719
## **📖 Description**
1820

19-
This project is a PTT MCP (Model Context Protocol) server based on the powerful [PyPtt](https://www.google.com/search?q=%5Bhttps://pyptt.cc/%5D(https://pyptt.cc/)) library. It enables your MCP client to genuinely log into PTT, interact with the PTT Bulletin Board System via the MCP protocol, and perform automated operations.
21+
This is a PTT MCP (Model Context Protocol) server powered by the [`PyPtt`](https://pyptt.cc/) 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.
2022

2123
## **🚀 Quick Start**
2224

2325
Using Docker is the most recommended way to deploy the PTT MCP Server, as it provides environment isolation and a simplified setup.
2426

2527
1. Install Docker:
26-
If Docker is not already installed on your system, please refer to the official Docker documentation for installation instructions.
28+
If Docker is not already installed on your system, please refer to the official [Docker](https://docs.docker.com/get-docker/) documentation for installation instructions.
2729
2. Configure Your MCP Client:
28-
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.
30+
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.
2931
```json
3032
{
3133
"mcpServers": {
@@ -37,7 +39,7 @@ Using Docker is the most recommended way to deploy the PTT MCP Server, as it pro
3739
"--rm",
3840
"-e", "PTT_ID",
3941
"-e", "PTT_PW",
40-
"ghcr.io/PyPtt/ptt_mcp_server:latest"
42+
"ghcr.io/pyptt/ptt_mcp_server:latest"
4143
],
4244
"env": {
4345
"PTT_ID": "YOUR_PTT_ID", // Please replace with your PTT account ID
@@ -49,13 +51,13 @@ Using Docker is the most recommended way to deploy the PTT MCP Server, as it pro
4951
```
5052

5153
**Explanation:**
52-
* "command": "docker": Instructs the MCP client to use the docker command to start the server.
53-
* "args": Contains the arguments for the docker run command.
54-
* -i: Keeps standard input (stdin) open so the MCP server can receive commands.
55-
* --rm: Automatically removes the container when it stops, keeping your system clean.
56-
* -e PTT_ID and -e PTT_PW: Tells Docker to pass the PTT_ID and PTT_PW environment variables to the container.
57-
* ghcr.io/PyPtt/ptt_mcp_server:latest: Specifies the Docker image to run.
58-
* "env": Sets PTT_ID and PTT_PW directly as environment variables. **Be sure to replace these with your own PTT account ID and password.**
54+
* "command": "docker": Instructs the MCP client to use the `docker` command to start the server.
55+
* "args": Contains the arguments for the `docker run` command.
56+
* `-i`: Keeps standard input (stdin) open so the MCP server can receive commands.
57+
* `--rm`: Automatically removes the container when it stops, keeping your system clean.
58+
* `-e PTT_ID` and `-e PTT_PW`: Tells Docker to pass the `PTT_ID` and `PTT_PW` environment variables to the container.
59+
* `ghcr.io/PyPtt/ptt_mcp_server:latest`: Specifies the Docker image to run.
60+
* `env`: Sets `PTT_ID` and `PTT_PW` directly as environment variables. **Be sure to replace these with your own PTT account ID and password.**
5961
3. Launch and Test:
6062
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.
6163

@@ -79,7 +81,7 @@ Once your MCP client (e.g., Gemini CLI) is configured, you can interact with PTT
7981
8082
## **⚙️ How it Works**
8183

82-
This project acts as a middle layer. Your MCP client (e.g., Gemini CLI) connects to the locally running ptt-mcp-server. When the server receives a command, it connects to PTT through the [PyPtt](https://www.google.com/search?q=%5Bhttps://pyptt.cc/%5D(https://pyptt.cc/)) library, performs the corresponding action, and sends the result back to your client.
84+
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`](https://pyptt.cc/) library to connect to PTT and execute the corresponding action, finally returning the result to your client.
8385

8486
```mermaid
8587
graph LR

0 commit comments

Comments
 (0)