apdf-cloud-cli 0.1.0__tar.gz → 0.2.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.
- {apdf_cloud_cli-0.1.0 → apdf_cloud_cli-0.2.0}/PKG-INFO +87 -15
- apdf_cloud_cli-0.2.0/README.md +148 -0
- {apdf_cloud_cli-0.1.0 → apdf_cloud_cli-0.2.0}/pyproject.toml +6 -1
- {apdf_cloud_cli-0.1.0 → apdf_cloud_cli-0.2.0}/src/apdf_cloud_cli/__init__.py +1 -1
- {apdf_cloud_cli-0.1.0 → apdf_cloud_cli-0.2.0}/src/apdf_cloud_cli/cli.py +33 -0
- apdf_cloud_cli-0.2.0/src/apdf_cloud_cli/resources/skills/apdf-cloud-mcp/SKILL.md +106 -0
- apdf_cloud_cli-0.2.0/src/apdf_cloud_cli/resources/skills/apdf-cloud-mcp/agents/openai.yaml +4 -0
- apdf_cloud_cli-0.2.0/src/apdf_cloud_cli/resources/skills/apdf-cloud-mcp/references/live-tests.md +30 -0
- apdf_cloud_cli-0.2.0/src/apdf_cloud_cli/resources/skills/apdf-cloud-mcp/references/mcp-config.md +65 -0
- apdf_cloud_cli-0.2.0/src/apdf_cloud_cli/resources/skills/apdf-cloud-mcp/references/prompts.md +43 -0
- apdf_cloud_cli-0.2.0/src/apdf_cloud_cli/resources/skills/apdf-cloud-mcp/references/security.md +38 -0
- apdf_cloud_cli-0.2.0/src/apdf_cloud_cli/resources/skills/apdf-cloud-mcp/references/setup.md +54 -0
- apdf_cloud_cli-0.2.0/src/apdf_cloud_cli/skill_installer.py +80 -0
- apdf_cloud_cli-0.1.0/README.md +0 -76
- {apdf_cloud_cli-0.1.0 → apdf_cloud_cli-0.2.0}/src/apdf_cloud_cli/client.py +0 -0
- {apdf_cloud_cli-0.1.0 → apdf_cloud_cli-0.2.0}/src/apdf_cloud_cli/config.py +0 -0
- {apdf_cloud_cli-0.1.0 → apdf_cloud_cli-0.2.0}/src/apdf_cloud_cli/mcp_server.py +0 -0
- {apdf_cloud_cli-0.1.0 → apdf_cloud_cli-0.2.0}/src/apdf_cloud_cli/operations.py +0 -0
- {apdf_cloud_cli-0.1.0 → apdf_cloud_cli-0.2.0}/src/apdf_cloud_cli/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: apdf-cloud-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: CLI and MCP server tools for Aspose PDF Cloud
|
|
5
5
|
Keywords: aspose,pdf,cli,mcp
|
|
6
6
|
Author: Andriy Andruhovski
|
|
@@ -32,8 +32,29 @@ Description-Content-Type: text/markdown
|
|
|
32
32
|
|
|
33
33
|
# APDF Cloud CLI + MCP Tools
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
and an MCP server.
|
|
35
|
+
APDF Cloud CLI exposes Aspose PDF Cloud storage and PDF operations through
|
|
36
|
+
both a command-line interface and an MCP server.
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
Install from PyPI:
|
|
41
|
+
|
|
42
|
+
```powershell
|
|
43
|
+
python -m pip install apdf-cloud-cli
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Check that the CLI is available:
|
|
47
|
+
|
|
48
|
+
```powershell
|
|
49
|
+
apdf-cloud-cli --help
|
|
50
|
+
apdf --help
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
For local development from a checkout:
|
|
54
|
+
|
|
55
|
+
```powershell
|
|
56
|
+
python -m pip install -e ".[dev]"
|
|
57
|
+
```
|
|
37
58
|
|
|
38
59
|
## Configuration
|
|
39
60
|
|
|
@@ -46,14 +67,18 @@ $env:ASPOSE_CLIENT_SECRET = "your-client-secret"
|
|
|
46
67
|
|
|
47
68
|
Optional environment variables:
|
|
48
69
|
|
|
49
|
-
- `
|
|
50
|
-
- `
|
|
51
|
-
- `
|
|
70
|
+
- `ASPOSE_STORAGE_NAME`: default Aspose storage name.
|
|
71
|
+
- `ASPOSE_BASE_URL`: alternate Aspose PDF Cloud base URL.
|
|
72
|
+
- `ASPOSE_SELF_HOST`: set to `1`, `true`, `yes`, or `on` for self-hosted use.
|
|
73
|
+
|
|
74
|
+
You can also create a local `.env` file. See
|
|
75
|
+
[`.env.example`](.env.example) for a template. Environment variables take
|
|
76
|
+
precedence over `.env` values.
|
|
52
77
|
|
|
53
|
-
## CLI
|
|
78
|
+
## CLI Usage
|
|
54
79
|
|
|
55
|
-
The canonical executable is `apdf-cloud-cli`. A shorter `apdf`
|
|
56
|
-
|
|
80
|
+
The canonical executable is `apdf-cloud-cli`. A shorter `apdf` alias is
|
|
81
|
+
also installed for convenience.
|
|
57
82
|
|
|
58
83
|
```powershell
|
|
59
84
|
apdf-cloud-cli storage list /
|
|
@@ -64,20 +89,61 @@ apdf-cloud-cli pdf extract-text sample.pdf --output sample.txt
|
|
|
64
89
|
apdf-cloud-cli mcp serve
|
|
65
90
|
```
|
|
66
91
|
|
|
67
|
-
##
|
|
92
|
+
## MCP Usage
|
|
68
93
|
|
|
69
|
-
|
|
94
|
+
After installing the package, configure your MCP client to launch:
|
|
70
95
|
|
|
71
96
|
```powershell
|
|
72
|
-
|
|
97
|
+
apdf-cloud-cli mcp serve
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Codex MCP configuration examples are available in
|
|
101
|
+
[docs/mcp-config.md](docs/mcp-config.md), with a copy-pasteable helper at
|
|
102
|
+
[examples/codex-mcp-config.toml](examples/codex-mcp-config.toml).
|
|
103
|
+
|
|
104
|
+
## Codex Prompts
|
|
105
|
+
|
|
106
|
+
Sample prompts for using this MCP server with Codex are in
|
|
107
|
+
[docs/codex-prompts.md](docs/codex-prompts.md).
|
|
108
|
+
|
|
109
|
+
## Install as an Agent Skill
|
|
110
|
+
|
|
111
|
+
The package includes an `apdf-cloud-mcp` skill for Codex and Claude Code.
|
|
112
|
+
Install the package first, then install the bundled skill:
|
|
113
|
+
|
|
114
|
+
```powershell
|
|
115
|
+
python -m pip install apdf-cloud-cli
|
|
116
|
+
apdf-cloud-cli skill install codex
|
|
117
|
+
apdf-cloud-cli skill install claude-code
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
For Claude Code project-local installation:
|
|
121
|
+
|
|
122
|
+
```powershell
|
|
123
|
+
apdf-cloud-cli skill install claude-code --project
|
|
73
124
|
```
|
|
74
125
|
|
|
75
|
-
|
|
126
|
+
Use `--force` to replace an existing installed copy. More details are in
|
|
127
|
+
[docs/agent-skill.md](docs/agent-skill.md).
|
|
128
|
+
|
|
129
|
+
## Development
|
|
130
|
+
|
|
131
|
+
Run the default unit test suite:
|
|
76
132
|
|
|
77
133
|
```powershell
|
|
78
134
|
python -m pytest -q
|
|
79
135
|
```
|
|
80
136
|
|
|
137
|
+
Run live Aspose Cloud smoke tests only when you intentionally want to call
|
|
138
|
+
the real API:
|
|
139
|
+
|
|
140
|
+
```powershell
|
|
141
|
+
$env:ASPOSE_RUN_LIVE_TESTS = "1"
|
|
142
|
+
python -m pytest -q -m live
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
More live-test setup notes are in [docs/live-tests.md](docs/live-tests.md).
|
|
146
|
+
|
|
81
147
|
Build and validate the package distributions:
|
|
82
148
|
|
|
83
149
|
```powershell
|
|
@@ -85,6 +151,12 @@ python -m build
|
|
|
85
151
|
python -m twine check dist/*
|
|
86
152
|
```
|
|
87
153
|
|
|
154
|
+
## Security
|
|
155
|
+
|
|
156
|
+
Never commit real credentials. Keep `.env` local, prefer short-lived
|
|
157
|
+
environment variables in CI, and avoid pasting secrets into issue reports,
|
|
158
|
+
test output, logs, or prompts. See [docs/security.md](docs/security.md).
|
|
159
|
+
|
|
88
160
|
## Publishing
|
|
89
161
|
|
|
90
162
|
Publishing is handled by GitHub Actions with PyPI trusted publishing.
|
|
@@ -97,8 +169,8 @@ Publishing is handled by GitHub Actions with PyPI trusted publishing.
|
|
|
97
169
|
3. Push a matching version tag, for example:
|
|
98
170
|
|
|
99
171
|
```powershell
|
|
100
|
-
git tag v0.
|
|
101
|
-
git push origin v0.
|
|
172
|
+
git tag v0.2.0
|
|
173
|
+
git push origin v0.2.0
|
|
102
174
|
```
|
|
103
175
|
|
|
104
176
|
## Stage 2 Roadmap
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# APDF Cloud CLI + MCP Tools
|
|
2
|
+
|
|
3
|
+
APDF Cloud CLI exposes Aspose PDF Cloud storage and PDF operations through
|
|
4
|
+
both a command-line interface and an MCP server.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Install from PyPI:
|
|
9
|
+
|
|
10
|
+
```powershell
|
|
11
|
+
python -m pip install apdf-cloud-cli
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Check that the CLI is available:
|
|
15
|
+
|
|
16
|
+
```powershell
|
|
17
|
+
apdf-cloud-cli --help
|
|
18
|
+
apdf --help
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
For local development from a checkout:
|
|
22
|
+
|
|
23
|
+
```powershell
|
|
24
|
+
python -m pip install -e ".[dev]"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Configuration
|
|
28
|
+
|
|
29
|
+
Set credentials before running CLI commands or the MCP server:
|
|
30
|
+
|
|
31
|
+
```powershell
|
|
32
|
+
$env:ASPOSE_CLIENT_ID = "your-client-id"
|
|
33
|
+
$env:ASPOSE_CLIENT_SECRET = "your-client-secret"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Optional environment variables:
|
|
37
|
+
|
|
38
|
+
- `ASPOSE_STORAGE_NAME`: default Aspose storage name.
|
|
39
|
+
- `ASPOSE_BASE_URL`: alternate Aspose PDF Cloud base URL.
|
|
40
|
+
- `ASPOSE_SELF_HOST`: set to `1`, `true`, `yes`, or `on` for self-hosted use.
|
|
41
|
+
|
|
42
|
+
You can also create a local `.env` file. See
|
|
43
|
+
[`.env.example`](.env.example) for a template. Environment variables take
|
|
44
|
+
precedence over `.env` values.
|
|
45
|
+
|
|
46
|
+
## CLI Usage
|
|
47
|
+
|
|
48
|
+
The canonical executable is `apdf-cloud-cli`. A shorter `apdf` alias is
|
|
49
|
+
also installed for convenience.
|
|
50
|
+
|
|
51
|
+
```powershell
|
|
52
|
+
apdf-cloud-cli storage list /
|
|
53
|
+
apdf-cloud-cli storage upload .\sample.pdf /sample.pdf
|
|
54
|
+
apdf-cloud-cli storage download /sample.pdf .\sample.pdf
|
|
55
|
+
apdf-cloud-cli pdf merge /a.pdf /b.pdf merged.pdf
|
|
56
|
+
apdf-cloud-cli pdf extract-text sample.pdf --output sample.txt
|
|
57
|
+
apdf-cloud-cli mcp serve
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## MCP Usage
|
|
61
|
+
|
|
62
|
+
After installing the package, configure your MCP client to launch:
|
|
63
|
+
|
|
64
|
+
```powershell
|
|
65
|
+
apdf-cloud-cli mcp serve
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Codex MCP configuration examples are available in
|
|
69
|
+
[docs/mcp-config.md](docs/mcp-config.md), with a copy-pasteable helper at
|
|
70
|
+
[examples/codex-mcp-config.toml](examples/codex-mcp-config.toml).
|
|
71
|
+
|
|
72
|
+
## Codex Prompts
|
|
73
|
+
|
|
74
|
+
Sample prompts for using this MCP server with Codex are in
|
|
75
|
+
[docs/codex-prompts.md](docs/codex-prompts.md).
|
|
76
|
+
|
|
77
|
+
## Install as an Agent Skill
|
|
78
|
+
|
|
79
|
+
The package includes an `apdf-cloud-mcp` skill for Codex and Claude Code.
|
|
80
|
+
Install the package first, then install the bundled skill:
|
|
81
|
+
|
|
82
|
+
```powershell
|
|
83
|
+
python -m pip install apdf-cloud-cli
|
|
84
|
+
apdf-cloud-cli skill install codex
|
|
85
|
+
apdf-cloud-cli skill install claude-code
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
For Claude Code project-local installation:
|
|
89
|
+
|
|
90
|
+
```powershell
|
|
91
|
+
apdf-cloud-cli skill install claude-code --project
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Use `--force` to replace an existing installed copy. More details are in
|
|
95
|
+
[docs/agent-skill.md](docs/agent-skill.md).
|
|
96
|
+
|
|
97
|
+
## Development
|
|
98
|
+
|
|
99
|
+
Run the default unit test suite:
|
|
100
|
+
|
|
101
|
+
```powershell
|
|
102
|
+
python -m pytest -q
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Run live Aspose Cloud smoke tests only when you intentionally want to call
|
|
106
|
+
the real API:
|
|
107
|
+
|
|
108
|
+
```powershell
|
|
109
|
+
$env:ASPOSE_RUN_LIVE_TESTS = "1"
|
|
110
|
+
python -m pytest -q -m live
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
More live-test setup notes are in [docs/live-tests.md](docs/live-tests.md).
|
|
114
|
+
|
|
115
|
+
Build and validate the package distributions:
|
|
116
|
+
|
|
117
|
+
```powershell
|
|
118
|
+
python -m build
|
|
119
|
+
python -m twine check dist/*
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Security
|
|
123
|
+
|
|
124
|
+
Never commit real credentials. Keep `.env` local, prefer short-lived
|
|
125
|
+
environment variables in CI, and avoid pasting secrets into issue reports,
|
|
126
|
+
test output, logs, or prompts. See [docs/security.md](docs/security.md).
|
|
127
|
+
|
|
128
|
+
## Publishing
|
|
129
|
+
|
|
130
|
+
Publishing is handled by GitHub Actions with PyPI trusted publishing.
|
|
131
|
+
|
|
132
|
+
1. In PyPI, add a trusted publisher for repository
|
|
133
|
+
`andruhovski/apdf-tools`, workflow `publish.yml`, environment `pypi`,
|
|
134
|
+
and project name `apdf-cloud-cli`.
|
|
135
|
+
2. Update the version in `pyproject.toml` and
|
|
136
|
+
`src/apdf_cloud_cli/__init__.py`.
|
|
137
|
+
3. Push a matching version tag, for example:
|
|
138
|
+
|
|
139
|
+
```powershell
|
|
140
|
+
git tag v0.2.0
|
|
141
|
+
git push origin v0.2.0
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Stage 2 Roadmap
|
|
145
|
+
|
|
146
|
+
- Split PDF files
|
|
147
|
+
- Extract images from PDF files
|
|
148
|
+
- Extract tables from PDF files
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "apdf-cloud-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0"
|
|
4
4
|
description = "CLI and MCP server tools for Aspose PDF Cloud"
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Andriy Andruhovski",email = "andruhovski@gmail.com"}
|
|
@@ -39,6 +39,11 @@ dev = [
|
|
|
39
39
|
apdf-cloud-cli = "apdf_cloud_cli.cli:main"
|
|
40
40
|
apdf = "apdf_cloud_cli.cli:main"
|
|
41
41
|
|
|
42
|
+
[tool.poetry]
|
|
43
|
+
include = [
|
|
44
|
+
{ path = "src/apdf_cloud_cli/resources/skills/apdf-cloud-mcp/**/*", format = ["sdist", "wheel"] },
|
|
45
|
+
]
|
|
46
|
+
|
|
42
47
|
[project.urls]
|
|
43
48
|
Homepage = "https://github.com/andruhovski/apdf-tools"
|
|
44
49
|
Repository = "https://github.com/andruhovski/apdf-tools"
|
|
@@ -12,14 +12,17 @@ from rich.table import Table
|
|
|
12
12
|
|
|
13
13
|
from . import operations
|
|
14
14
|
from .config import ConfigError
|
|
15
|
+
from .skill_installer import SkillInstallError, install_skill
|
|
15
16
|
|
|
16
17
|
app = typer.Typer(help="APDF CLI tools.")
|
|
17
18
|
storage_app = typer.Typer(help="Cloud storage operations.")
|
|
18
19
|
pdf_app = typer.Typer(help="PDF operations.")
|
|
19
20
|
mcp_app = typer.Typer(help="MCP server commands.")
|
|
21
|
+
skill_app = typer.Typer(help="Install bundled agent skills.")
|
|
20
22
|
app.add_typer(storage_app, name="storage")
|
|
21
23
|
app.add_typer(pdf_app, name="pdf")
|
|
22
24
|
app.add_typer(mcp_app, name="mcp")
|
|
25
|
+
app.add_typer(skill_app, name="skill")
|
|
23
26
|
|
|
24
27
|
console = Console()
|
|
25
28
|
|
|
@@ -154,6 +157,36 @@ def serve_mcp() -> None:
|
|
|
154
157
|
main()
|
|
155
158
|
|
|
156
159
|
|
|
160
|
+
@skill_app.command("install")
|
|
161
|
+
def install_agent_skill(
|
|
162
|
+
client: Annotated[
|
|
163
|
+
str,
|
|
164
|
+
typer.Argument(help="Target client: codex or claude-code."),
|
|
165
|
+
],
|
|
166
|
+
target_dir: Annotated[
|
|
167
|
+
Path | None,
|
|
168
|
+
typer.Option("--target-dir", help="Custom skills directory to install into."),
|
|
169
|
+
] = None,
|
|
170
|
+
project: Annotated[
|
|
171
|
+
bool,
|
|
172
|
+
typer.Option("--project", help="For Claude Code, install into ./.claude/skills."),
|
|
173
|
+
] = False,
|
|
174
|
+
force: Annotated[
|
|
175
|
+
bool,
|
|
176
|
+
typer.Option("--force", help="Replace an existing apdf-cloud-mcp skill."),
|
|
177
|
+
] = False,
|
|
178
|
+
) -> None:
|
|
179
|
+
"""Install the bundled APDF Cloud MCP skill for Codex or Claude Code."""
|
|
180
|
+
|
|
181
|
+
try:
|
|
182
|
+
result = install_skill(client, target_dir=target_dir, project=project, force=force)
|
|
183
|
+
except SkillInstallError as exc:
|
|
184
|
+
_handle_error(exc)
|
|
185
|
+
|
|
186
|
+
action = "Reinstalled" if result.overwritten else "Installed"
|
|
187
|
+
console.print(f"{action} [bold]apdf-cloud-mcp[/bold] skill to [bold]{result.destination}[/bold].")
|
|
188
|
+
|
|
189
|
+
|
|
157
190
|
def main() -> None:
|
|
158
191
|
app()
|
|
159
192
|
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: apdf-cloud-mcp
|
|
3
|
+
description: Use APDF Cloud CLI and its Aspose PDF Cloud MCP server for PDF/storage automation. Trigger when the user wants to configure or use the APDF MCP server, connect Codex or Claude Code to Aspose PDF Cloud, list/upload/download Aspose storage files, merge PDFs, extract PDF text, write sample agent prompts for APDF, run live APDF smoke tests, or troubleshoot APDF Cloud CLI/MCP setup and credential handling.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# APDF Cloud MCP
|
|
7
|
+
|
|
8
|
+
## Core Workflow
|
|
9
|
+
|
|
10
|
+
Use this skill for APDF Cloud CLI / MCP work involving Aspose PDF Cloud.
|
|
11
|
+
|
|
12
|
+
1. Determine whether the user wants setup, MCP usage, CLI usage, testing, docs, or troubleshooting.
|
|
13
|
+
2. Prefer active MCP tools for storage/PDF operations when the APDF MCP server is available.
|
|
14
|
+
3. Use the `apdf-cloud-cli` / `apdf` CLI as a fallback when MCP tools are unavailable or the user asks for local commands.
|
|
15
|
+
4. **Priority rule**: If the user explicitly requests CLI commands, provide CLI commands even when MCP tools are active. Otherwise, default to MCP tools when the server is available.
|
|
16
|
+
5. Keep credentials out of output, logs, examples, commits, and prompts. Use placeholders in docs and configs.
|
|
17
|
+
|
|
18
|
+
## MCP Operations
|
|
19
|
+
|
|
20
|
+
When APDF MCP tools are active, use them for:
|
|
21
|
+
|
|
22
|
+
- `list_files(path, storage_name=None)`
|
|
23
|
+
- `upload_file(local_path, remote_path, storage_name=None)`
|
|
24
|
+
- `download_file(remote_path, local_path, storage_name=None, version_id=None)`
|
|
25
|
+
- `merge_pdfs(input_1, input_2, output_name, folder=None, storage=None)`
|
|
26
|
+
- `extract_text(name, folder=None, storage=None)`
|
|
27
|
+
|
|
28
|
+
### Error Handling
|
|
29
|
+
|
|
30
|
+
If an MCP tool returns an error, report the error message to the user verbatim, identify the likely cause (e.g., invalid credentials, missing file, wrong storage name), and suggest a corrective action before retrying.
|
|
31
|
+
|
|
32
|
+
### Confirmation & Validation
|
|
33
|
+
|
|
34
|
+
Before executing upload, merge-output, or download-overwrite operations, confirm the target path unless the user has provided a fully-qualified remote path (e.g., `folder/filename.pdf`) and has not used words like 'somewhere', 'any folder', or left the path field empty.
|
|
35
|
+
|
|
36
|
+
For `download_file`, use `version_id` only when the user explicitly requests a specific file version. If version information is needed but not provided, ask the user for the version ID before calling the tool.
|
|
37
|
+
|
|
38
|
+
## Setup
|
|
39
|
+
|
|
40
|
+
For install/configuration tasks, read `references/setup.md`. If a referenced file (e.g., `references/setup.md`, `references/mcp-config.md`, `references/prompts.md`, or `references/security.md`) cannot be read, proceed using only the information provided in this prompt and clearly note to the user that the full reference document was unavailable.
|
|
41
|
+
|
|
42
|
+
Default install command:
|
|
43
|
+
|
|
44
|
+
```powershell
|
|
45
|
+
python -m pip install apdf-cloud-cli
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Default MCP command:
|
|
49
|
+
|
|
50
|
+
```powershell
|
|
51
|
+
apdf-cloud-cli mcp serve
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Required credentials:
|
|
55
|
+
|
|
56
|
+
- `ASPOSE_CLIENT_ID`
|
|
57
|
+
- `ASPOSE_CLIENT_SECRET`
|
|
58
|
+
|
|
59
|
+
Optional settings:
|
|
60
|
+
|
|
61
|
+
- `ASPOSE_STORAGE_NAME`
|
|
62
|
+
- `ASPOSE_BASE_URL`
|
|
63
|
+
- `ASPOSE_SELF_HOST`
|
|
64
|
+
|
|
65
|
+
## Agent MCP Config
|
|
66
|
+
|
|
67
|
+
For Codex and Claude Code config examples, read `references/mcp-config.md`.
|
|
68
|
+
|
|
69
|
+
Prefer inherited environment variables in agent config:
|
|
70
|
+
|
|
71
|
+
```toml
|
|
72
|
+
[mcp_servers.aspose_pdf_cloud]
|
|
73
|
+
command = "apdf-cloud-cli"
|
|
74
|
+
args = ["mcp", "serve"]
|
|
75
|
+
env_vars = [
|
|
76
|
+
"ASPOSE_CLIENT_ID",
|
|
77
|
+
"ASPOSE_CLIENT_SECRET",
|
|
78
|
+
"ASPOSE_STORAGE_NAME",
|
|
79
|
+
"ASPOSE_BASE_URL",
|
|
80
|
+
"ASPOSE_SELF_HOST"
|
|
81
|
+
]
|
|
82
|
+
startup_timeout_sec = 20
|
|
83
|
+
tool_timeout_sec = 120
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Prompt Writing
|
|
87
|
+
|
|
88
|
+
For sample agent prompts, read `references/prompts.md`.
|
|
89
|
+
|
|
90
|
+
Good APDF prompts specify:
|
|
91
|
+
|
|
92
|
+
- Storage path or local path.
|
|
93
|
+
- Operation: list, upload, download, merge, or extract text.
|
|
94
|
+
- Whether writes are allowed.
|
|
95
|
+
- Whether to summarize extracted text or save it.
|
|
96
|
+
|
|
97
|
+
## Security
|
|
98
|
+
|
|
99
|
+
For security details, read `references/security.md`.
|
|
100
|
+
|
|
101
|
+
Never print or commit real values for:
|
|
102
|
+
|
|
103
|
+
- `ASPOSE_CLIENT_ID`
|
|
104
|
+
- `ASPOSE_CLIENT_SECRET`
|
|
105
|
+
|
|
106
|
+
Use `<redacted>` or `your-client-id` / `your-client-secret` in examples.
|
apdf_cloud_cli-0.2.0/src/apdf_cloud_cli/resources/skills/apdf-cloud-mcp/references/live-tests.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Live Test Reference
|
|
2
|
+
|
|
3
|
+
Default tests do not call Aspose Cloud:
|
|
4
|
+
|
|
5
|
+
```powershell
|
|
6
|
+
python -m pytest -q
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Live tests require:
|
|
10
|
+
|
|
11
|
+
- `ASPOSE_CLIENT_ID`
|
|
12
|
+
- `ASPOSE_CLIENT_SECRET`
|
|
13
|
+
- `ASPOSE_RUN_LIVE_TESTS=1`
|
|
14
|
+
- `ASPOSE_STORAGE_NAME`, if the account requires named storage
|
|
15
|
+
|
|
16
|
+
Run live tests:
|
|
17
|
+
|
|
18
|
+
```powershell
|
|
19
|
+
$env:ASPOSE_CLIENT_ID = "your-client-id"
|
|
20
|
+
$env:ASPOSE_CLIENT_SECRET = "your-client-secret"
|
|
21
|
+
$env:ASPOSE_STORAGE_NAME = "your-storage-name"
|
|
22
|
+
$env:ASPOSE_RUN_LIVE_TESTS = "1"
|
|
23
|
+
python -m pytest -q -m live
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The live upload/download smoke test writes under the
|
|
27
|
+
`aspose-pdf-cloud-cli-live/` prefix and attempts cleanup. If interrupted,
|
|
28
|
+
check that prefix manually in Aspose storage.
|
|
29
|
+
|
|
30
|
+
Do not enable live tests in public CI unless safe credentials are explicitly configured.
|
apdf_cloud_cli-0.2.0/src/apdf_cloud_cli/resources/skills/apdf-cloud-mcp/references/mcp-config.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# MCP Configuration Reference
|
|
2
|
+
|
|
3
|
+
## Codex
|
|
4
|
+
|
|
5
|
+
Prefer inherited environment variables so secrets remain outside config files:
|
|
6
|
+
|
|
7
|
+
```toml
|
|
8
|
+
[mcp_servers.aspose_pdf_cloud]
|
|
9
|
+
command = "apdf-cloud-cli"
|
|
10
|
+
args = ["mcp", "serve"]
|
|
11
|
+
env_vars = [
|
|
12
|
+
"ASPOSE_CLIENT_ID",
|
|
13
|
+
"ASPOSE_CLIENT_SECRET",
|
|
14
|
+
"ASPOSE_STORAGE_NAME",
|
|
15
|
+
"ASPOSE_BASE_URL",
|
|
16
|
+
"ASPOSE_SELF_HOST"
|
|
17
|
+
]
|
|
18
|
+
startup_timeout_sec = 20
|
|
19
|
+
tool_timeout_sec = 120
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Claude Code
|
|
23
|
+
|
|
24
|
+
Claude Code skills can be installed globally under `~/.claude/skills/` or
|
|
25
|
+
per project under `.claude/skills/`. Configure the MCP server in the place
|
|
26
|
+
where your Claude Code setup manages MCP servers, using this command:
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
apdf-cloud-cli mcp serve
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
If your Claude Code MCP config uses JSON, adapt this shape:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"aspose_pdf_cloud": {
|
|
38
|
+
"command": "apdf-cloud-cli",
|
|
39
|
+
"args": ["mcp", "serve"],
|
|
40
|
+
"env": {
|
|
41
|
+
"ASPOSE_CLIENT_ID": "your-client-id",
|
|
42
|
+
"ASPOSE_CLIENT_SECRET": "your-client-secret",
|
|
43
|
+
"ASPOSE_STORAGE_NAME": "your-storage-name"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Explicit Environment Map
|
|
51
|
+
|
|
52
|
+
Only use explicit values in local-only files. Use placeholders in committed examples:
|
|
53
|
+
|
|
54
|
+
```toml
|
|
55
|
+
[mcp_servers.aspose_pdf_cloud]
|
|
56
|
+
command = "apdf-cloud-cli"
|
|
57
|
+
args = ["mcp", "serve"]
|
|
58
|
+
startup_timeout_sec = 20
|
|
59
|
+
tool_timeout_sec = 120
|
|
60
|
+
|
|
61
|
+
[mcp_servers.aspose_pdf_cloud.env]
|
|
62
|
+
ASPOSE_CLIENT_ID = "your-client-id"
|
|
63
|
+
ASPOSE_CLIENT_SECRET = "your-client-secret"
|
|
64
|
+
ASPOSE_STORAGE_NAME = "your-storage-name"
|
|
65
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Prompt Reference
|
|
2
|
+
|
|
3
|
+
## Storage
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
List the files in my default Aspose storage root and summarize the PDFs you find.
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
Upload ./sample.pdf to /codex-demo/sample.pdf in Aspose storage.
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```text
|
|
14
|
+
Download /codex-demo/sample.pdf from Aspose storage to ./downloads/sample.pdf.
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## PDF Operations
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
Merge /contracts/part-a.pdf and /contracts/part-b.pdf into merged-contract.pdf in Aspose storage.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
Extract text from /reports/q1.pdf and save it locally as ./reports/q1.txt.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
Extract text from /reports/q1.pdf, summarize the important dates, and tell me what looks missing.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Safe Workflows
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
Before modifying storage, list the target folder and ask me to confirm the upload path.
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
Use the APDF MCP tools, but do not print credentials or raw environment variables.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
Run a small smoke check by listing storage only. Do not upload, download, or delete files.
|
|
43
|
+
```
|
apdf_cloud_cli-0.2.0/src/apdf_cloud_cli/resources/skills/apdf-cloud-mcp/references/security.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Security Reference
|
|
2
|
+
|
|
3
|
+
## Credentials
|
|
4
|
+
|
|
5
|
+
Never commit or print real values for:
|
|
6
|
+
|
|
7
|
+
- `ASPOSE_CLIENT_ID`
|
|
8
|
+
- `ASPOSE_CLIENT_SECRET`
|
|
9
|
+
|
|
10
|
+
Treat these as sensitive too:
|
|
11
|
+
|
|
12
|
+
- `ASPOSE_STORAGE_NAME`
|
|
13
|
+
- `ASPOSE_BASE_URL`
|
|
14
|
+
- `ASPOSE_SELF_HOST`
|
|
15
|
+
|
|
16
|
+
## Config Files
|
|
17
|
+
|
|
18
|
+
Prefer MCP configs that inherit environment variables. If explicit secret
|
|
19
|
+
values are necessary for a local-only config, keep that file outside version
|
|
20
|
+
control.
|
|
21
|
+
|
|
22
|
+
Use placeholders in examples:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
ASPOSE_CLIENT_ID=your-client-id
|
|
26
|
+
ASPOSE_CLIENT_SECRET=your-client-secret
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Logs and Prompts
|
|
30
|
+
|
|
31
|
+
Before sharing logs, issue reports, or agent transcripts, redact secrets:
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
ASPOSE_CLIENT_SECRET=<redacted>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Do not echo raw environment variables unless the user explicitly asks and the
|
|
38
|
+
values are already placeholders.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Setup Reference
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
Install the published package:
|
|
6
|
+
|
|
7
|
+
```powershell
|
|
8
|
+
python -m pip install apdf-cloud-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Verify commands:
|
|
12
|
+
|
|
13
|
+
```powershell
|
|
14
|
+
apdf-cloud-cli --help
|
|
15
|
+
apdf --help
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Install from a local checkout for development:
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
python -m pip install -e ".[dev]"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Environment
|
|
25
|
+
|
|
26
|
+
Set required credentials:
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
$env:ASPOSE_CLIENT_ID = "your-client-id"
|
|
30
|
+
$env:ASPOSE_CLIENT_SECRET = "your-client-secret"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Set optional values when needed:
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
$env:ASPOSE_STORAGE_NAME = "your-storage-name"
|
|
37
|
+
$env:ASPOSE_BASE_URL = "https://api.aspose.cloud/v3.0"
|
|
38
|
+
$env:ASPOSE_SELF_HOST = "false"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Local `.env` files are supported by the APDF CLI, but they must remain untracked.
|
|
42
|
+
|
|
43
|
+
## CLI Commands
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
apdf-cloud-cli storage list /
|
|
47
|
+
apdf-cloud-cli storage upload .\sample.pdf /sample.pdf
|
|
48
|
+
apdf-cloud-cli storage download /sample.pdf .\sample.pdf
|
|
49
|
+
apdf-cloud-cli pdf merge /a.pdf /b.pdf merged.pdf
|
|
50
|
+
apdf-cloud-cli pdf extract-text sample.pdf --output sample.txt
|
|
51
|
+
apdf-cloud-cli mcp serve
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Use `apdf` as the short alias when convenient.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"""Install the bundled APDF Cloud MCP agent skill."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import shutil
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from importlib import resources
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
SKILL_NAME = "apdf-cloud-mcp"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class SkillInstallError(RuntimeError):
|
|
15
|
+
"""Raised when bundled skill installation fails."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@dataclass(frozen=True)
|
|
19
|
+
class SkillInstallResult:
|
|
20
|
+
client: str
|
|
21
|
+
destination: Path
|
|
22
|
+
overwritten: bool
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _bundled_skill_path() -> Path:
|
|
26
|
+
traversable = resources.files("apdf_cloud_cli") / "resources" / "skills" / SKILL_NAME
|
|
27
|
+
try:
|
|
28
|
+
path = Path(str(traversable))
|
|
29
|
+
except TypeError as exc:
|
|
30
|
+
raise SkillInstallError("Unable to resolve bundled skill path.") from exc
|
|
31
|
+
|
|
32
|
+
if not path.is_dir():
|
|
33
|
+
raise SkillInstallError(f"Bundled skill not found: {path}")
|
|
34
|
+
return path
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def default_skill_root(client: str, project: bool = False) -> Path:
|
|
38
|
+
"""Return the default skill root for Codex or Claude Code."""
|
|
39
|
+
|
|
40
|
+
normalized = client.strip().lower()
|
|
41
|
+
if normalized == "codex":
|
|
42
|
+
return Path.home() / ".codex" / "skills"
|
|
43
|
+
if normalized in {"claude", "claude-code", "claudecode"}:
|
|
44
|
+
if project:
|
|
45
|
+
return Path.cwd() / ".claude" / "skills"
|
|
46
|
+
return Path.home() / ".claude" / "skills"
|
|
47
|
+
raise SkillInstallError("Client must be 'codex' or 'claude-code'.")
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def install_skill(
|
|
51
|
+
client: str,
|
|
52
|
+
*,
|
|
53
|
+
target_dir: str | Path | None = None,
|
|
54
|
+
project: bool = False,
|
|
55
|
+
force: bool = False,
|
|
56
|
+
) -> SkillInstallResult:
|
|
57
|
+
"""Install the bundled skill into a client skill directory."""
|
|
58
|
+
|
|
59
|
+
root = Path(target_dir) if target_dir is not None else default_skill_root(client, project)
|
|
60
|
+
destination = root / SKILL_NAME
|
|
61
|
+
source = _bundled_skill_path()
|
|
62
|
+
|
|
63
|
+
overwritten = destination.exists()
|
|
64
|
+
if overwritten:
|
|
65
|
+
if not force:
|
|
66
|
+
raise SkillInstallError(
|
|
67
|
+
f"Skill already exists at {destination}. Re-run with --force to replace it."
|
|
68
|
+
)
|
|
69
|
+
if not destination.is_dir():
|
|
70
|
+
raise SkillInstallError(f"Destination exists and is not a directory: {destination}")
|
|
71
|
+
shutil.rmtree(destination)
|
|
72
|
+
|
|
73
|
+
root.mkdir(parents=True, exist_ok=True)
|
|
74
|
+
shutil.copytree(source, destination)
|
|
75
|
+
|
|
76
|
+
return SkillInstallResult(
|
|
77
|
+
client=client,
|
|
78
|
+
destination=destination,
|
|
79
|
+
overwritten=overwritten,
|
|
80
|
+
)
|
apdf_cloud_cli-0.1.0/README.md
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# APDF Cloud CLI + MCP Tools
|
|
2
|
-
|
|
3
|
-
Stage 1 exposes APDF storage and PDF operations through both a CLI
|
|
4
|
-
and an MCP server.
|
|
5
|
-
|
|
6
|
-
## Configuration
|
|
7
|
-
|
|
8
|
-
Set credentials before running CLI commands or the MCP server:
|
|
9
|
-
|
|
10
|
-
```powershell
|
|
11
|
-
$env:ASPOSE_CLIENT_ID = "your-client-id"
|
|
12
|
-
$env:ASPOSE_CLIENT_SECRET = "your-client-secret"
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Optional environment variables:
|
|
16
|
-
|
|
17
|
-
- `ASPOSE_BASE_URL`
|
|
18
|
-
- `ASPOSE_SELF_HOST`
|
|
19
|
-
- `ASPOSE_STORAGE_NAME`
|
|
20
|
-
|
|
21
|
-
## CLI
|
|
22
|
-
|
|
23
|
-
The canonical executable is `apdf-cloud-cli`. A shorter `apdf`
|
|
24
|
-
alias is also installed for convenience.
|
|
25
|
-
|
|
26
|
-
```powershell
|
|
27
|
-
apdf-cloud-cli storage list /
|
|
28
|
-
apdf-cloud-cli storage upload .\sample.pdf /sample.pdf
|
|
29
|
-
apdf-cloud-cli storage download /sample.pdf .\sample.pdf
|
|
30
|
-
apdf-cloud-cli pdf merge /a.pdf /b.pdf merged.pdf
|
|
31
|
-
apdf-cloud-cli pdf extract-text sample.pdf --output sample.txt
|
|
32
|
-
apdf-cloud-cli mcp serve
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Development
|
|
36
|
-
|
|
37
|
-
Install the package with development dependencies:
|
|
38
|
-
|
|
39
|
-
```powershell
|
|
40
|
-
python -m pip install -e ".[dev]"
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Run the default test suite:
|
|
44
|
-
|
|
45
|
-
```powershell
|
|
46
|
-
python -m pytest -q
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Build and validate the package distributions:
|
|
50
|
-
|
|
51
|
-
```powershell
|
|
52
|
-
python -m build
|
|
53
|
-
python -m twine check dist/*
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Publishing
|
|
57
|
-
|
|
58
|
-
Publishing is handled by GitHub Actions with PyPI trusted publishing.
|
|
59
|
-
|
|
60
|
-
1. In PyPI, add a trusted publisher for repository
|
|
61
|
-
`andruhovski/apdf-tools`, workflow `publish.yml`, environment `pypi`,
|
|
62
|
-
and project name `apdf-cloud-cli`.
|
|
63
|
-
2. Update the version in `pyproject.toml` and
|
|
64
|
-
`src/apdf_cloud_cli/__init__.py`.
|
|
65
|
-
3. Push a matching version tag, for example:
|
|
66
|
-
|
|
67
|
-
```powershell
|
|
68
|
-
git tag v0.1.0
|
|
69
|
-
git push origin v0.1.0
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Stage 2 Roadmap
|
|
73
|
-
|
|
74
|
-
- Split PDF files
|
|
75
|
-
- Extract images from PDF files
|
|
76
|
-
- Extract tables from PDF files
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|