dragonball-mcp 1.0.4 → 1.0.6
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 +5 -0
- package/dist/api.js +31 -0
- package/dist/server.js +2 -3
- package/package.json +1 -1
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -20,4 +20,9 @@ node dist/index.js
|
|
|
20
20
|
|
|
21
21
|
Data comes from the public Dragon Ball API.
|
|
22
22
|
|
|
23
|
+
## Licence — no paywall
|
|
23
24
|
|
|
25
|
+
Every tool in this package is free: no licence key, no premium tier, no hosted
|
|
26
|
+
licence gateway. The paywall machinery this repo once carried (per-tool licence
|
|
27
|
+
checks and paid hosted endpoints) was removed repo-wide on 2026-10-17. Nothing
|
|
28
|
+
that this package installs or calls asks you to pay.
|
package/dist/api.js
CHANGED
|
@@ -64,3 +64,34 @@ export async function planets(args = {}) {
|
|
|
64
64
|
}
|
|
65
65
|
return lines.join('\n');
|
|
66
66
|
}
|
|
67
|
+
|
|
68
|
+
const DRAGONBALL = 'https://dragonball-api.com/api/characters';
|
|
69
|
+
export async function characterDetail(args = {}) {
|
|
70
|
+
const id = Number(args?.id);
|
|
71
|
+
if (!Number.isInteger(id) || id < 1)
|
|
72
|
+
throw new Error('Provide a character id, like 1 for Goku.');
|
|
73
|
+
const res = await fetch(`${DRAGONBALL}/${id}`, {
|
|
74
|
+
headers: { 'User-Agent': 'mrfentmen-dragonball-mcp/1.0', Accept: 'application/json' },
|
|
75
|
+
signal: AbortSignal.timeout(20000),
|
|
76
|
+
});
|
|
77
|
+
if (res.status === 404)
|
|
78
|
+
throw new Error(`No Dragon Ball character has id ${id}`);
|
|
79
|
+
if (!res.ok)
|
|
80
|
+
throw new Error(`Dragon Ball API returned ${res.status}`);
|
|
81
|
+
const c = (await res.json());
|
|
82
|
+
if (!c?.name)
|
|
83
|
+
throw new Error('Dragon Ball API returned no character');
|
|
84
|
+
const planet = c.originPlanet;
|
|
85
|
+
const transforms = Array.isArray(c.transformations) ? c.transformations : [];
|
|
86
|
+
return [
|
|
87
|
+
`${c.name} (id ${c.id})`,
|
|
88
|
+
`Ki: ${c.ki ?? '?'}${c.maxKi ? ` · max ${c.maxKi}` : ''}`,
|
|
89
|
+
`Race: ${c.race ?? '?'} · gender ${c.gender ?? '?'} · ${c.affiliation ?? 'no affiliation'}`,
|
|
90
|
+
planet ? `Origin: ${planet.name ?? '?'}${planet.isDestroyed ? ' (destroyed)' : ''}` : 'Origin: unknown',
|
|
91
|
+
transforms.length
|
|
92
|
+
? `Transformations (${transforms.length}): ${transforms.map((t) => `${t.name}${t.ki ? ` [${t.ki}]` : ''}`).join(', ')}`
|
|
93
|
+
: 'Transformations: none on record',
|
|
94
|
+
(c.description ?? '').trim().slice(0, 600),
|
|
95
|
+
'https://dragonball-api.com/api/characters/' + c.id,
|
|
96
|
+
].filter(Boolean).join('\n');
|
|
97
|
+
}
|
package/dist/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { character, characters, planets } from "./api.js";
|
|
3
|
+
import { character, characters, planets, characterDetail } from "./api.js";
|
|
4
4
|
const text = (value) => ({ content: [{ type: "text", text: value }] });
|
|
5
5
|
const textError = (t) => ({ content: [{ type: "text", text: t }], isError: true });
|
|
6
6
|
const READ_ONLY = { readOnlyHint: true, openWorldHint: true };
|
|
@@ -39,9 +39,8 @@ export function createServer() {
|
|
|
39
39
|
inputSchema: z.object({ id: z.number().describe("Character id, like 1 for Goku. The characters list prints ids.") }),
|
|
40
40
|
annotations: READ_ONLY,
|
|
41
41
|
}, async (args) => {
|
|
42
|
-
// TODO: implement detail locally (paywall removed)
|
|
43
42
|
try {
|
|
44
|
-
return
|
|
43
|
+
return text(await characterDetail(args));
|
|
45
44
|
}
|
|
46
45
|
catch (e) {
|
|
47
46
|
return textError(String(e));
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/mrfentmen/dragonball-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.6",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "dragonball-mcp",
|
|
14
|
-
"version": "1.0.
|
|
14
|
+
"version": "1.0.6",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
}
|