pdf_mcp_server
FastMCP PDF Processing Server exposes a set of small, focused MCP tools to process PDFs from any MCP-capable client (Claude Desktop, FastMCP client, etc.)
claude mcp add --transport stdio gabrielmrojas-pdf_mcp_server python -m fastmcp_pdf_server \ --env PATH="$PATH:/path/to/extra/binaries" \ --env TEMP_DIR="/path/to/mcp_pdf_server/temp_files" \ --env LOG_LEVEL="DEBUG" \ --env SERVER_NAME="pdf-processor-server" \ --env LOG_FILE_PATH="/path/to/mcp_pdf_server/logs/fastmcp_pdf_server.log" \ --env SERVER_VERSION="1.0.0" \ --env MAX_FILE_SIZE_MB="50"
How to use
This MCP server provides a set of PDF processing tools accessible via the FastMCP API. It exposes operations such as server_info to retrieve server metadata, list_temp_resources to inspect temporary files, get_pdf_info to read basic PDF properties, and upload-related helpers to store files in the server's temp directory. Tools return structured data with a meta block containing operation_id and execution_ms, and many endpoints wrap results in a consistent response shape. To interact programmatically, you can spawn the server with Python using -m fastmcp_pdf_server and then invoke the exposed tools through the MCP client, or use the provided programmatic usage example to call server_info and similar tools. The server is designed to operate over a STDIO transport; avoid printing extra output to stdout/stderr, and ensure logs are written to the configured log file as the server expects stdout to remain clean for MCP messaging.
How to install
Prerequisites:
- Python 3.8+ installed on the host
- pip available
- A POSIX or Windows environment with a writable temp directory
-
Create and activate a virtual environment (optional but recommended):
- Windows PowerShell: python -m venv .venv ..venv\Scripts\Activate.ps1
- Linux/macOS: python3 -m venv .venv source .venv/bin/activate
-
Install Python dependencies from requirements.txt: pip install -r requirements.txt
-
Configure environment variables (example values shown in mcp_config). Create or adjust the .env or environment as needed:
- MAX_FILE_SIZE_MB=50
- TEMP_DIR=/path/to/mcp_pdf_server/temp_files
- LOG_LEVEL=DEBUG
- LOG_FILE_PATH=/path/to/mcp_pdf_server/logs/fastmcp_pdf_server.log
- SERVER_NAME=pdf-processor-server
- SERVER_VERSION=1.0.0
- PATH to include any required bin directories (e.g., if you rely on poppler or other tools)
-
Run the server (from project root): python -m fastmcp_pdf_server
-
If you installed the package system-wide or as a package, you can also start it with: fastmcp-pdf-server
Additional notes
Tips and common notes:
- The server uses STDIO transport. Do not print extra output to stdout or stderr; logs should be written to the configured log file.
- When dependencies are updated (for example, adding new packages like requests for URL uploads), reinstall dependencies with pip install -r requirements.txt.
- If you need to fetch file contents via MCP, use get_resource_base64 to obtain base64-encoded data from the temp directory, which is useful for clients without direct file transfer.
- Ensure TEMP_DIR exists and is writable before starting the server to avoid runtime errors.
- The server exposes REST-like tooling via the MCP interface; adapt your client to handle the meta information (operation_id and execution_ms) present in responses.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP