# Stirling PDF MCP

> Stirling PDF lets your agent manage the full lifecycle of PDFs—from securing documents with digital certificates to converting images into reports and applying custom watermarks. It also exposes deep server metrics, letting you monitor endpoint traffic (GET/POST counts) directly via conversation.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** pdf-tools, watermarking, pdf-conversion, digital-signatures, server-monitoring

## Description

**Document Operations & Security**

Stirling PDF lets your agent handle the entire lifecycle of documents, right from your chat client. You don't need to log into a dashboard; you just ask for it.

When you gotta secure a document, use `cert_sign`. This tool applies a digital signature using specific certificate details you provide. It embeds required metadata—like who signed the file and why—making sure the PDF is officially stamped and traceable. If your workflow requires more complex actions than just signing, you can access specialized functions through `run_generic_tool`, which takes any specific Stirling PDF tool ID and runs it by passing parameters as JSON.

Need to convert something? You can use `img_to_pdf` to take a single image file—like a screenshot or photo—and turn that whole thing into a properly formatted, multi-page PDF document. For existing PDFs, you've got `add_watermark`. This lets your agent overlay text watermarks onto the document; you can specify exactly what the text is and control things like opacity levels or font sizes so it looks professional.

**System Health & Monitoring Metrics**

Beyond just handling files, this server gives your AI client deep visibility into its own performance. You can use `get_status` to check the current operational status of the Stirling PDF instance and see exactly what version you're running. This is a quick sanity check.

Monitoring endpoint traffic requires several calls. To get the overall load, run `get_load`, which gives you the total count of GET requests hitting every single endpoint in your system right now. If you need to know about data being written or submitted, you have access to POST request counts. Use `get_all_requests` for a grand tally of all POSTs across your entire setup. For unique user tracking, if you want to count how many people made *any* kind of post request, use `get_unique_requests`. If you need the broadest view—the total number of unique users who accessed *any* endpoint on the server—you run `get_all_unique_requests`. 

For a deeper dive into traffic patterns, if you're running the Enterprise tier, you can retrieve granular performance data with `get_prometheus_metrics`. This tool gives you detailed observability metrics for the entire document processing pipeline. These metrics are crucial when you need to troubleshoot bottlenecks or measure throughput over time.

Your agent uses these tools directly in conversation. You ask: 'What was my total POST count last hour?' and it runs `get_all_requests`. Or, 'Is the server running okay?' and it fires off `get_status`. It's all conversational control over complex infrastructure.

## Tools

### add_watermark
Adds text watermarks to a PDF file, letting you specify opacity and font sizes.

### cert_sign
Applies a digital signature to a PDF document using provided certificate details.

### get_all_requests
Counts the total number of POST requests made across all endpoints in your system.

### get_all_unique_requests
Determines how many unique users accessed any endpoint on your server.

### get_load
Gets the total count of GET requests to all endpoints, showing current load.

### get_prometheus_metrics
Retrieves detailed Prometheus metrics for deep observability into your document pipeline (Enterprise required).

### get_requests
Gets the total count of POST requests to all endpoints.

### get_status
Returns the current operational status and version information for your Stirling PDF instance.

### get_unique_requests
Counts unique users who made POST requests to all endpoints.

### img_to_pdf
Converts a single image file into a PDF document format.

### run_generic_tool
Allows you to run any specialized Stirling PDF tool by passing its specific ID and parameters as JSON.

## Prompt Examples

**Prompt:** 
```
Check the current status and version of my Stirling PDF server.
```

**Response:** 
```
I've checked your instance. It is currently online running version 0.25.1. All systems are operational.
```

**Prompt:** 
```
Add a 'CONFIDENTIAL' watermark to this PDF with 0.5 opacity.
```

**Response:** 
```
Processing the document... I've applied the 'CONFIDENTIAL' text watermark with the requested settings. You can now download the processed PDF.
```

**Prompt:** 
```
Convert this image to a PDF document named 'report.pdf'.
```

**Response:** 
```
Converting image... I have successfully generated 'report.pdf' from your image file using the maintainAspectRatio fit option.
```

## Capabilities

### Sign Documents with Certificates
The agent signs a PDF using your configured certificate, adding required metadata about who and why it was signed.

### Create PDFs from Images
You feed an image file to the tool, and it returns a properly formatted, single-page PDF document.

### Add Custom Watermarks
The agent overlays text watermarks onto a PDF, allowing you to set opacity levels and font sizes.

### Check System Status & Version
You query the tool, and it returns the current operational status and version number of the Stirling PDF server instance.

### Monitor Endpoint Traffic
The agent counts total POST requests or unique users accessing specific endpoints across your system.

### Retrieve Performance Metrics
You request Prometheus metrics, giving you deep observability data points about the document processing pipeline (requires Enterprise tier).

## Use Cases

### Legal review of contract drafts
A paralegal receives a stack of contracts. Instead of opening each one to manually sign and add compliance notes, the agent executes `cert_sign` on all files sequentially, ensuring every document is marked with the necessary date/location metadata.

### Debugging high API traffic
The DevOps team notices slow performance. They immediately ask their agent to run `get_load`. If the number spikes, they can then use `get_all_requests` and `get_unique_requests` to narrow down if it’s a sudden burst of activity or too many unique sources.

### Creating compliance reports
A marketing team needs to turn a series of internal JPEGs into an official, dated report. They ask the agent to use `img_to_pdf` repeatedly and then run `add_watermark` across the resulting PDF stack for audit purposes.

### Checking server uptime post-update
After updating the core service, a developer first runs `get_status`. If the status is 'Operational' and the version number matches expectations, they can proceed with more complex testing without worrying about downtime.

## Benefits

- Secure document signing is instant. Instead of manually managing certificates, use `cert_sign` to apply legal signatures and critical metadata right from your agent's response.
- Testing workflows just got easier. Use `img_to_pdf` to automatically convert diagrams or screenshots into structured PDFs for testing purposes without any external scripts.
- Know exactly who is hitting your API. Tools like `get_all_unique_requests` and `get_unique_requests` track unique users, giving you better insight than just a total request count.
- System health checks are simple. Running `get_status` immediately tells you if the server is up and what version it's running—no need to check an admin dashboard first.
- Deep performance visibility. If you need more than basic counts, use `get_prometheus_metrics`. This gives true observability into bottlenecks across your entire document pipeline.

## How It Works

The bottom line is, you connect once, and then your AI client handles all document operations and server monitoring via simple conversation.

1. First, subscribe to this server and input your specific Stirling PDF Base URL and API Key into Vinkius.
2. Next, tell your AI client the document task or metric you need. For example: 'Check the load' or 'Sign this for legal review.'
3. The agent executes the appropriate tool (e.g., `get_load` or `cert_sign`) and returns the result directly into your chat interface.

## Frequently Asked Questions

**How do I check if my Stirling PDF server is online?**
Run the `get_status` tool. It immediately returns the operational status and version number, confirming whether all systems are running correctly without needing to log into an external dashboard.

**Can I count total requests using Stirling PDF MCP Server?**
Yes, use `get_all_requests`. This tool provides a single metric showing the combined count of every POST request made across all endpoints in your instance.

**What is the best way to add a watermark using Stirling PDF MCP Server?**
Use the `add_watermark` tool. You specify the text and desired opacity level, allowing you to apply compliance markings across entire batches of documents programmatically.

**Do I need special permissions for Prometheus metrics in Stirling PDF MCP Server?**
Yes. Accessing deep performance data requires calling `get_prometheus_metrics`, which is restricted to the Enterprise tier of your Stirling PDF setup.

**How do I use the `cert_sign` tool to digitally sign a PDF document?**
You must provide your certificate details, along with required metadata like location and signing reason. The system applies the digital signature, ensuring the document's integrity for legal records.

**What input formats does `img_to_pdf` accept when converting an image to a PDF?**
The tool accepts standard image file types like JPG and PNG. You can also specify conversion parameters, such as whether the output should maintain aspect ratio or fit the page size.

**How do I use `run_generic_tool` to perform operations like splitting a PDF?**
You access specialized features by passing the specific tool ID and all necessary parameters inside a JSON string. This lets you run complex tasks, such as splitting or merging documents.

**What data does `get_all_unique_requests` retrieve about my server's usage?**
This tool counts the distinct user IDs that hit your endpoints across all requests. It gives you an accurate measure of unique audience reach, separate from the total request volume.

**Can I add a text watermark to a PDF document using this server?**
Yes! Use the `add_watermark` tool. You can specify the text, font size, and opacity to apply a professional watermark to any PDF file provided in base64 format.

**How do I monitor the traffic and load on my Stirling PDF instance?**
You can use `get_requests` to see POST counts, `get_load` for GET requests, or `get_prometheus_metrics` if you are on the Enterprise tier for detailed observability.

**Is it possible to perform other operations like merging or splitting PDFs?**
Yes, the `run_generic_tool` action allows you to execute any Stirling PDF tool by its ID (e.g., 'merge-pdfs' or 'split-pages') by passing the required parameters.