You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/version3.x/deployment/mcp_server.en.md
+54-20Lines changed: 54 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,12 +18,15 @@ This project provides a lightweight [Model Context Protocol (MCP)](https://model
18
18
-**Supported Working Modes**
19
19
-**Local Python Library**: Runs PaddleOCR pipelines directly on the local machine. This mode requires a suitable local environment and hardware, and is ideal for offline use or privacy-sensitive scenarios.
20
20
-**PaddleOCR Official Website Service**: Invokes services provided by the [PaddleOCR Official Website](https://aistudio.baidu.com/paddleocr?lang=en). This is suitable for quick testing, prototyping, or no-code scenarios.
21
+
-**Qianfan Platform Service**: Calls the cloud services provided by Baidu AI Cloud's Qianfan large model platform.
21
22
-**Self-hosted Service**: Invokes the user's self-hosted PaddleOCR services. This mode offers the advantages of serving and high flexibility. It is suitable for scenarios requiring customized service configurations, as well as those with strict data privacy requirements. **Currently, only the basic serving solution is supported.**
22
23
23
24
## Examples:
25
+
24
26
The following showcases creative use cases built with PaddleOCR MCP server combined with other tools:
25
27
26
28
### Demo 1
29
+
27
30
In Claude for Desktop, extract handwritten content from images and save to note-taking software Notion. The PaddleOCR MCP server extracts text, formulas and other information from images while preserving document structure.
@@ -35,6 +38,7 @@ In Claude for Desktop, extract handwritten content from images and save to note-
35
38
---
36
39
37
40
### Demo 2
41
+
38
42
In VSCode, convert handwritten ideas or pseudocode into runnable Python scripts that comply with project coding standards with one click, and upload them to GitHub repositories. The PaddleOCR MCP server extracts explicitly handwritten code from images for subsequent processing.
39
43
40
44
<divalign="center">
@@ -46,15 +50,18 @@ In VSCode, convert handwritten ideas or pseudocode into runnable Python scripts
46
50
---
47
51
48
52
### Demo 3
53
+
49
54
In Claude for Desktop, convert PDF documents or images containing complex tables, formulas, handwritten text and other content into locally editable files.
50
55
51
56
#### Demo 3.1
57
+
52
58
Convert complex PDF documents with tables and watermarks to editable doc/Word format:
@@ -83,30 +90,25 @@ Convert images containing formulas and tables to editable csv/Excel format:
83
90
84
91
This section explains how to install the `paddleocr-mcp` library via pip.
85
92
86
-
- For the local Python library mode, you need to install both `paddleocr-mcp` and the PaddlePaddle framework along with PaddleOCR, as per the [PaddleOCR installation documentation](../installation.en.md).
87
-
- For the PaddleOCR official website service or the self-hosted service modes, if used within MCP hosts like Claude for Desktop, the server can also be run without installation via tools like `uvx`. See [2. Using with Claude for Desktop](#2-using-with-claude-for-desktop) for details.
88
-
89
-
For the local Python library mode you may optionally choose convenience extras (helpful to reduce manual dependency steps):
90
-
91
-
-`paddleocr-mcp[local]`: Includes PaddleOCR (but NOT the PaddlePaddle framework itself).
92
-
-`paddleocr-mcp[local-cpu]`: Includes PaddleOCR AND the CPU version of the PaddlePaddle framework.
93
-
94
-
It is still recommended to use an isolated virtual environment to avoid conflicts.
93
+
- For the local Python library mode, in addition to installing `paddleocr-mcp`, you also need to install the PaddlePaddle framework and PaddleOCR by referring to the [PaddleOCR installation guide](../installation.en.md).
94
+
- For the local Python library mode, you may also consider installing the corresponding optional dependencies:
95
+
-`paddleocr-mcp[local]`: includes PaddleOCR (without the PaddlePaddle framework).
96
+
-`paddleocr-mcp[local-cpu]`: based on `local`, additionally includes the CPU version of the PaddlePaddle framework.
97
+
- PaddleOCR also supports running the server without installation through methods like `uvx`. For details, please refer to the instructions in [2. Using with Claude for Desktop](#2-using-with-claude-for-desktop).
# Install with optional extras (choose ONE of the following if you prefer convenience installs)
107
110
# Install PaddleOCR together with the MCP server (framework not included):
108
111
pip install "paddleocr-mcp[local]"
109
-
110
112
# Install PaddleOCR and CPU PaddlePaddle framework together:
111
113
pip install "paddleocr-mcp[local-cpu]"
112
114
```
@@ -262,7 +264,37 @@ Configuration example:
262
264
263
265
- Do not expose your access token.
264
266
265
-
#### Mode 3: Self-hosted Service
267
+
#### Mode 3: Qianfan Platform Services
268
+
269
+
1. Install `paddleocr-mcp`.
270
+
2. Obtain an API key by referring to the [Qianfan Platform Official Documentation](https://cloud.baidu.com/doc/qianfan-api/s/ym9chdsy5).
271
+
3. Modify the `claude_desktop_config.json` file according to the configuration example below. Set `PADDLEOCR_MCP_QIANFAN_API_KEY` to your Qianfan platform API key.
- The Qianfan platform service currently only supports PaddleOCR-VL.
296
+
297
+
#### Mode 4: Self-hosted Service
266
298
267
299
1. In the environment where you need to run the PaddleOCR inference server, run the inference server as per the [PaddleOCR serving documentation](./serving.en.md).
268
300
2. Install `paddleocr-mcp` where the MCP server will run.
@@ -294,7 +326,7 @@ Configuration example:
294
326
295
327
### 2.4 Using `uvx`
296
328
297
-
Currently, for the PaddleOCR official website and self-hosted modes, and (for CPU inference) the local mode, starting the MCP server via `uvx` is also supported. With this approach, manual installation of `paddleocr-mcp` is not required. The main steps are as follows:
329
+
PaddleOCR also supports starting the MCP server via `uvx`. With this approach, manual installation of `paddleocr-mcp` is not required. The main steps are as follows:
@@ -321,7 +353,7 @@ Currently, for the PaddleOCR official website and self-hosted modes, and (for CP
321
353
}
322
354
```
323
355
324
-
Local mode (CPU, using the `local-cpu` extra):
356
+
Local mode (inference on CPUs, using the `local-cpu` extra):
325
357
326
358
```json
327
359
{
@@ -342,7 +374,9 @@ Currently, for the PaddleOCR official website and self-hosted modes, and (for CP
342
374
}
343
375
```
344
376
345
-
Because a different startup method is used (`uvx` pulls and runs the package on-demand), only `command` and `args` differ from earlier examples; available environment variables and CLI arguments remain identical.
377
+
For information on local mode dependencies, performance tuning, and production configuration, please refer to the [3.1 Quick Start](#21-quick-start) section.
378
+
379
+
Due to the use of a different startup method, the `command` and `args` settings in the configuration file differ from the previously described approach. However, the command-line arguments and environment variables supported by the MCP service (such as `PADDLEOCR_MCP_SERVER_URL`) can still be set in the same way.
346
380
347
381
## 3. Running the Server
348
382
@@ -376,9 +410,9 @@ You can control the MCP server via environment variables or CLI arguments.
|`PADDLEOCR_MCP_SERVER_URL`|`--server_url`|`str`| Base URL for the underlying service (required for `aistudio`, `qianfan`, or `self_hosted`modes). | - |`None`|
415
+
|`PADDLEOCR_MCP_AISTUDIO_ACCESS_TOKEN`|`--aistudio_access_token`|`str`| AI Studio access token (required for `aistudio` mode). | - |`None`|
382
416
|`PADDLEOCR_MCP_TIMEOUT`|`--timeout`|`int`| Read timeout for the underlying requests (seconds). | - |`60`|
383
417
|`PADDLEOCR_MCP_DEVICE`|`--device`|`str`| Device for inference (`local` mode only). | - |`None`|
0 commit comments