chore: mcp-proxmox README and index updates

Made-with: Cursor
This commit is contained in:
defiQUG
2026-04-21 22:00:54 -07:00
parent 3cd98f979a
commit b2fde60eee
3 changed files with 40 additions and 5 deletions

View File

@@ -48,6 +48,13 @@ if (!loadEnvFile(envPath)) {
}
}
function formatProxmoxAuthHeader(user, tokenName, tokenValue) {
if (tokenName.includes('!')) {
return `PVEAPIToken=${tokenName}=${tokenValue}`;
}
return `PVEAPIToken=${user}!${tokenName}=${tokenValue}`;
}
class ProxmoxServer {
constructor() {
this.server = new Server(
@@ -139,7 +146,11 @@ class ProxmoxServer {
const url = `${baseUrl}${endpoint}`;
const headers = {
'Authorization': `PVEAPIToken=${this.proxmoxUser}!${this.proxmoxTokenName}=${this.proxmoxTokenValue}`,
'Authorization': formatProxmoxAuthHeader(
this.proxmoxUser,
this.proxmoxTokenName,
this.proxmoxTokenValue
),
'Content-Type': 'application/json'
};
@@ -3159,4 +3170,4 @@ class ProxmoxServer {
}
const server = new ProxmoxServer();
server.run().catch(console.error);
server.run().catch(console.error);