pdc-mcp 0.5.0 → 0.5.2
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/README.md +2 -1
- package/dist/index.js +56 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -95,7 +95,8 @@ está logado no painel) e repita o pedido. O token fica em
|
|
|
95
95
|
| `pdc_preflight` | Checagem pré-deploy: build, compose, env vazias (`ready`) |
|
|
96
96
|
| `pdc_deploy` | Dispara o deploy de um ambiente |
|
|
97
97
|
| `pdc_deployment_status` | Status + timeline + logs de um deployment |
|
|
98
|
-
| `pdc_runtime_logs` | Saúde/logs do container (diagnóstico de crash) |
|
|
98
|
+
| `pdc_runtime_logs` | Saúde/logs do container público (diagnóstico de crash) |
|
|
99
|
+
| `pdc_service_logs` | Serviços da stack Compose (estado/health) + log por-serviço — pra achar quem travou um deploy compose (ex.: `migrate`/`minio-init`) |
|
|
99
100
|
| `pdc_restart` / `pdc_stop` | Controle do app (com confirmação do usuário) |
|
|
100
101
|
|
|
101
102
|
## Prompts guiados
|
package/dist/index.js
CHANGED
|
@@ -29380,10 +29380,12 @@ class PdcClient {
|
|
|
29380
29380
|
baseUrl;
|
|
29381
29381
|
token;
|
|
29382
29382
|
fetchFn;
|
|
29383
|
+
clientLabel;
|
|
29383
29384
|
constructor(opts) {
|
|
29384
29385
|
this.baseUrl = opts.baseUrl.replace(/\/+$/, "");
|
|
29385
29386
|
this.token = opts.token ?? null;
|
|
29386
29387
|
this.fetchFn = opts.fetch ?? fetch;
|
|
29388
|
+
this.clientLabel = opts.clientLabel ?? "pdc-mcp";
|
|
29387
29389
|
}
|
|
29388
29390
|
setToken(token) {
|
|
29389
29391
|
this.token = token;
|
|
@@ -29396,6 +29398,7 @@ class PdcClient {
|
|
|
29396
29398
|
...init,
|
|
29397
29399
|
headers: {
|
|
29398
29400
|
Accept: "application/json",
|
|
29401
|
+
"X-PDC-Client": this.clientLabel,
|
|
29399
29402
|
...init?.body ? { "Content-Type": "application/json" } : {},
|
|
29400
29403
|
...this.token ? { Authorization: `Bearer ${this.token}` } : {},
|
|
29401
29404
|
...init?.headers
|
|
@@ -29445,7 +29448,7 @@ async function authenticatedClient(baseUrl, opts) {
|
|
|
29445
29448
|
const cred = await loadToken(baseUrl, opts?.configDir);
|
|
29446
29449
|
if (!cred)
|
|
29447
29450
|
return null;
|
|
29448
|
-
return new PdcClient({ baseUrl, token: cred.accessToken, fetch: opts?.fetch });
|
|
29451
|
+
return new PdcClient({ baseUrl, token: cred.accessToken, fetch: opts?.fetch, clientLabel: opts?.clientLabel });
|
|
29449
29452
|
}
|
|
29450
29453
|
// ../core/src/api.ts
|
|
29451
29454
|
class PdcApi {
|
|
@@ -29631,6 +29634,46 @@ async function detectContext(cwd = process.cwd()) {
|
|
|
29631
29634
|
}
|
|
29632
29635
|
return { repo, branch, dockerfile, compose };
|
|
29633
29636
|
}
|
|
29637
|
+
// package.json
|
|
29638
|
+
var package_default = {
|
|
29639
|
+
name: "pdc-mcp",
|
|
29640
|
+
version: "0.5.2",
|
|
29641
|
+
description: "Servidor MCP do PDC Deploy — opere o PDC (criar projetos, deployar, acompanhar builds) pelo seu agente de IA, com login por device code e segredos fora do chat.",
|
|
29642
|
+
type: "module",
|
|
29643
|
+
bin: { "pdc-mcp": "dist/index.js" },
|
|
29644
|
+
files: ["dist/index.js", "README.md", "LICENSE"],
|
|
29645
|
+
engines: { node: ">=18" },
|
|
29646
|
+
publishConfig: { access: "public" },
|
|
29647
|
+
scripts: {
|
|
29648
|
+
build: "bun build src/index.ts --target=node --outfile dist/index.js",
|
|
29649
|
+
prepublishOnly: "bun run build"
|
|
29650
|
+
},
|
|
29651
|
+
keywords: [
|
|
29652
|
+
"mcp",
|
|
29653
|
+
"model-context-protocol",
|
|
29654
|
+
"pdc",
|
|
29655
|
+
"deploy",
|
|
29656
|
+
"coolify",
|
|
29657
|
+
"claude",
|
|
29658
|
+
"cursor"
|
|
29659
|
+
],
|
|
29660
|
+
license: "MIT",
|
|
29661
|
+
repository: {
|
|
29662
|
+
type: "git",
|
|
29663
|
+
url: "git+https://github.com/pdc-deploy/pdc-mcp.git",
|
|
29664
|
+
directory: "packages/mcp"
|
|
29665
|
+
},
|
|
29666
|
+
homepage: "https://projetos.ltap.ifce.edu.br/docs",
|
|
29667
|
+
devDependencies: {
|
|
29668
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
29669
|
+
"@pdc/core": "*",
|
|
29670
|
+
zod: "^4.4.3"
|
|
29671
|
+
}
|
|
29672
|
+
};
|
|
29673
|
+
|
|
29674
|
+
// src/version.ts
|
|
29675
|
+
var MCP_VERSION = package_default.version;
|
|
29676
|
+
|
|
29634
29677
|
// src/session.ts
|
|
29635
29678
|
class PdcSession {
|
|
29636
29679
|
opts;
|
|
@@ -29641,7 +29684,8 @@ class PdcSession {
|
|
|
29641
29684
|
async api() {
|
|
29642
29685
|
const client = await authenticatedClient(this.opts.baseUrl, {
|
|
29643
29686
|
fetch: this.opts.fetch,
|
|
29644
|
-
configDir: this.opts.configDir
|
|
29687
|
+
configDir: this.opts.configDir,
|
|
29688
|
+
clientLabel: `pdc-mcp/${MCP_VERSION}`
|
|
29645
29689
|
});
|
|
29646
29690
|
return client ? new PdcApi(client) : null;
|
|
29647
29691
|
}
|
|
@@ -29719,9 +29763,6 @@ class PdcSession {
|
|
|
29719
29763
|
}
|
|
29720
29764
|
}
|
|
29721
29765
|
|
|
29722
|
-
// src/version.ts
|
|
29723
|
-
var MCP_VERSION = "0.4.1";
|
|
29724
|
-
|
|
29725
29766
|
// src/update.ts
|
|
29726
29767
|
var REGISTRY_URL = "https://registry.npmjs.org/pdc-mcp/latest";
|
|
29727
29768
|
var DOCS_URL = "https://projetos.ltap.ifce.edu.br/docs";
|
|
@@ -29740,10 +29781,11 @@ function updateBanner(info) {
|
|
|
29740
29781
|
return null;
|
|
29741
29782
|
return `⬆️ O PDC Deploy MCP tem uma atualização disponível: ${info.current} → ${info.latest}. ` + `Se você o instalou globalmente, rode \`npm i -g pdc-mcp@latest\`; ` + `se ele roda via npx (\`npx -y pdc-mcp\`), reinicie a sessão do agente para pegar a última. ` + `Novidades em ${DOCS_URL}.`;
|
|
29742
29783
|
}
|
|
29784
|
+
var CACHE_TTL_MS = 10 * 60 * 1000;
|
|
29743
29785
|
var cached2 = null;
|
|
29744
|
-
async function checkForUpdate(fetchImpl = fetch) {
|
|
29745
|
-
if (cached2)
|
|
29746
|
-
return cached2;
|
|
29786
|
+
async function checkForUpdate(fetchImpl = fetch, opts = {}) {
|
|
29787
|
+
if (!opts.force && cached2 && Date.now() - cached2.at < CACHE_TTL_MS)
|
|
29788
|
+
return cached2.info;
|
|
29747
29789
|
const current = MCP_VERSION;
|
|
29748
29790
|
try {
|
|
29749
29791
|
const r = await fetchImpl(REGISTRY_URL, { headers: { accept: "application/json" } });
|
|
@@ -29751,11 +29793,12 @@ async function checkForUpdate(fetchImpl = fetch) {
|
|
|
29751
29793
|
throw new Error(`registry ${r.status}`);
|
|
29752
29794
|
const data = await r.json();
|
|
29753
29795
|
const latest = typeof data.version === "string" ? data.version : null;
|
|
29754
|
-
|
|
29796
|
+
const info = { current, latest, updateAvailable: !!latest && compareVersions(latest, current) > 0 };
|
|
29797
|
+
cached2 = { at: Date.now(), info };
|
|
29798
|
+
return info;
|
|
29755
29799
|
} catch {
|
|
29756
|
-
|
|
29800
|
+
return { current, latest: null, updateAvailable: false };
|
|
29757
29801
|
}
|
|
29758
|
-
return cached2;
|
|
29759
29802
|
}
|
|
29760
29803
|
|
|
29761
29804
|
// src/server.ts
|
|
@@ -29796,7 +29839,7 @@ function createPdcMcpServer(opts) {
|
|
|
29796
29839
|
return opts.frontendUrl.replace(/\/+$/, "");
|
|
29797
29840
|
if (discoveredFrontend !== undefined)
|
|
29798
29841
|
return discoveredFrontend;
|
|
29799
|
-
const bare = new PdcApi(new PdcClient({ baseUrl: opts.baseUrl, fetch: opts.fetch }));
|
|
29842
|
+
const bare = new PdcApi(new PdcClient({ baseUrl: opts.baseUrl, fetch: opts.fetch, clientLabel: `pdc-mcp/${MCP_VERSION}` }));
|
|
29800
29843
|
discoveredFrontend = await bare.getPublicMeta().then((m) => m.frontendUrl?.replace(/\/+$/, "") ?? null).catch(() => {
|
|
29801
29844
|
return;
|
|
29802
29845
|
});
|
|
@@ -29821,7 +29864,7 @@ function createPdcMcpServer(opts) {
|
|
|
29821
29864
|
description: "Verifica no npm se há uma versão mais nova do PDC Deploy MCP e informa como atualizar. " + "Devolve { current, latest, updateAvailable }. Chame no INÍCIO da sessão; se updateAvailable=true, " + "avise o usuário com a instrução de atualização (é como os MCPs se mantêm atualizados).",
|
|
29822
29865
|
inputSchema: {}
|
|
29823
29866
|
}, () => run(async () => {
|
|
29824
|
-
const info = await checkForUpdate();
|
|
29867
|
+
const info = await checkForUpdate(fetch, { force: true });
|
|
29825
29868
|
return { ...info, message: updateBanner(info) ?? `Você está na última versão (${info.current}).` };
|
|
29826
29869
|
}));
|
|
29827
29870
|
server.registerTool("pdc_list_orgs", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pdc-mcp",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Servidor MCP do PDC Deploy — opere o PDC (criar projetos, deployar, acompanhar builds) pelo seu agente de IA, com login por device code e segredos fora do chat.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": { "pdc-mcp": "dist/index.js" },
|