Skip to content

Commit 8be119a

Browse files
committed
update readme for using as mcp server
1 parent ea34ccb commit 8be119a

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ python -m describepdf.ui_ollama
310310
### API
311311

312312
You can use DescribePDF in your production applications by leveraging the Gradio API interface. This allows you to run the web interface as a service and make API calls to it from Python, JavaScript, or directly using Bash/cURL.
313+
313314
To use the API, you first need to start the Gradio interface as a server:
314315

315316
```bash
@@ -322,6 +323,30 @@ describepdf-web-ollama
322323

323324
The Gradio API automatically provides endpoints that can be accessed through various methods. Complete API documentation is available by clicking the `Use via API` link in the web interface once the server is running.
324325

326+
#### MCP Server (Model Context Protocol)
327+
328+
Starting with Gradio 5.28.0, you can run the application as an MCP server by setting an environment variable:
329+
330+
```bash
331+
# Enable MCP server
332+
export GRADIO_MCP_SERVER=true
333+
334+
# For OpenRouter interface
335+
describepdf-web
336+
337+
# For Ollama interface
338+
describepdf-web-ollama
339+
```
340+
341+
The Model Context Protocol (MCP) standardizes how AI models interact with external tools. By enabling MCP:
342+
343+
- AI assistants like Claude can directly use your DescribePDF application as a tool
344+
- Large Language Models can understand your application's capabilities and interface with it
345+
- Functions in your Gradio app are automatically converted to MCP tools with proper schemas
346+
- You become part of the growing ecosystem of interconnected AI tools
347+
348+
This is particularly useful for integrating DescribePDF into AI workflows or when you want an LLM to generate PDF descriptions through API calls without human intervention.
349+
325350
## Customization
326351

327352
### Prompt Templates

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
gradio>=5.20.1
1+
gradio>=5.28.0
22
pymupdf>=1.24.10
33
requests>=2.32.3
44
python-dotenv>=1.1.0

0 commit comments

Comments
 (0)