loading…
Search for a command to run...
loading…
An MCP server that enables interaction with the PDF Generator API for automated document generation and management. It supports both stdio and HTTP transports,
An MCP server that enables interaction with the PDF Generator API for automated document generation and management. It supports both stdio and HTTP transports, allowing AI models to create and handle PDFs using OpenAPI v4 specifications.
Model Context Protocol (MCP) server for the PDF Generator API, generated from the OpenAPI v4 specification.
This server supports both stdio and HTTP transports:
Install and build:
npm install
npm run build
MCP Client Configuration Example:
{
"mcpServers": {
"pdf-generator-api": {
"command": "node",
"args": ["/path/to/mcp-server/build/index.js"],
"env": {
"API_BASE_URL": "https://us1.pdfgeneratorapi.com/api/v4",
"BEARER_TOKEN_JWT": "your-jwt-token-here"
}
}
}
}
Note: Replace /path/to/mcp-server with your actual path and your-jwt-token-here with your PDF Generator API JWT token (see JWT Token Generation below).
Common config locations:
~/.claude/mcp_config.json.vscode/mcp_config.json~/.continue/config.jsonIf you have a deployed MCP server (e.g. https://mcp.example.com), you can connect to it directly from your MCP client without running anything locally.
Claude Code (~/.claude/mcp_config.json):
{
"mcpServers": {
"pdf-generator-api": {
"type": "streamable-http",
"url": "https://mcp.pdfgeneratorapi.com/mcp",
"headers": {
"Authorization": "Bearer your-jwt-token-here"
}
}
}
}
Claude Desktop (claude_desktop_config.json):
Claude Desktop does not support streamable-http directly. Use mcp-remote as a bridge:
{
"mcpServers": {
"pdf-generator-api": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.pdfgeneratorapi.com/mcp",
"--header",
"Authorization: Bearer your-jwt-token-here"
]
}
}
}
Note: For remote servers, use a long-lived JWT token (e.g. --expiresIn 30d) to avoid mid-session expiration. See JWT Token Generation for how to create one. Restart your MCP client after updating the config.
Run locally:
npm install
npm run start:http
# Server runs on http://localhost:3000
# MCP endpoint: http://localhost:3000/mcp
# Health check: http://localhost:3000/health
Docker:
docker compose -f deploy/docker-compose.yml up -d
# MCP endpoint: http://localhost:3001/mcp
Stdio Mode: Pass the JWT token via the BEARER_TOKEN_JWT environment variable in your MCP client config.
HTTP Mode: Pass the JWT token in the Authorization header with each request:
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Authorization: Bearer your-jwt-token-here" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize",...}'
You need a JWT token to authenticate with the PDF Generator API. Get your credentials from the PDF Generator API dashboard under Account Settings > API Integration.
You'll need three values:
iss claim) — your numeric workspace identifiersub claim) — your workspace email or unique keySee: https://docs.pdfgeneratorapi.com/v4#section/Authentication/Creating-a-JWT
const jwt = require('jsonwebtoken');
const token = jwt.sign(
{
iss: 'YOUR_WORKSPACE_ID', // e.g. "12345"
sub: 'YOUR_WORKSPACE_IDENTIFIER' // e.g. "[email protected]"
},
'YOUR_SECRET_KEY',
{
algorithm: 'HS256',
expiresIn: '24h' // Token lifetime — see notes below
}
);
console.log(token);
npx jsonwebtoken-cli -- sign \
'{"iss":"YOUR_WORKSPACE_ID","sub":"YOUR_WORKSPACE_IDENTIFIER"}' \
'YOUR_SECRET_KEY' \
--algorithm HS256 \
--expiresIn 24h
Choose a TTL that matches your use case:
| Use case | Recommended TTL | Why |
|---|---|---|
| Local MCP (stdio) | 24h or longer |
MCP sessions can be long-lived; avoids mid-session expiration |
| Production (HTTP) | 1h |
Shorter-lived tokens reduce risk if leaked |
| CI/CD or scripts | 5m – 15m |
Minimal exposure window for automated tasks |
The PDF Generator API validates the token on every request. If the token expires mid-session, subsequent API calls will return 401 Unauthorized — generate a new token and restart the MCP client.
BEARER_TOKEN_JWTSee: PDF Generator API Authentication Docs
| Variable | Mode | Default | Description |
|---|---|---|---|
API_BASE_URL |
Both | https://us1.pdfgeneratorapi.com/api/v4 |
PDF Generator API base URL |
BEARER_TOKEN_JWT |
Stdio | — | JWT token for authentication |
PORT |
HTTP | 3000 |
Server port |
LOG_LEVEL |
Both | info |
Logging level (debug, info, warn, error) |
SESSION_TTL_MINUTES |
HTTP | 30 |
Session idle timeout in minutes |
CORS_ORIGIN |
HTTP | * (all origins) |
Comma-separated allowed origins |
Create a .env file in the repo root:
cp .env.example .env
To regenerate after OpenAPI spec changes:
# Place the updated spec at docs/apiv4.json, then:
./scripts/generate-mcp.sh
# Or specify a custom input:
./scripts/generate-mcp.sh --input /path/to/apiv4.json
Note: After regeneration, custom patches may need to be re-applied.
npm run build
npm test
Test stdio mode manually:
BEARER_TOKEN_JWT="your-token" echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | npm run start:stdio
Test HTTP mode:
npm run start:http
curl http://localhost:3000/health
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"pdf-generator-api-mcp-server": {
"command": "npx",
"args": []
}
}
}Web content fetching and conversion for efficient LLM usage.
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also