techtenstein-pdf-mcp 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: techtenstein-pdf-mcp
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: MCP server for Techtenstein PDF Extract API. Fast PDF text + tables via Claude, Cline, and Cursor.
|
|
5
|
+
Project-URL: Homepage, https://apis.techtenstein.com
|
|
6
|
+
Project-URL: Documentation, https://pdf.api.techtenstein.com
|
|
7
|
+
Project-URL: Repository, https://github.com/sathvic-kollu/techtenstein-pdf-mcp
|
|
8
|
+
Author-email: Sathvic Kollu <sathvic777@gmail.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
Keywords: api,claude,extract,mcp,ocr,pdf,tables,techtenstein
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Requires-Dist: fastmcp>=0.2.0
|
|
18
|
+
Requires-Dist: requests>=2.31.0
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# Techtenstein PDF MCP
|
|
22
|
+
|
|
23
|
+
MCP server that gives your Claude, Cline, or Cursor session the ability to extract
|
|
24
|
+
text, tables, and metadata from any PDF URL — including scanned PDFs via OCR.
|
|
25
|
+
Powered by the [Techtenstein PDF Extract API](https://apis.techtenstein.com).
|
|
26
|
+
|
|
27
|
+
## Tools exposed
|
|
28
|
+
|
|
29
|
+
- `pdf_extract_text(pdf_url, ocr=False)` — Extract all text from a PDF as clean plain text
|
|
30
|
+
- `pdf_extract_tables(pdf_url)` — Extract all tables as structured row arrays
|
|
31
|
+
- `pdf_metadata(pdf_url)` — Get title, author, page count, creation date, encryption status
|
|
32
|
+
|
|
33
|
+
## Install (Claude Desktop)
|
|
34
|
+
|
|
35
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"mcpServers": {
|
|
40
|
+
"techtenstein-pdf": {
|
|
41
|
+
"command": "uvx",
|
|
42
|
+
"args": ["techtenstein-pdf-mcp"],
|
|
43
|
+
"env": {
|
|
44
|
+
"TECHTENSTEIN_API_KEY": "your_key_from_techtenstein.com"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Restart Claude Desktop. `pdf_extract_text`, `pdf_extract_tables`, and `pdf_metadata` will appear as available tools.
|
|
52
|
+
|
|
53
|
+
## Install (Cline / VS Code)
|
|
54
|
+
|
|
55
|
+
Cline auto-detects MCP servers from your Claude Desktop config. Same setup as above works.
|
|
56
|
+
|
|
57
|
+
## Install (Cursor)
|
|
58
|
+
|
|
59
|
+
Add to `~/.cursor/mcp.json`:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"techtenstein-pdf": {
|
|
65
|
+
"command": "uvx",
|
|
66
|
+
"args": ["techtenstein-pdf-mcp"],
|
|
67
|
+
"env": {"TECHTENSTEIN_API_KEY": "your_key"}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Get an API key
|
|
74
|
+
|
|
75
|
+
Free tier (50 extractions/day, no card): https://apis.techtenstein.com
|
|
76
|
+
|
|
77
|
+
Paid tiers start at $5/month for 2,000 extractions.
|
|
78
|
+
|
|
79
|
+
## Example usage
|
|
80
|
+
|
|
81
|
+
Once installed, ask Claude:
|
|
82
|
+
|
|
83
|
+
> "Extract the tables from this earnings report PDF: https://example.com/q4.pdf"
|
|
84
|
+
|
|
85
|
+
Claude will call `pdf_extract_tables` and return a clean structured view of every table on the page.
|
|
86
|
+
|
|
87
|
+
Or for scanned documents:
|
|
88
|
+
|
|
89
|
+
> "This PDF is a scanned invoice. Extract the text: https://example.com/invoice.pdf"
|
|
90
|
+
|
|
91
|
+
Claude will call `pdf_extract_text(pdf_url, ocr=True)` and read the image-based text via OCR.
|
|
92
|
+
|
|
93
|
+
## Response schema (text mode)
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"text": "Full extracted body text...",
|
|
98
|
+
"page_count": 12,
|
|
99
|
+
"word_count": 3450,
|
|
100
|
+
"ms": 240
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Response schema (tables mode)
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"tables": [
|
|
109
|
+
{
|
|
110
|
+
"page": 3,
|
|
111
|
+
"rows": [
|
|
112
|
+
["Product", "Q1", "Q2", "Q3", "Q4"],
|
|
113
|
+
["Widget A", "1200", "1350", "1420", "1600"]
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Support
|
|
121
|
+
|
|
122
|
+
- Docs: https://apis.techtenstein.com
|
|
123
|
+
- Issues: https://github.com/sathvic-kollu/techtenstein-pdf-mcp/issues
|
|
124
|
+
- Email: sathvic777@gmail.com
|
|
125
|
+
|
|
126
|
+
## License
|
|
127
|
+
|
|
128
|
+
MIT
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Techtenstein PDF MCP
|
|
2
|
+
|
|
3
|
+
MCP server that gives your Claude, Cline, or Cursor session the ability to extract
|
|
4
|
+
text, tables, and metadata from any PDF URL — including scanned PDFs via OCR.
|
|
5
|
+
Powered by the [Techtenstein PDF Extract API](https://apis.techtenstein.com).
|
|
6
|
+
|
|
7
|
+
## Tools exposed
|
|
8
|
+
|
|
9
|
+
- `pdf_extract_text(pdf_url, ocr=False)` — Extract all text from a PDF as clean plain text
|
|
10
|
+
- `pdf_extract_tables(pdf_url)` — Extract all tables as structured row arrays
|
|
11
|
+
- `pdf_metadata(pdf_url)` — Get title, author, page count, creation date, encryption status
|
|
12
|
+
|
|
13
|
+
## Install (Claude Desktop)
|
|
14
|
+
|
|
15
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"techtenstein-pdf": {
|
|
21
|
+
"command": "uvx",
|
|
22
|
+
"args": ["techtenstein-pdf-mcp"],
|
|
23
|
+
"env": {
|
|
24
|
+
"TECHTENSTEIN_API_KEY": "your_key_from_techtenstein.com"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Restart Claude Desktop. `pdf_extract_text`, `pdf_extract_tables`, and `pdf_metadata` will appear as available tools.
|
|
32
|
+
|
|
33
|
+
## Install (Cline / VS Code)
|
|
34
|
+
|
|
35
|
+
Cline auto-detects MCP servers from your Claude Desktop config. Same setup as above works.
|
|
36
|
+
|
|
37
|
+
## Install (Cursor)
|
|
38
|
+
|
|
39
|
+
Add to `~/.cursor/mcp.json`:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"mcpServers": {
|
|
44
|
+
"techtenstein-pdf": {
|
|
45
|
+
"command": "uvx",
|
|
46
|
+
"args": ["techtenstein-pdf-mcp"],
|
|
47
|
+
"env": {"TECHTENSTEIN_API_KEY": "your_key"}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Get an API key
|
|
54
|
+
|
|
55
|
+
Free tier (50 extractions/day, no card): https://apis.techtenstein.com
|
|
56
|
+
|
|
57
|
+
Paid tiers start at $5/month for 2,000 extractions.
|
|
58
|
+
|
|
59
|
+
## Example usage
|
|
60
|
+
|
|
61
|
+
Once installed, ask Claude:
|
|
62
|
+
|
|
63
|
+
> "Extract the tables from this earnings report PDF: https://example.com/q4.pdf"
|
|
64
|
+
|
|
65
|
+
Claude will call `pdf_extract_tables` and return a clean structured view of every table on the page.
|
|
66
|
+
|
|
67
|
+
Or for scanned documents:
|
|
68
|
+
|
|
69
|
+
> "This PDF is a scanned invoice. Extract the text: https://example.com/invoice.pdf"
|
|
70
|
+
|
|
71
|
+
Claude will call `pdf_extract_text(pdf_url, ocr=True)` and read the image-based text via OCR.
|
|
72
|
+
|
|
73
|
+
## Response schema (text mode)
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"text": "Full extracted body text...",
|
|
78
|
+
"page_count": 12,
|
|
79
|
+
"word_count": 3450,
|
|
80
|
+
"ms": 240
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Response schema (tables mode)
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"tables": [
|
|
89
|
+
{
|
|
90
|
+
"page": 3,
|
|
91
|
+
"rows": [
|
|
92
|
+
["Product", "Q1", "Q2", "Q3", "Q4"],
|
|
93
|
+
["Widget A", "1200", "1350", "1420", "1600"]
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Support
|
|
101
|
+
|
|
102
|
+
- Docs: https://apis.techtenstein.com
|
|
103
|
+
- Issues: https://github.com/sathvic-kollu/techtenstein-pdf-mcp/issues
|
|
104
|
+
- Email: sathvic777@gmail.com
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
MIT
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://github.com/modelcontextprotocol/registry/schemas/mcp-server.schema.json",
|
|
3
|
+
"name": "techtenstein-pdf",
|
|
4
|
+
"description": "Fast PDF text & table extraction. Powered by Techtenstein PDF API.",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Sathvic Kollu",
|
|
8
|
+
"email": "sathvic777@gmail.com",
|
|
9
|
+
"url": "https://techtenstein.com"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://apis.techtenstein.com",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/sathvic-kollu/techtenstein-pdf-mcp"
|
|
15
|
+
},
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"keywords": ["pdf", "extract", "ocr", "tables", "documents"],
|
|
18
|
+
"runtime": "python",
|
|
19
|
+
"install": {
|
|
20
|
+
"uvx": "uvx techtenstein-pdf-mcp",
|
|
21
|
+
"pip": "pip install techtenstein-pdf-mcp"
|
|
22
|
+
},
|
|
23
|
+
"env": [
|
|
24
|
+
{
|
|
25
|
+
"name": "TECHTENSTEIN_API_KEY",
|
|
26
|
+
"description": "API key from https://apis.techtenstein.com (free tier available)",
|
|
27
|
+
"required": false
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"tools": [
|
|
31
|
+
{
|
|
32
|
+
"name": "pdf_extract_text",
|
|
33
|
+
"description": "Extract all text from a PDF URL as clean plain text. Supports OCR for scanned PDFs."
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "pdf_extract_tables",
|
|
37
|
+
"description": "Extract all tables from a PDF as structured row arrays."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "pdf_metadata",
|
|
41
|
+
"description": "Get PDF metadata: title, author, page count, creation date, encryption status."
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "techtenstein-pdf-mcp"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "MCP server for Techtenstein PDF Extract API. Fast PDF text + tables via Claude, Cline, and Cursor."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Sathvic Kollu", email = "sathvic777@gmail.com" }
|
|
8
|
+
]
|
|
9
|
+
license = { text = "MIT" }
|
|
10
|
+
keywords = ["mcp", "pdf", "extract", "ocr", "tables", "claude", "techtenstein", "api"]
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 4 - Beta",
|
|
13
|
+
"License :: OSI Approved :: MIT License",
|
|
14
|
+
"Programming Language :: Python :: 3.10",
|
|
15
|
+
"Programming Language :: Python :: 3.11",
|
|
16
|
+
"Programming Language :: Python :: 3.12",
|
|
17
|
+
]
|
|
18
|
+
requires-python = ">=3.10"
|
|
19
|
+
dependencies = [
|
|
20
|
+
"fastmcp>=0.2.0",
|
|
21
|
+
"requests>=2.31.0",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Homepage = "https://apis.techtenstein.com"
|
|
26
|
+
Documentation = "https://pdf.api.techtenstein.com"
|
|
27
|
+
Repository = "https://github.com/sathvic-kollu/techtenstein-pdf-mcp"
|
|
28
|
+
|
|
29
|
+
[project.scripts]
|
|
30
|
+
techtenstein-pdf-mcp = "server:mcp.run"
|
|
31
|
+
|
|
32
|
+
[build-system]
|
|
33
|
+
requires = ["hatchling"]
|
|
34
|
+
build-backend = "hatchling.build"
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"""Techtenstein PDF Extract MCP Server.
|
|
2
|
+
|
|
3
|
+
Wraps the Techtenstein PDF Extract REST API and exposes it as MCP tools.
|
|
4
|
+
Claude Desktop, Cline, Cursor, and any MCP-compatible client can invoke
|
|
5
|
+
`pdf_extract_text`, `pdf_extract_tables`, or `pdf_metadata` on any PDF URL.
|
|
6
|
+
|
|
7
|
+
Install:
|
|
8
|
+
pip install fastmcp requests
|
|
9
|
+
export TECHTENSTEIN_API_KEY=your_key
|
|
10
|
+
|
|
11
|
+
Run:
|
|
12
|
+
python server.py
|
|
13
|
+
|
|
14
|
+
Or via uvx:
|
|
15
|
+
uvx techtenstein-pdf-mcp
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
import base64
|
|
19
|
+
import os
|
|
20
|
+
import sys
|
|
21
|
+
import requests
|
|
22
|
+
from fastmcp import FastMCP
|
|
23
|
+
|
|
24
|
+
API_BASE = os.getenv("TECHTENSTEIN_PDF_API_BASE", "https://pdf.api.techtenstein.com")
|
|
25
|
+
API_KEY = os.getenv("TECHTENSTEIN_API_KEY", "")
|
|
26
|
+
|
|
27
|
+
mcp = FastMCP(
|
|
28
|
+
name="techtenstein-pdf",
|
|
29
|
+
version="1.0.0",
|
|
30
|
+
description="Fast PDF text & table extraction. Powered by Techtenstein PDF API.",
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _headers() -> dict:
|
|
35
|
+
return {"X-API-Key": API_KEY} if API_KEY else {}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@mcp.tool()
|
|
39
|
+
def pdf_extract_text(pdf_url: str, ocr: bool = False) -> dict:
|
|
40
|
+
"""
|
|
41
|
+
Extract all text from a PDF URL as clean plain text.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
pdf_url: HTTPS URL of the PDF to extract.
|
|
45
|
+
ocr: Set true for scanned PDFs (uses Tesseract, slower but works on images).
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
{ "text": "...", "page_count": 12, "word_count": 3450, "ms": 240 }
|
|
49
|
+
"""
|
|
50
|
+
if not pdf_url.startswith(("http://", "https://")):
|
|
51
|
+
return {"error": "pdf_url must include http:// or https://"}
|
|
52
|
+
try:
|
|
53
|
+
r = requests.post(
|
|
54
|
+
f"{API_BASE}/extract",
|
|
55
|
+
json={"url": pdf_url, "mode": "text", "ocr": ocr},
|
|
56
|
+
headers=_headers(),
|
|
57
|
+
timeout=90,
|
|
58
|
+
)
|
|
59
|
+
r.raise_for_status()
|
|
60
|
+
return r.json()
|
|
61
|
+
except requests.RequestException as e:
|
|
62
|
+
return {"error": str(e)}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@mcp.tool()
|
|
66
|
+
def pdf_extract_tables(pdf_url: str) -> dict:
|
|
67
|
+
"""
|
|
68
|
+
Extract all tables from a PDF as structured JSON (list of row arrays per table).
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
pdf_url: HTTPS URL of the PDF.
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
{ "tables": [ { "page": 3, "rows": [ [ "col1", "col2" ], ... ] } ] }
|
|
75
|
+
"""
|
|
76
|
+
if not pdf_url.startswith(("http://", "https://")):
|
|
77
|
+
return {"error": "pdf_url must include http:// or https://"}
|
|
78
|
+
try:
|
|
79
|
+
r = requests.post(
|
|
80
|
+
f"{API_BASE}/extract",
|
|
81
|
+
json={"url": pdf_url, "mode": "tables"},
|
|
82
|
+
headers=_headers(),
|
|
83
|
+
timeout=90,
|
|
84
|
+
)
|
|
85
|
+
r.raise_for_status()
|
|
86
|
+
return r.json()
|
|
87
|
+
except requests.RequestException as e:
|
|
88
|
+
return {"error": str(e)}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@mcp.tool()
|
|
92
|
+
def pdf_metadata(pdf_url: str) -> dict:
|
|
93
|
+
"""
|
|
94
|
+
Extract PDF metadata (title, author, page count, creation date, encryption status).
|
|
95
|
+
|
|
96
|
+
Args:
|
|
97
|
+
pdf_url: HTTPS URL of the PDF.
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
{ "title": "...", "author": "...", "pages": 42, "created": "2026-01-15", "encrypted": false }
|
|
101
|
+
"""
|
|
102
|
+
if not pdf_url.startswith(("http://", "https://")):
|
|
103
|
+
return {"error": "pdf_url must include http:// or https://"}
|
|
104
|
+
try:
|
|
105
|
+
r = requests.post(
|
|
106
|
+
f"{API_BASE}/extract",
|
|
107
|
+
json={"url": pdf_url, "mode": "metadata"},
|
|
108
|
+
headers=_headers(),
|
|
109
|
+
timeout=30,
|
|
110
|
+
)
|
|
111
|
+
r.raise_for_status()
|
|
112
|
+
return r.json()
|
|
113
|
+
except requests.RequestException as e:
|
|
114
|
+
return {"error": str(e)}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
if __name__ == "__main__":
|
|
118
|
+
if not API_KEY:
|
|
119
|
+
print("WARNING: TECHTENSTEIN_API_KEY not set. Free tier only (50 extractions/day).", file=sys.stderr)
|
|
120
|
+
mcp.run()
|