An MCP server that converts text to PDF and provides various PDF manipulation tools - developed by ofbahar
Project description
ofbahar PDF Converter
An MCP (Model Context Protocol) server that provides various PDF manipulation tools. This project allows you to create, merge, encrypt PDFs and more through a simple interface - developed by ofbahar.
Features
-
Text to PDF Conversion
- Convert text to PDF with formatting options
- Custom font, size, and color support
- Rich text formatting capabilities
-
PDF Manipulation
- Merge multiple PDFs
- Encrypt PDFs with password protection
- Extract text from PDFs
- Add images to PDFs
- Compress PDFs
- Update PDF metadata
Prerequisites
- Python 3.12 or higher
- uv package manager
Installation
- Clone the repository:
git clone https://github.com/ofbahar/pdf_converter.git
cd pdf_converter
- Create a virtual environment and install dependencies:
uv venv
uv pip install -e .
Configuration
Claude Desktop Configuration
Location
- On MacOS:
~/Library/Application\ Support/Claude/claude_desktop_config.json - On Windows:
%APPDATA%/Claude/claude_desktop_config.json
Development/Unpublished Servers Configuration
{
"mcpServers": {
"ofbahar_pdf_converter": {
"command": "uv",
"args": [
"--directory",
"C:\\Users\\OmerFarukBAHAR(ADEO)\\Desktop\\Proje\\CTICrawler\\MCPDevelopment\\pdf_converter",
"run",
"ofbahar_pdf_converter"
]
}
}
}
Published Servers Configuration
{
"mcpServers": {
"ofbahar_pdf_converter": {
"command": "uvx",
"args": [
"ofbahar_pdf_converter"
]
}
}
}
Environment Variables
PDF_OUTPUT_DIR: Specify output directory for PDFs (optional)- Default output directory:
output_pdfsin current working directory
Usage Examples
Example Operations
- Creating a PDF:
Create a PDF with the text "Hello World"
- Formatting Text:
Create a PDF with formatted text using Helvetica font, size 14, and red color
- Merging PDFs:
Merge file1.pdf and file2.pdf into merged.pdf
- Encrypting PDFs:
Encrypt document.pdf with password "secure123"
- Extracting Text:
Extract text from document.pdf
- Updating Metadata:
Update metadata of document.pdf with title "My Document" and author "ofbahar"
Development
Building and Publishing
- Sync dependencies and update lockfile:
uv sync
- Build package distributions:
uv build
This will create source and wheel distributions in the dist/ directory.
- Publish to PyPI:
uv publish
Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token:
--tokenorUV_PUBLISH_TOKEN - Or username/password:
--username/UV_PUBLISH_USERNAMEand--password/UV_PUBLISH_PASSWORD
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm with this command:
npx @modelcontextprotocol/inspector uv --directory C:\Users\OmerFarukBAHAR(ADEO)\Desktop\Proje\CTICrawler\MCPDevelopment\pdf_converter run ofbahar-pdf-converter
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
- Ömer Faruk BAHAR - Initial work - ofbahar
Acknowledgments
- Built with Python MCP Server SDK
- Uses ReportLab and PyPDF2 for PDF operations
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ofbahar_pdf_converter-0.1.1.tar.gz.
File metadata
- Download URL: ofbahar_pdf_converter-0.1.1.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc887efd6704380f970048269c799c079afe052f6d4e0d4a5ca61995cbc5cd77
|
|
| MD5 |
dbb7054b25e04508ea8c0f5f5b84da77
|
|
| BLAKE2b-256 |
d8487d0287fc2f8dcb88857838c02a4be70cf318587772ed51112c596384aa99
|
File details
Details for the file ofbahar_pdf_converter-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ofbahar_pdf_converter-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b14f0ee8beb0adc8b28b928f144b79dff46ea49c3f44b17e3d44c5a44eaf6dbe
|
|
| MD5 |
fe44418c2163761fe0ee69bba423ff5f
|
|
| BLAKE2b-256 |
2a30bc159666b4834413c91dd4ed2d5c90c81eca5a6dbc014ab178ade7fc331a
|