@kolmopdf/mcp-server 1.0.0
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.
- package/.claude-plugin/marketplace.json +25 -0
- package/.github/ISSUE_TEMPLATE/bug-report.yml +75 -0
- package/.github/workflows/ci.yml +98 -0
- package/.github/workflows/release.yml +52 -0
- package/CHANGELOG.md +12 -0
- package/LICENSE +21 -0
- package/README.md +63 -0
- package/biome.json +33 -0
- package/codex-skill/kolmopdf/SKILL.md +108 -0
- package/codex-skill/kolmopdf/references/chain-recipes.md +35 -0
- package/codex-skill/kolmopdf/references/parameter-glossary.md +72 -0
- package/doc/apidocs/Format_Conversion_API_Guide.md +117 -0
- package/doc/apidocs/PDF_Layout_Translation_API_Guide.md +138 -0
- package/doc/apidocs/PDF_Parsing_API_Guide.md +364 -0
- package/doc/plan/DEVELOPMENT.md +896 -0
- package/doc/plan/DISTRIBUTION.md +377 -0
- package/doc/plan/TESTING_AND_USAGE.md +370 -0
- package/package.json +30 -0
- package/packages/mcp-server/LICENSE +21 -0
- package/packages/mcp-server/README.md +37 -0
- package/packages/mcp-server/dist/index.cjs +1004 -0
- package/packages/mcp-server/dist/index.cjs.map +1 -0
- package/packages/mcp-server/dist/index.d.cts +29 -0
- package/packages/mcp-server/dist/index.d.ts +29 -0
- package/packages/mcp-server/dist/index.js +979 -0
- package/packages/mcp-server/dist/index.js.map +1 -0
- package/packages/mcp-server/package.json +54 -0
- package/packages/mcp-server/src/client.ts +235 -0
- package/packages/mcp-server/src/config.ts +62 -0
- package/packages/mcp-server/src/context.ts +27 -0
- package/packages/mcp-server/src/errors.ts +271 -0
- package/packages/mcp-server/src/extract.ts +102 -0
- package/packages/mcp-server/src/index.ts +142 -0
- package/packages/mcp-server/src/pages.ts +16 -0
- package/packages/mcp-server/src/polling.ts +84 -0
- package/packages/mcp-server/src/progress.ts +48 -0
- package/packages/mcp-server/src/tools/check-balance.ts +33 -0
- package/packages/mcp-server/src/tools/convert.ts +130 -0
- package/packages/mcp-server/src/tools/estimate-cost.ts +82 -0
- package/packages/mcp-server/src/tools/get-task-status.ts +24 -0
- package/packages/mcp-server/src/tools/parse-pdf.ts +147 -0
- package/packages/mcp-server/src/tools/translate-pdf.ts +110 -0
- package/packages/mcp-server/tests/integration/smoke.test.ts +33 -0
- package/packages/mcp-server/tests/unit/config.test.ts +49 -0
- package/packages/mcp-server/tests/unit/convert.test.ts +28 -0
- package/packages/mcp-server/tests/unit/errors.test.ts +112 -0
- package/packages/mcp-server/tests/unit/estimate-cost.test.ts +28 -0
- package/packages/mcp-server/tests/unit/polling.test.ts +24 -0
- package/packages/mcp-server/tsconfig.json +9 -0
- package/packages/mcp-server/tsup.config.ts +13 -0
- package/packages/mcp-server/vitest.config.ts +13 -0
- package/plugins/kolmopdf/.claude-plugin/plugin.json +16 -0
- package/plugins/kolmopdf/.mcp.json +11 -0
- package/plugins/kolmopdf/README.md +28 -0
- package/plugins/kolmopdf/commands/balance.md +6 -0
- package/plugins/kolmopdf/commands/convert.md +14 -0
- package/plugins/kolmopdf/commands/parse.md +14 -0
- package/plugins/kolmopdf/commands/translate.md +14 -0
- package/plugins/kolmopdf/skills/kolmopdf/SKILL.md +108 -0
- package/plugins/kolmopdf/skills/kolmopdf/references/chain-recipes.md +35 -0
- package/plugins/kolmopdf/skills/kolmopdf/references/parameter-glossary.md +72 -0
- package/pnpm-workspace.yaml +2 -0
- package/smithery.yaml +21 -0
- package/tsconfig.base.json +21 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/claude-code-marketplace.json",
|
|
3
|
+
"name": "kolmopdf",
|
|
4
|
+
"description": "Official KolmoPDF plugin marketplace for Claude Code.",
|
|
5
|
+
"owner": {
|
|
6
|
+
"name": "KomoAI LLC",
|
|
7
|
+
"email": "support@kolmopdf.com"
|
|
8
|
+
},
|
|
9
|
+
"plugins": [
|
|
10
|
+
{
|
|
11
|
+
"name": "kolmopdf",
|
|
12
|
+
"displayName": "KolmoPDF",
|
|
13
|
+
"source": "./plugins/kolmopdf",
|
|
14
|
+
"description": "High-fidelity PDF to Markdown parsing, layout-preserving PDF translation, and Markdown format conversion.",
|
|
15
|
+
"version": "1.0.0",
|
|
16
|
+
"author": { "name": "KomoAI LLC", "email": "support@kolmopdf.com" },
|
|
17
|
+
"homepage": "https://www.kolmopdf.com",
|
|
18
|
+
"repository": "https://github.com/kolmopdf/claude-plugin",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"keywords": ["pdf", "markdown", "ocr", "translation", "latex", "research"],
|
|
21
|
+
"category": "document-processing",
|
|
22
|
+
"tags": ["pdf", "markdown", "translation", "academic", "arxiv"]
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report a problem with the KolmoPDF plugin or MCP server.
|
|
3
|
+
title: "[bug]: "
|
|
4
|
+
labels: [bug]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Please fill in the minimal diagnostic info below (TESTING_AND_USAGE.md §9).
|
|
10
|
+
Do NOT paste your API key. Use support@kolmopdf.com for secret-bearing reports.
|
|
11
|
+
- type: input
|
|
12
|
+
id: client-version
|
|
13
|
+
attributes:
|
|
14
|
+
label: Client version
|
|
15
|
+
description: "Claude Code: `claude --version` / Codex: `codex --version`"
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: input
|
|
19
|
+
id: plugin-version
|
|
20
|
+
attributes:
|
|
21
|
+
label: Plugin version
|
|
22
|
+
description: "`/plugin list` or plugin.json version"
|
|
23
|
+
validations:
|
|
24
|
+
required: true
|
|
25
|
+
- type: input
|
|
26
|
+
id: mcp-version
|
|
27
|
+
attributes:
|
|
28
|
+
label: MCP server version
|
|
29
|
+
description: "`npx @kolmopdf/mcp-server --version`"
|
|
30
|
+
validations:
|
|
31
|
+
required: true
|
|
32
|
+
- type: input
|
|
33
|
+
id: node-version
|
|
34
|
+
attributes:
|
|
35
|
+
label: Node version
|
|
36
|
+
description: "`node --version`"
|
|
37
|
+
validations:
|
|
38
|
+
required: true
|
|
39
|
+
- type: input
|
|
40
|
+
id: task-id
|
|
41
|
+
attributes:
|
|
42
|
+
label: task_id
|
|
43
|
+
description: From the failing tool's return value (if any).
|
|
44
|
+
validations:
|
|
45
|
+
required: false
|
|
46
|
+
- type: textarea
|
|
47
|
+
id: error
|
|
48
|
+
attributes:
|
|
49
|
+
label: error_code + message
|
|
50
|
+
description: The MCP tool's returned error payload.
|
|
51
|
+
validations:
|
|
52
|
+
required: true
|
|
53
|
+
- type: input
|
|
54
|
+
id: os
|
|
55
|
+
attributes:
|
|
56
|
+
label: Operating system
|
|
57
|
+
description: "`uname -a` or OS + version"
|
|
58
|
+
validations:
|
|
59
|
+
required: true
|
|
60
|
+
- type: dropdown
|
|
61
|
+
id: network
|
|
62
|
+
attributes:
|
|
63
|
+
label: Network location
|
|
64
|
+
description: Affects KolmoPDF upstream link quality.
|
|
65
|
+
options:
|
|
66
|
+
- Mainland China
|
|
67
|
+
- Outside mainland China
|
|
68
|
+
validations:
|
|
69
|
+
required: true
|
|
70
|
+
- type: textarea
|
|
71
|
+
id: steps
|
|
72
|
+
attributes:
|
|
73
|
+
label: Steps to reproduce
|
|
74
|
+
validations:
|
|
75
|
+
required: true
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
schedule:
|
|
8
|
+
- cron: "0 3 * * *" # nightly integration smoke
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
|
|
11
|
+
env:
|
|
12
|
+
PNPM_VERSION: 9.12.0
|
|
13
|
+
NODE_VERSION: 20
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
lint:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
- uses: pnpm/action-setup@v4
|
|
21
|
+
with:
|
|
22
|
+
version: ${{ env.PNPM_VERSION }}
|
|
23
|
+
- uses: actions/setup-node@v4
|
|
24
|
+
with:
|
|
25
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
26
|
+
cache: pnpm
|
|
27
|
+
- run: pnpm install --frozen-lockfile
|
|
28
|
+
- run: pnpm biome check .
|
|
29
|
+
|
|
30
|
+
typecheck:
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
- uses: pnpm/action-setup@v4
|
|
35
|
+
with:
|
|
36
|
+
version: ${{ env.PNPM_VERSION }}
|
|
37
|
+
- uses: actions/setup-node@v4
|
|
38
|
+
with:
|
|
39
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
40
|
+
cache: pnpm
|
|
41
|
+
- run: pnpm install --frozen-lockfile
|
|
42
|
+
- run: pnpm -r typecheck
|
|
43
|
+
|
|
44
|
+
test-unit:
|
|
45
|
+
runs-on: ubuntu-latest
|
|
46
|
+
steps:
|
|
47
|
+
- uses: actions/checkout@v4
|
|
48
|
+
- uses: pnpm/action-setup@v4
|
|
49
|
+
with:
|
|
50
|
+
version: ${{ env.PNPM_VERSION }}
|
|
51
|
+
- uses: actions/setup-node@v4
|
|
52
|
+
with:
|
|
53
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
54
|
+
cache: pnpm
|
|
55
|
+
- run: pnpm install --frozen-lockfile
|
|
56
|
+
- run: pnpm -r test:unit
|
|
57
|
+
|
|
58
|
+
test-integration:
|
|
59
|
+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v4
|
|
63
|
+
- uses: pnpm/action-setup@v4
|
|
64
|
+
with:
|
|
65
|
+
version: ${{ env.PNPM_VERSION }}
|
|
66
|
+
- uses: actions/setup-node@v4
|
|
67
|
+
with:
|
|
68
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
69
|
+
cache: pnpm
|
|
70
|
+
- run: pnpm install --frozen-lockfile
|
|
71
|
+
- run: pnpm --filter @kolmopdf/mcp-server test:integration
|
|
72
|
+
env:
|
|
73
|
+
KOLMOPDF_API_KEY: ${{ secrets.KOLMOPDF_API_KEY }}
|
|
74
|
+
|
|
75
|
+
validate-plugin:
|
|
76
|
+
runs-on: ubuntu-latest
|
|
77
|
+
steps:
|
|
78
|
+
- uses: actions/checkout@v4
|
|
79
|
+
- uses: actions/setup-node@v4
|
|
80
|
+
with:
|
|
81
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
82
|
+
# Enable once the CLI exposes plugin validation in CI:
|
|
83
|
+
# - run: npx @anthropic-ai/claude-code plugin validate .
|
|
84
|
+
- name: Validate marketplace & plugin JSON
|
|
85
|
+
run: |
|
|
86
|
+
node -e "JSON.parse(require('fs').readFileSync('.claude-plugin/marketplace.json','utf8'))"
|
|
87
|
+
node -e "JSON.parse(require('fs').readFileSync('plugins/kolmopdf/.claude-plugin/plugin.json','utf8'))"
|
|
88
|
+
node -e "JSON.parse(require('fs').readFileSync('plugins/kolmopdf/.mcp.json','utf8'))"
|
|
89
|
+
|
|
90
|
+
mirror-codex-skill:
|
|
91
|
+
runs-on: ubuntu-latest
|
|
92
|
+
steps:
|
|
93
|
+
- uses: actions/checkout@v4
|
|
94
|
+
- name: Ensure Codex skill mirror is byte-identical
|
|
95
|
+
run: |
|
|
96
|
+
diff plugins/kolmopdf/skills/kolmopdf/SKILL.md codex-skill/kolmopdf/SKILL.md
|
|
97
|
+
diff plugins/kolmopdf/skills/kolmopdf/references/parameter-glossary.md codex-skill/kolmopdf/references/parameter-glossary.md
|
|
98
|
+
diff plugins/kolmopdf/skills/kolmopdf/references/chain-recipes.md codex-skill/kolmopdf/references/chain-recipes.md
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
release:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
id-token: write
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- uses: pnpm/action-setup@v4
|
|
20
|
+
with:
|
|
21
|
+
version: 9.12.0
|
|
22
|
+
|
|
23
|
+
- uses: actions/setup-node@v4
|
|
24
|
+
with:
|
|
25
|
+
node-version: 20
|
|
26
|
+
cache: pnpm
|
|
27
|
+
registry-url: "https://registry.npmjs.org"
|
|
28
|
+
|
|
29
|
+
- run: pnpm install --frozen-lockfile
|
|
30
|
+
|
|
31
|
+
- name: Sanity check — versions match the tag
|
|
32
|
+
run: |
|
|
33
|
+
TAG="${GITHUB_REF_NAME#v}"
|
|
34
|
+
MCP=$(node -p "require('./packages/mcp-server/package.json').version")
|
|
35
|
+
PLUGIN=$(node -p "require('./plugins/kolmopdf/.claude-plugin/plugin.json').version")
|
|
36
|
+
MARKET=$(node -p "require('./.claude-plugin/marketplace.json').plugins[0].version")
|
|
37
|
+
echo "tag=$TAG mcp=$MCP plugin=$PLUGIN marketplace=$MARKET"
|
|
38
|
+
test "$TAG" = "$MCP" && test "$TAG" = "$PLUGIN" && test "$TAG" = "$MARKET" \
|
|
39
|
+
|| (echo "::error::version mismatch between tag and manifests" && exit 1)
|
|
40
|
+
|
|
41
|
+
- run: pnpm -r build
|
|
42
|
+
|
|
43
|
+
- name: Publish @kolmopdf/mcp-server
|
|
44
|
+
working-directory: packages/mcp-server
|
|
45
|
+
run: pnpm publish --access public --no-git-checks
|
|
46
|
+
env:
|
|
47
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
48
|
+
|
|
49
|
+
- name: Create GitHub Release
|
|
50
|
+
uses: softprops/action-gh-release@v2
|
|
51
|
+
with:
|
|
52
|
+
generate_release_notes: true
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format is based on
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres
|
|
5
|
+
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Initial monorepo scaffold: `@kolmopdf/mcp-server` package, Claude Code plugin,
|
|
12
|
+
KolmoPDF skill, marketplace entry, Codex CLI skill mirror, CI/CD workflows.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 KomoAI LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# KolmoPDF for Claude Code
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@kolmopdf/mcp-server)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://nodejs.org)
|
|
6
|
+
|
|
7
|
+
High-fidelity PDF→Markdown parsing, layout-preserving PDF translation, and Markdown→DOCX/HTML/PDF/LaTeX conversion — delivered as a Claude Code plugin, a Codex CLI / Cursor skill, and a standalone MCP server.
|
|
8
|
+
|
|
9
|
+
## Install (Claude Code)
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
/plugin marketplace add kolmopdf/claude-plugin
|
|
13
|
+
/plugin install kolmopdf@kolmopdf
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Then set `KOLMOPDF_API_KEY` in your environment and restart Claude Code.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
export KOLMOPDF_API_KEY=sk-xxxxxxxxxxxxxxxx
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Other clients (Codex CLI, Cursor, Claude Desktop): see [`doc/plan/TESTING_AND_USAGE.md`](doc/plan/TESTING_AND_USAGE.md) §2.
|
|
23
|
+
|
|
24
|
+
## Tools
|
|
25
|
+
|
|
26
|
+
| Tool | Capability |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| `kolmopdf_parse_pdf` | PDF → Markdown (optional translation) |
|
|
29
|
+
| `kolmopdf_translate_pdf` | Layout-preserving PDF translation |
|
|
30
|
+
| `kolmopdf_convert_markdown` | Markdown → DOCX / HTML / PDF / LaTeX |
|
|
31
|
+
| `kolmopdf_estimate_cost` | Pre-flight credit estimate |
|
|
32
|
+
| `kolmopdf_check_balance` | Current credit balance |
|
|
33
|
+
|
|
34
|
+
## Requirements
|
|
35
|
+
|
|
36
|
+
- Node.js ≥ 20
|
|
37
|
+
- KolmoPDF Plus or Pro account ([sign up](https://www.kolmopdf.com))
|
|
38
|
+
- API key from [API Management](https://www.kolmopdf.com/api-keys)
|
|
39
|
+
|
|
40
|
+
## Repository layout
|
|
41
|
+
|
|
42
|
+
| Path | Contents |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `packages/mcp-server` | `@kolmopdf/mcp-server` (MCP server) |
|
|
45
|
+
| `plugins/kolmopdf` | Claude Code plugin (skill, commands, manifest) |
|
|
46
|
+
| `.claude-plugin/marketplace.json` | Marketplace entry |
|
|
47
|
+
| `codex-skill/kolmopdf` | Codex CLI / Cursor skill mirror |
|
|
48
|
+
| `doc/` | API guides and project plans |
|
|
49
|
+
|
|
50
|
+
## Development
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
corepack enable pnpm
|
|
54
|
+
pnpm install
|
|
55
|
+
pnpm lint
|
|
56
|
+
pnpm typecheck
|
|
57
|
+
pnpm test:unit
|
|
58
|
+
pnpm build
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
package/biome.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"ignore": ["dist", "node_modules", "coverage", "kolmopdf-output"]
|
|
10
|
+
},
|
|
11
|
+
"formatter": {
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"indentStyle": "space",
|
|
14
|
+
"indentWidth": 2,
|
|
15
|
+
"lineWidth": 100
|
|
16
|
+
},
|
|
17
|
+
"organizeImports": {
|
|
18
|
+
"enabled": true
|
|
19
|
+
},
|
|
20
|
+
"linter": {
|
|
21
|
+
"enabled": true,
|
|
22
|
+
"rules": {
|
|
23
|
+
"recommended": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"javascript": {
|
|
27
|
+
"formatter": {
|
|
28
|
+
"quoteStyle": "double",
|
|
29
|
+
"trailingCommas": "all",
|
|
30
|
+
"semicolons": "always"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kolmopdf
|
|
3
|
+
description: Use this skill ONLY when the user gives an explicit operational instruction to process a PDF or Markdown file. Specifically: (1) explicitly asks to parse/convert a PDF into Markdown, (2) explicitly asks for layout-preserving PDF translation to produce a new translated PDF, (3) explicitly asks to export/convert Markdown to DOCX/HTML/PDF/LaTeX, or (4) a combination of the above (e.g. "parse this PDF to Markdown, then translate it, then export to DOCX"). Do NOT trigger for general PDF reading, summarization, or Q&A unless the user explicitly requests Markdown extraction first. Triggers: "parse PDF to markdown", "convert PDF to markdown", "translate this PDF preserving layout", "export markdown to docx/html/pdf/latex", "PDF to markdown with tables as images", "parse and translate this PDF".
|
|
4
|
+
allowed-tools: mcp__kolmopdf__kolmopdf_parse_pdf, mcp__kolmopdf__kolmopdf_translate_pdf, mcp__kolmopdf__kolmopdf_convert_markdown, mcp__kolmopdf__kolmopdf_estimate_cost, mcp__kolmopdf__kolmopdf_check_balance, Read, Write
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# KolmoPDF Skill
|
|
8
|
+
|
|
9
|
+
You have access to KolmoPDF tools (prefix `kolmopdf_*`) for high-fidelity PDF parsing and translation. These tools call a paid cloud service. Always follow the rules below.
|
|
10
|
+
|
|
11
|
+
## When to use
|
|
12
|
+
|
|
13
|
+
This skill triggers ONLY on explicit user instructions to perform a file operation:
|
|
14
|
+
|
|
15
|
+
- User explicitly asks to parse/convert a PDF into Markdown → `kolmopdf_parse_pdf`.
|
|
16
|
+
- User explicitly asks for layout-preserving PDF translation → `kolmopdf_translate_pdf`.
|
|
17
|
+
- User explicitly asks to export Markdown to DOCX/HTML/PDF/LaTeX → `kolmopdf_convert_markdown`.
|
|
18
|
+
- User requests a combination (e.g. "parse this PDF, translate it, then export to DOCX") → chain the tools in sequence.
|
|
19
|
+
|
|
20
|
+
Do NOT trigger when:
|
|
21
|
+
- User just wants to read or summarize a PDF without requesting Markdown output.
|
|
22
|
+
- User asks general questions about a PDF's content (use built-in Read instead).
|
|
23
|
+
- User mentions PDF in passing without an explicit processing instruction.
|
|
24
|
+
|
|
25
|
+
## Natural language parameter mapping
|
|
26
|
+
|
|
27
|
+
Users may describe parameters in natural language. Map their descriptions to tool parameters:
|
|
28
|
+
|
|
29
|
+
| User says | Parameter |
|
|
30
|
+
| --- | --- |
|
|
31
|
+
| "tables as images" / "keep table layout" | `table_mode="image"` |
|
|
32
|
+
| "use dollar signs for formulas" / "KaTeX format" | `formula_format="dollar"` |
|
|
33
|
+
| "use bracket notation" / "LaTeX-style delimiters" | `formula_format="bracket"` |
|
|
34
|
+
| "translate to Chinese/Japanese/..." | `enable_translation=true`, `target_language="zh"/"ja"/...` |
|
|
35
|
+
| "bilingual output" / "show both languages" | `output_options=["bilingual"]` |
|
|
36
|
+
| "images as URLs" / "don't download images" | `images_as_url=true` |
|
|
37
|
+
| "merge tables across pages" / "cross-page tables" | `enable_cross_page_merge=true` |
|
|
38
|
+
| "side by side translation" | `layout_modes=["side_by_side"]` |
|
|
39
|
+
| "translate images too" | `enable_image_translation=true` |
|
|
40
|
+
| "translate tables too" | `enable_table_translation=true` |
|
|
41
|
+
| "export to Word/DOCX/HTML/PDF/LaTeX" | `target_format` accordingly |
|
|
42
|
+
|
|
43
|
+
When the user's natural language is ambiguous, use sensible defaults from `references/parameter-glossary.md`. When the user specifies multiple preferences in one request, combine all applicable parameters in a single tool call.
|
|
44
|
+
|
|
45
|
+
## Cost-awareness protocol
|
|
46
|
+
|
|
47
|
+
Before running any operation that consumes credits:
|
|
48
|
+
|
|
49
|
+
1. Call `kolmopdf_estimate_cost` with the file path and intended operation.
|
|
50
|
+
2. If `sufficient` is false: stop and report `shortfall` and the top-up URL `https://www.kolmopdf.com/subscription` to the user. Do not proceed.
|
|
51
|
+
3. If `estimated_credits > 50`: tell the user the estimated cost and ask for confirmation before proceeding.
|
|
52
|
+
4. Otherwise: proceed.
|
|
53
|
+
|
|
54
|
+
## API key requirement
|
|
55
|
+
|
|
56
|
+
Tools require `KOLMOPDF_API_KEY` in the MCP server environment. If a tool returns `invalid_api_key`:
|
|
57
|
+
|
|
58
|
+
- Direct the user to https://www.kolmopdf.com/api-keys to create a key (requires Plus or Pro plan).
|
|
59
|
+
- Tell the user to set `KOLMOPDF_API_KEY` in their environment and restart Claude Code.
|
|
60
|
+
- Do not proceed with retries until the user confirms.
|
|
61
|
+
|
|
62
|
+
## Chained workflows
|
|
63
|
+
|
|
64
|
+
### PDF → DOCX/HTML/PDF/LaTeX (full pipeline)
|
|
65
|
+
|
|
66
|
+
1. `kolmopdf_estimate_cost(file, "parse")` → check balance.
|
|
67
|
+
2. `kolmopdf_parse_pdf(file)` → get `markdown_path`.
|
|
68
|
+
3. `kolmopdf_convert_markdown(markdown_path, target_format)` → final file.
|
|
69
|
+
|
|
70
|
+
If the PDF contains many images, pass the original directory (not just the markdown file) by zipping `output_root` first using your own tools, then pass the zip to convert. See `references/chain-recipes.md`.
|
|
71
|
+
|
|
72
|
+
### Read + ask Q&A about a paper
|
|
73
|
+
|
|
74
|
+
1. `kolmopdf_parse_pdf(file)` → get `markdown_path` and `preview`.
|
|
75
|
+
2. Use `Read` on `markdown_path` to load the full content.
|
|
76
|
+
3. Answer the user's question grounded in the markdown.
|
|
77
|
+
|
|
78
|
+
### Translate then convert to bilingual deliverable
|
|
79
|
+
|
|
80
|
+
Option A (PDF deliverable):
|
|
81
|
+
- `kolmopdf_translate_pdf(file, layout_modes=["side_by_side"])` → single PDF with side-by-side layout.
|
|
82
|
+
|
|
83
|
+
Option B (editable Markdown deliverable):
|
|
84
|
+
- `kolmopdf_parse_pdf(file, enable_translation=true, output_options=["bilingual"])` → bilingual markdown.
|
|
85
|
+
|
|
86
|
+
## Parameter guidance
|
|
87
|
+
|
|
88
|
+
See `references/parameter-glossary.md` for the full parameter table and defaults. Highlights:
|
|
89
|
+
|
|
90
|
+
- `formula_format=dollar` is the default and works with KaTeX/MathJax. Use `bracket` for LaTeX-strict downstream renderers.
|
|
91
|
+
- `enable_cross_page_merge=true` is recommended when the source PDF has tables spanning page breaks.
|
|
92
|
+
- `images_as_url=true` returns a single markdown file with 30-day URL references; use this for ephemeral pipelines. Default `false` returns a self-contained ZIP.
|
|
93
|
+
|
|
94
|
+
## Output handling
|
|
95
|
+
|
|
96
|
+
After successful tool calls, treat `output.markdown_path` / `output.translated_pdf_path` / `output.output_path` as the canonical local file paths and reference them in your reply to the user. Show the user the absolute path; do not re-print the entire file unless asked.
|
|
97
|
+
|
|
98
|
+
## Failure modes
|
|
99
|
+
|
|
100
|
+
| error_code | Action |
|
|
101
|
+
| --- | --- |
|
|
102
|
+
| `invalid_api_key` | Stop; follow API key requirement section above. |
|
|
103
|
+
| `insufficient_points` | Stop; report shortfall and top-up URL. |
|
|
104
|
+
| `parse_page_limit_exceeded`, `parse_file_too_large` | Stop; suggest splitting the PDF locally. |
|
|
105
|
+
| `parse_file_not_pdf`, `parse_file_invalid` | Stop; ask the user to re-export the PDF. |
|
|
106
|
+
| `parse_error`, `parse_timeout` | Server auto-refunds points. Suggest retry with smaller page range. |
|
|
107
|
+
| `client_polling_timeout` | Tell the user the task is still running server-side and suggest using `kolmopdf_get_task_status` with the task_id later. |
|
|
108
|
+
| Network/5xx | Tools auto-retry up to 3 times. If still failing, suggest checking https://www.kolmopdf.com/contact. |
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# KolmoPDF Chain Recipes
|
|
2
|
+
|
|
3
|
+
Expanded, step-by-step playbooks for the chained workflows summarized in `SKILL.md`.
|
|
4
|
+
|
|
5
|
+
## Recipe 1 — PDF → DOCX/HTML/PDF/LaTeX (full pipeline)
|
|
6
|
+
|
|
7
|
+
1. `kolmopdf_estimate_cost({ file_path, operation: "parse" })`.
|
|
8
|
+
- If `sufficient=false` → stop; report `shortfall` + https://www.kolmopdf.com/subscription.
|
|
9
|
+
- If `estimated_credits > 50` → ask the user to confirm.
|
|
10
|
+
2. `kolmopdf_parse_pdf({ file_path })` → capture `output.markdown_path` and `output.output_root`.
|
|
11
|
+
3. Decide the convert input:
|
|
12
|
+
- **Markdown has no local images** (or `images_as_url=true` was used): pass `output.markdown_path` directly.
|
|
13
|
+
- **Markdown references local images**: zip `output.output_root` with your own tools (`Write`/shell), then pass the `.zip` path so figures survive conversion.
|
|
14
|
+
4. `kolmopdf_convert_markdown({ file_path: <md-or-zip>, target_format })`.
|
|
15
|
+
5. Report `output.output_path` to the user (absolute path).
|
|
16
|
+
|
|
17
|
+
Total cost ≈ `pages × 2 + 1`.
|
|
18
|
+
|
|
19
|
+
## Recipe 2 — Read + Q&A about a paper
|
|
20
|
+
|
|
21
|
+
1. `kolmopdf_parse_pdf({ file_path })` → `output.markdown_path`, `preview`.
|
|
22
|
+
2. `Read` the `markdown_path` to load full content into context.
|
|
23
|
+
3. Answer the user's question grounded strictly in the parsed markdown. Cite section headings where useful.
|
|
24
|
+
|
|
25
|
+
## Recipe 3 — Translate then deliver bilingual
|
|
26
|
+
|
|
27
|
+
**Option A — PDF deliverable (layout preserved):**
|
|
28
|
+
1. `kolmopdf_estimate_cost({ file_path, operation: "translate" })`.
|
|
29
|
+
2. `kolmopdf_translate_pdf({ file_path, source_language, target_language, layout_modes: ["side_by_side"] })`.
|
|
30
|
+
3. Report `output.translated_pdf_path`.
|
|
31
|
+
|
|
32
|
+
**Option B — editable Markdown deliverable:**
|
|
33
|
+
1. `kolmopdf_estimate_cost({ file_path, operation: "parse_translate" })`.
|
|
34
|
+
2. `kolmopdf_parse_pdf({ file_path, enable_translation: true, target_language, output_options: ["bilingual"] })`.
|
|
35
|
+
3. Report `output.markdown_path`. Optionally chain Recipe 1 step 4 to produce a bilingual DOCX.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# KolmoPDF Parameter Glossary
|
|
2
|
+
|
|
3
|
+
Full parameter reference for the KolmoPDF tools. This file is not auto-loaded; the skill reads it on demand.
|
|
4
|
+
|
|
5
|
+
## `kolmopdf_parse_pdf`
|
|
6
|
+
|
|
7
|
+
| Parameter | Type | Legal values | Default | Billing impact |
|
|
8
|
+
| --- | --- | --- | --- | --- |
|
|
9
|
+
| `file_path` | string | local path to a `.pdf` | — | — |
|
|
10
|
+
| `table_mode` | enum | `markdown`, `image` | `markdown` | none |
|
|
11
|
+
| `formula_format` | enum | `dollar`, `bracket` | `dollar` | none |
|
|
12
|
+
| `enable_translation` | boolean | `true`, `false` | `false` | `true` → 3 pts/page instead of 2 |
|
|
13
|
+
| `target_language` | enum | `zh`, `en`, `ja`, `ko`, `fr`, `de`, `es`, `ru` | `zh` | only when `enable_translation=true` |
|
|
14
|
+
| `output_options` | string[] | `original`, `translated`, `bilingual` | `original` | none |
|
|
15
|
+
| `images_as_url` | boolean | `true`, `false` | `false` | none (`true` → single `.md` w/ 30-day URLs; `false` → ZIP) |
|
|
16
|
+
| `skip_rotation_detection` | boolean | `true`, `false` | `false` | none |
|
|
17
|
+
| `enable_cross_page_merge` | boolean | `true`, `false` | `false` | none (merges tables across ≤ 3 pages) |
|
|
18
|
+
| `output_subdir` | string | any dir name | `<task_id>` | none |
|
|
19
|
+
|
|
20
|
+
Cost: parse only = `pages × 2`; parse + translate = `pages × 3`.
|
|
21
|
+
|
|
22
|
+
## `kolmopdf_translate_pdf`
|
|
23
|
+
|
|
24
|
+
| Parameter | Type | Legal values | Default |
|
|
25
|
+
| --- | --- | --- | --- |
|
|
26
|
+
| `file_path` | string | local path to a `.pdf` | — |
|
|
27
|
+
| `source_language` | string | language code | `en` |
|
|
28
|
+
| `target_language` | string | language code | `zh` |
|
|
29
|
+
| `layout_modes` | string[] | `translated_only`, `side_by_side` | `["translated_only"]` |
|
|
30
|
+
| `enable_image_translation` | boolean | `true`, `false` | `false` |
|
|
31
|
+
| `enable_table_translation` | boolean | `true`, `false` | `false` |
|
|
32
|
+
| `output_subdir` | string | any dir name | `<task_id>` |
|
|
33
|
+
|
|
34
|
+
Cost: `pages × 2`.
|
|
35
|
+
|
|
36
|
+
## `kolmopdf_convert_markdown`
|
|
37
|
+
|
|
38
|
+
| Parameter | Type | Legal values | Default |
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
|
+
| `file_path` | string | `.md`, `.markdown`, or `.zip` | — |
|
|
41
|
+
| `target_format` | enum | `word`, `docx`, `html`, `pdf`, `latex`, `tex` | `word` |
|
|
42
|
+
| `output_subdir` | string | any dir name | `<task_id>` |
|
|
43
|
+
|
|
44
|
+
Extension mapping: `word|docx → .docx`, `html → .html`, `pdf → .pdf`, `latex|tex → .tex`.
|
|
45
|
+
|
|
46
|
+
Cost: 1 credit/task.
|
|
47
|
+
|
|
48
|
+
## Language codes
|
|
49
|
+
|
|
50
|
+
| Code | Language |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| `zh` | Chinese |
|
|
53
|
+
| `en` | English |
|
|
54
|
+
| `ja` | Japanese |
|
|
55
|
+
| `ko` | Korean |
|
|
56
|
+
| `fr` | French |
|
|
57
|
+
| `de` | German |
|
|
58
|
+
| `es` | Spanish |
|
|
59
|
+
| `ru` | Russian |
|
|
60
|
+
|
|
61
|
+
## ZIP output structure (`images_as_url=false`)
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
<KOLMOPDF_OUTPUT_DIR>/<task_id>/
|
|
65
|
+
├── <document>.md # canonical markdown_path (first *.md found)
|
|
66
|
+
├── images/ # extracted figures → images_dir
|
|
67
|
+
│ ├── img-0001.png
|
|
68
|
+
│ └── ...
|
|
69
|
+
└── (other assets, flattened)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
When `images_as_url=true`, the result is a single `result.md` with public image URLs (cached 30 days) and `images_dir = null`.
|