eSign MCP Server

by adamanz

409 downloads Not rated yet MIT license
GitHub

About

MCP server for signing PDF documents with signature images. Built upon signpdf by Charlie DeTar.

Details

License
MIT license

Explore

- sign_pdf: Add signature images to PDF documents with precise positioning
- get_pdf_info: Get PDF metadata including page count and dimensions
- Input validation and error handling
- Support for PNG and JPG signature images
- Optional date stamping
- Base64 encoding for file transfer

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name eSign MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Python 3.11+
- uv package manager (recommended) or pip

1. Clone or download this repository
2. Install dependencies:

   uv pip install -r requirements.txt

To run the MCP server:

uv run python mcp_server.py

The server will start with stdio transport by default.

The server includes Docker support for containerized deployment:

``bash

This server is configured for deployment on Smithery with the included smithery.yaml configuration file.

- Dockerfile: Container build instructions
-
smithery.yaml: Smithery deployment configuration
-
requirements.txt: Python dependencies

Once your MCP server is running, you can use natural language to interact with the PDF signing tools:

Example conversations:

1. Getting PDF Information:
> "I have a PDF file. Can you tell me how many pages it has and what the dimensions are?"

The AI will ask you to provide the PDF file, then use the
get_pdf_info tool to analyze it.

2. Signing a PDF:
> "I need to sign this contract PDF on the first page. Can you add my signature image in the bottom right corner?"

The AI will use the
sign_pdf tool with appropriate coordinates for bottom-right placement.

3. Multiple signatures:
> "Please add my signature to page 2 of this PDF, positioned at coordinates 200, 150, and make it 100x30 pixels. Also add today's date."

The AI will use precise coordinates and enable date stamping.

4. Getting help with coordinates:
> "I want to sign this PDF but I'm not sure where to place the signature. Can you help me understand the coordinate system?"

The AI can explain PDF coordinates and help you choose appropriate values.

uv pip install -r requirements.txt

- Check the GitHub Issues for common problems
- Run the test script to verify installation:
uv run python test_server.py`
- For Claude Desktop specific issues, check the MCP troubleshooting guide

Get PDF Info:

{
"tool": "get_pdf_info",
"arguments": {
"pdf_data": "JVBERi0xLjQK..."
}
}

Sign PDF:

{
"tool": "sign_pdf",
"arguments": {
"pdf_data": "JVBERi0xLjQK...",
"signature_data": "iVBORw0KGgoAAAA...",
"page_number": 1,
"x": 100,
"y": 100,
"width": 125,
"height": 40,
"add_date": true
}
}

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "esign mcp server": {
            "esign-mcp": {
                "command": "uv",
                "args": [
                    "pip",
                    "install",
                    "-r",
                    "requirements.txt"
                ]
            }
        }
    }
}

McpServers

{
    "esign-mcp": {
        "command": "uv",
        "args": [
            "pip",
            "install",
            "-r",
            "requirements.txt"
        ]
    }
}

An MCP (Model Context Protocol) server that provides tools for signing PDF documents by adding signature images at specified coordinates.

Credits

This MCP server is built upon the excellent signpdf project by Charlie DeTar ([email protected]). The original signpdf utility provides the core PDF signing functionality that this MCP server wraps with a modern MCP interface.

Features

- sign_pdf: Add signature images to PDF documents with precise positioning
- get_pdf_info: Get PDF metadata including page count and dimensions
- Input validation and error handling
- Support for PNG and JPG signature images
- Optional date stamping
- Base64 encoding for file transfer

Tools

sign_pdf

Signs a PDF document by adding a signature image at the specified coordinates.

Parameters:
- pdf_data (string): Base64 encoded PDF file content
- signature_data (string): Base64 encoded signature image (PNG, JPG)
- page_number (int, optional): Page number to sign (1-based indexing, default: 1)
- x (float, optional): X coordinate from bottom-left corner in PDF units (default: 100)
- y (float, optional): Y coordinate from bottom-left corner in PDF units (default: 100)
- width (float, optional): Width of the signature in PDF units (default: 125)
- height (float, optional): Height of the signature in PDF units (default: 40)
- add_date (bool, optional): Whether to add current date next to signature (default: false)

Returns: Base64 encoded signed PDF content

get_pdf_info

Get information about a PDF document including page count and dimensions.

Parameters:
- pdf_data (string): Base64 encoded PDF file content

Returns:

{
"num_pages": 1,
"pages": [
{
"page_number": 1,
"width": 612.0,
"height": 792.0
}
]
}

Installation

Prerequisites

- Python 3.11+
- uv package manager (recommended) or pip

Local Installation

1. Clone or download this repository
2. Install dependencies:

   uv pip install -r requirements.txt

Running the Server

To run the MCP server:

uv run python mcp_server.py

The server will start with stdio transport by default.

Testing

A test script is provided to verify the server functionality:

uv run python test_server.py

This will:
1. Create a test PDF document
2. Generate a test signature image
3. Test the get_pdf_info tool
4. Test the sign_pdf tool
5. Save the signed PDF as test_signed.pdf

Docker Deployment

The server includes Docker support for containerized deployment:

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.