← back to Cloudflare Dns Mcp
chore: lint, harden (per-request token load + engines guard), v1.0.1 (session close)
020098fc2b718b6207208a4baef6d8e03255d098 · 2026-07-30 13:12:52 -0700 · Steve
Files touched
M index.jsM package-lock.jsonM package.json
Diff
commit 020098fc2b718b6207208a4baef6d8e03255d098
Author: Steve <steve@designerwallcoverings.com>
Date: Thu Jul 30 13:12:52 2026 -0700
chore: lint, harden (per-request token load + engines guard), v1.0.1 (session close)
---
index.js | 7 ++++---
package-lock.json | 4 ++--
package.json | 9 +++++++--
3 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/index.js b/index.js
index 40b1a1b..0049b48 100644
--- a/index.js
+++ b/index.js
@@ -24,14 +24,15 @@ function loadToken() {
} catch { /* fall through */ }
return null;
}
-const TOKEN = loadToken();
const API = "https://api.cloudflare.com/client/v4";
async function cf(path, { method = "GET", body } = {}) {
- if (!TOKEN) throw new Error("CLOUDFLARE_API_TOKEN not found (env or secrets master).");
+ // Load per-request so a rotated token is picked up without restarting the server.
+ const token = loadToken();
+ if (!token) throw new Error("CLOUDFLARE_API_TOKEN not found (env or secrets master).");
const res = await fetch(API + path, {
method,
- headers: { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" },
+ headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
body: body ? JSON.stringify(body) : undefined,
});
const data = await res.json().catch(() => ({}));
diff --git a/package-lock.json b/package-lock.json
index 7681aa4..fabe01f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "cloudflare-dns-mcp",
- "version": "1.0.0",
+ "version": "1.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "cloudflare-dns-mcp",
- "version": "1.0.0",
+ "version": "1.0.1",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.0.0"
},
diff --git a/package.json b/package.json
index b2975ab..7c4bbea 100644
--- a/package.json
+++ b/package.json
@@ -1,10 +1,15 @@
{
"name": "cloudflare-dns-mcp",
- "version": "1.0.0",
+ "version": "1.0.1",
"private": true,
"type": "module",
"description": "Owned local MCP server for Cloudflare DNS record CRUD (uses CLOUDFLARE_API_TOKEN). Fills the gap domain-suite (GoDaddy-only) leaves.",
- "bin": { "cloudflare-dns-mcp": "index.js" },
+ "bin": {
+ "cloudflare-dns-mcp": "index.js"
+ },
+ "engines": {
+ "node": ">=18"
+ },
"dependencies": {
"@modelcontextprotocol/sdk": "^1.0.0"
}
← 63fa0d8 cloudflare-dns-mcp: owned local MCP for CF DNS record CRUD
·
back to Cloudflare Dns Mcp
·
auto-data-snapshot: 2026-09-02T09:35:20 (1 data files) — pac 190a91d →