domeneshop-mcp 1.0.0
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/CHANGELOG.md +10 -0
- package/LICENSE +21 -0
- package/README.md +223 -0
- package/dist/domeneshop/assert.d.ts +9 -0
- package/dist/domeneshop/assert.d.ts.map +1 -0
- package/dist/domeneshop/assert.js +14 -0
- package/dist/domeneshop/assert.js.map +1 -0
- package/dist/domeneshop/client.d.ts +23 -0
- package/dist/domeneshop/client.d.ts.map +1 -0
- package/dist/domeneshop/client.js +27 -0
- package/dist/domeneshop/client.js.map +1 -0
- package/dist/domeneshop/http.d.ts +44 -0
- package/dist/domeneshop/http.d.ts.map +1 -0
- package/dist/domeneshop/http.js +58 -0
- package/dist/domeneshop/http.js.map +1 -0
- package/dist/domeneshop/index.d.ts +14 -0
- package/dist/domeneshop/index.d.ts.map +1 -0
- package/dist/domeneshop/index.js +8 -0
- package/dist/domeneshop/index.js.map +1 -0
- package/dist/domeneshop/resources/dns.d.ts +68 -0
- package/dist/domeneshop/resources/dns.d.ts.map +1 -0
- package/dist/domeneshop/resources/dns.js +60 -0
- package/dist/domeneshop/resources/dns.js.map +1 -0
- package/dist/domeneshop/resources/domains.d.ts +27 -0
- package/dist/domeneshop/resources/domains.d.ts.map +1 -0
- package/dist/domeneshop/resources/domains.js +20 -0
- package/dist/domeneshop/resources/domains.js.map +1 -0
- package/dist/domeneshop/resources/dyndns.d.ts +12 -0
- package/dist/domeneshop/resources/dyndns.d.ts.map +1 -0
- package/dist/domeneshop/resources/dyndns.js +18 -0
- package/dist/domeneshop/resources/dyndns.js.map +1 -0
- package/dist/domeneshop/resources/forwards.d.ts +28 -0
- package/dist/domeneshop/resources/forwards.d.ts.map +1 -0
- package/dist/domeneshop/resources/forwards.js +58 -0
- package/dist/domeneshop/resources/forwards.js.map +1 -0
- package/dist/domeneshop/resources/invoices.d.ts +30 -0
- package/dist/domeneshop/resources/invoices.d.ts.map +1 -0
- package/dist/domeneshop/resources/invoices.js +28 -0
- package/dist/domeneshop/resources/invoices.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/annotations.d.ts +13 -0
- package/dist/mcp/annotations.d.ts.map +1 -0
- package/dist/mcp/annotations.js +18 -0
- package/dist/mcp/annotations.js.map +1 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +2 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/result.d.ts +8 -0
- package/dist/mcp/result.d.ts.map +1 -0
- package/dist/mcp/result.js +16 -0
- package/dist/mcp/result.js.map +1 -0
- package/dist/mcp/schema.d.ts +4 -0
- package/dist/mcp/schema.d.ts.map +1 -0
- package/dist/mcp/schema.js +2 -0
- package/dist/mcp/schema.js.map +1 -0
- package/dist/mcp/server.d.ts +5 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +18 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool.d.ts +7 -0
- package/dist/mcp/tool.d.ts.map +1 -0
- package/dist/mcp/tool.js +16 -0
- package/dist/mcp/tool.js.map +1 -0
- package/dist/mcp/tools/dns.d.ts +4 -0
- package/dist/mcp/tools/dns.d.ts.map +1 -0
- package/dist/mcp/tools/dns.js +147 -0
- package/dist/mcp/tools/dns.js.map +1 -0
- package/dist/mcp/tools/domains.d.ts +4 -0
- package/dist/mcp/tools/domains.d.ts.map +1 -0
- package/dist/mcp/tools/domains.js +29 -0
- package/dist/mcp/tools/domains.js.map +1 -0
- package/dist/mcp/tools/dyndns.d.ts +4 -0
- package/dist/mcp/tools/dyndns.d.ts.map +1 -0
- package/dist/mcp/tools/dyndns.js +22 -0
- package/dist/mcp/tools/dyndns.js.map +1 -0
- package/dist/mcp/tools/forwards.d.ts +4 -0
- package/dist/mcp/tools/forwards.d.ts.map +1 -0
- package/dist/mcp/tools/forwards.js +73 -0
- package/dist/mcp/tools/forwards.js.map +1 -0
- package/dist/mcp/tools/invoices.d.ts +4 -0
- package/dist/mcp/tools/invoices.d.ts.map +1 -0
- package/dist/mcp/tools/invoices.js +32 -0
- package/dist/mcp/tools/invoices.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { HttpTransport } from "../http.js";
|
|
2
|
+
export interface DomainServices {
|
|
3
|
+
dns: boolean;
|
|
4
|
+
email: boolean;
|
|
5
|
+
registrar: boolean;
|
|
6
|
+
webhotel: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Domain {
|
|
9
|
+
id: number;
|
|
10
|
+
domain: string;
|
|
11
|
+
expiry_date: string;
|
|
12
|
+
nameservers: string[];
|
|
13
|
+
registrant: string;
|
|
14
|
+
registered_date: string;
|
|
15
|
+
renew: boolean;
|
|
16
|
+
services: DomainServices;
|
|
17
|
+
status: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class DomainsResource {
|
|
20
|
+
private readonly transport;
|
|
21
|
+
constructor(transport: HttpTransport);
|
|
22
|
+
/** Lists all domains on the account. If filter is set, only domains matching it are returned. */
|
|
23
|
+
list(filter?: string): Promise<Domain[]>;
|
|
24
|
+
/** Retrieves a single domain by its Domeneshop domain ID. */
|
|
25
|
+
get(domainId: number): Promise<Domain>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=domains.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domains.d.ts","sourceRoot":"","sources":["../../../src/domeneshop/resources/domains.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,cAAc,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,aAAa;IAErD,iGAAiG;IAC3F,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAO9C,6DAA6D;IACvD,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAI7C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { assertDefined } from "../assert.js";
|
|
2
|
+
export class DomainsResource {
|
|
3
|
+
transport;
|
|
4
|
+
constructor(transport) {
|
|
5
|
+
this.transport = transport;
|
|
6
|
+
}
|
|
7
|
+
/** Lists all domains on the account. If filter is set, only domains matching it are returned. */
|
|
8
|
+
async list(filter) {
|
|
9
|
+
const { data } = await this.transport.request("GET", "/domains", {
|
|
10
|
+
query: { domain: filter },
|
|
11
|
+
});
|
|
12
|
+
return data ?? [];
|
|
13
|
+
}
|
|
14
|
+
/** Retrieves a single domain by its Domeneshop domain ID. */
|
|
15
|
+
async get(domainId) {
|
|
16
|
+
const { data } = await this.transport.request("GET", `/domains/${String(domainId)}`);
|
|
17
|
+
return assertDefined(data, "domeneshop: empty response for domain");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=domains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domains.js","sourceRoot":"","sources":["../../../src/domeneshop/resources/domains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAsB7C,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,SAAwB;QAAxB,cAAS,GAAT,SAAS,CAAe;IAAG,CAAC;IAEzD,iGAAiG;IACjG,KAAK,CAAC,IAAI,CAAC,MAAe;QACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAW,KAAK,EAAE,UAAU,EAAE;YACzE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;SAC1B,CAAC,CAAC;QACH,OAAO,IAAI,IAAI,EAAE,CAAC;IACpB,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,GAAG,CAAC,QAAgB;QACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAS,KAAK,EAAE,YAAY,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC7F,OAAO,aAAa,CAAC,IAAI,EAAE,uCAAuC,CAAC,CAAC;IACtE,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { HttpTransport } from "../http.js";
|
|
2
|
+
export declare class DynDnsResource {
|
|
3
|
+
private readonly transport;
|
|
4
|
+
constructor(transport: HttpTransport);
|
|
5
|
+
/**
|
|
6
|
+
* Updates the DNS record for hostname to point at myIp (or the caller's
|
|
7
|
+
* apparent IP address if myIp is omitted), using Domeneshop's dynamic DNS
|
|
8
|
+
* update protocol.
|
|
9
|
+
*/
|
|
10
|
+
update(hostname: string, myIp?: string): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=dyndns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dyndns.d.ts","sourceRoot":"","sources":["../../../src/domeneshop/resources/dyndns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,aAAa;IAErD;;;;OAIG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAM7D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class DynDnsResource {
|
|
2
|
+
transport;
|
|
3
|
+
constructor(transport) {
|
|
4
|
+
this.transport = transport;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Updates the DNS record for hostname to point at myIp (or the caller's
|
|
8
|
+
* apparent IP address if myIp is omitted), using Domeneshop's dynamic DNS
|
|
9
|
+
* update protocol.
|
|
10
|
+
*/
|
|
11
|
+
async update(hostname, myIp) {
|
|
12
|
+
await this.transport.request("GET", "/dyndns/update", {
|
|
13
|
+
query: { hostname, myip: myIp },
|
|
14
|
+
decodeJson: false,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=dyndns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dyndns.js","sourceRoot":"","sources":["../../../src/domeneshop/resources/dyndns.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,cAAc;IACI;IAA7B,YAA6B,SAAwB;QAAxB,cAAS,GAAT,SAAS,CAAe;IAAG,CAAC;IAEzD;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,IAAa;QAC1C,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE;YACpD,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE;YAC/B,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HttpTransport } from "../http.js";
|
|
2
|
+
/** An HTTP forward for a subdomain. */
|
|
3
|
+
export interface Forward {
|
|
4
|
+
host: string;
|
|
5
|
+
frame: boolean;
|
|
6
|
+
url: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class ForwardsResource {
|
|
9
|
+
private readonly transport;
|
|
10
|
+
constructor(transport: HttpTransport);
|
|
11
|
+
/** Lists all HTTP forwards for a domain. */
|
|
12
|
+
list(domainId: number): Promise<Forward[]>;
|
|
13
|
+
/** Retrieves the HTTP forward for a specific host. */
|
|
14
|
+
get(domainId: number, host: string): Promise<Forward>;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new HTTP forward.
|
|
17
|
+
*
|
|
18
|
+
* The API answers 201 with an empty body, naming the new forward only in
|
|
19
|
+
* the Location header, so the result is the submitted forward with its
|
|
20
|
+
* host taken from that header when present.
|
|
21
|
+
*/
|
|
22
|
+
create(domainId: number, forward: Forward): Promise<Forward>;
|
|
23
|
+
/** Updates an existing HTTP forward. */
|
|
24
|
+
update(domainId: number, host: string, forward: Forward): Promise<Forward>;
|
|
25
|
+
/** Deletes an HTTP forward. */
|
|
26
|
+
delete(domainId: number, host: string): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=forwards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forwards.d.ts","sourceRoot":"","sources":["../../../src/domeneshop/resources/forwards.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,uCAAuC;AACvC,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,aAAa;IAErD,4CAA4C;IACtC,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAQhD,sDAAsD;IAChD,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK3D;;;;;;OAMG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAUlE,wCAAwC;IAClC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAOhF,+BAA+B;IACzB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG5D"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { assertDefined } from "../assert.js";
|
|
2
|
+
export class ForwardsResource {
|
|
3
|
+
transport;
|
|
4
|
+
constructor(transport) {
|
|
5
|
+
this.transport = transport;
|
|
6
|
+
}
|
|
7
|
+
/** Lists all HTTP forwards for a domain. */
|
|
8
|
+
async list(domainId) {
|
|
9
|
+
const { data } = await this.transport.request("GET", `/domains/${String(domainId)}/forwards/`);
|
|
10
|
+
return data ?? [];
|
|
11
|
+
}
|
|
12
|
+
/** Retrieves the HTTP forward for a specific host. */
|
|
13
|
+
async get(domainId, host) {
|
|
14
|
+
const { data } = await this.transport.request("GET", forwardPath(domainId, host));
|
|
15
|
+
return assertDefined(data, "domeneshop: empty response for forward");
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new HTTP forward.
|
|
19
|
+
*
|
|
20
|
+
* The API answers 201 with an empty body, naming the new forward only in
|
|
21
|
+
* the Location header, so the result is the submitted forward with its
|
|
22
|
+
* host taken from that header when present.
|
|
23
|
+
*/
|
|
24
|
+
async create(domainId, forward) {
|
|
25
|
+
const { headers } = await this.transport.request("POST", `/domains/${String(domainId)}/forwards/`, { body: forward });
|
|
26
|
+
const host = hostFromLocation(headers.get("Location"));
|
|
27
|
+
return host !== undefined ? { ...forward, host } : forward;
|
|
28
|
+
}
|
|
29
|
+
/** Updates an existing HTTP forward. */
|
|
30
|
+
async update(domainId, host, forward) {
|
|
31
|
+
const { data } = await this.transport.request("PUT", forwardPath(domainId, host), {
|
|
32
|
+
body: forward,
|
|
33
|
+
});
|
|
34
|
+
return assertDefined(data, "domeneshop: empty response for updated forward");
|
|
35
|
+
}
|
|
36
|
+
/** Deletes an HTTP forward. */
|
|
37
|
+
async delete(domainId, host) {
|
|
38
|
+
await this.transport.request("DELETE", forwardPath(domainId, host));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/** Builds the path for a single forward. The host is escaped: it reaches the URL as a path segment. */
|
|
42
|
+
function forwardPath(domainId, host) {
|
|
43
|
+
return `/domains/${String(domainId)}/forwards/${encodeURIComponent(host)}`;
|
|
44
|
+
}
|
|
45
|
+
/** Extracts the forward host from a Location header, which points at the created forward's own URL. */
|
|
46
|
+
function hostFromLocation(location) {
|
|
47
|
+
if (!location) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
const segment = location.slice(location.lastIndexOf("/") + 1);
|
|
51
|
+
try {
|
|
52
|
+
return decodeURIComponent(segment) || undefined;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return segment || undefined;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=forwards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forwards.js","sourceRoot":"","sources":["../../../src/domeneshop/resources/forwards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAU7C,MAAM,OAAO,gBAAgB;IACE;IAA7B,YAA6B,SAAwB;QAAxB,cAAS,GAAT,SAAS,CAAe;IAAG,CAAC;IAEzD,4CAA4C;IAC5C,KAAK,CAAC,IAAI,CAAC,QAAgB;QACzB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAC3C,KAAK,EACL,YAAY,MAAM,CAAC,QAAQ,CAAC,YAAY,CACzC,CAAC;QACF,OAAO,IAAI,IAAI,EAAE,CAAC;IACpB,CAAC;IAED,sDAAsD;IACtD,KAAK,CAAC,GAAG,CAAC,QAAgB,EAAE,IAAY;QACtC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAU,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;QAC3F,OAAO,aAAa,CAAC,IAAI,EAAE,wCAAwC,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,OAAgB;QAC7C,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAC9C,MAAM,EACN,YAAY,MAAM,CAAC,QAAQ,CAAC,YAAY,EACxC,EAAE,IAAI,EAAE,OAAO,EAAE,CAClB,CAAC;QACF,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;QACvD,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IAC7D,CAAC;IAED,wCAAwC;IACxC,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,IAAY,EAAE,OAAgB;QAC3D,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAU,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE;YACzF,IAAI,EAAE,OAAO;SACd,CAAC,CAAC;QACH,OAAO,aAAa,CAAC,IAAI,EAAE,gDAAgD,CAAC,CAAC;IAC/E,CAAC;IAED,+BAA+B;IAC/B,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,IAAY;QACzC,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IACtE,CAAC;CACF;AAED,uGAAuG;AACvG,SAAS,WAAW,CAAC,QAAgB,EAAE,IAAY;IACjD,OAAO,YAAY,MAAM,CAAC,QAAQ,CAAC,aAAa,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;AAC7E,CAAC;AAED,uGAAuG;AACvG,SAAS,gBAAgB,CAAC,QAAuB;IAC/C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9D,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,IAAI,SAAS,CAAC;IAC9B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { HttpTransport } from "../http.js";
|
|
2
|
+
/** The accepted values for the ListInvoices status filter. "settled" applies only to credit notes. */
|
|
3
|
+
export declare const INVOICE_STATUSES: readonly ["unpaid", "paid", "settled"];
|
|
4
|
+
export type InvoiceStatus = (typeof INVOICE_STATUSES)[number];
|
|
5
|
+
export interface Invoice {
|
|
6
|
+
id: number;
|
|
7
|
+
type: string;
|
|
8
|
+
amount: number;
|
|
9
|
+
currency: string;
|
|
10
|
+
due_date: string;
|
|
11
|
+
issued_date: string;
|
|
12
|
+
paid_date: string;
|
|
13
|
+
status: string;
|
|
14
|
+
url: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class InvoicesResource {
|
|
17
|
+
private readonly transport;
|
|
18
|
+
constructor(transport: HttpTransport);
|
|
19
|
+
/**
|
|
20
|
+
* Lists invoices from the past three years, optionally filtered by status.
|
|
21
|
+
*
|
|
22
|
+
* The status query parameter is missing from the published OpenAPI spec
|
|
23
|
+
* but is supported; Domeneshop's own JavaScript client relies on it. See
|
|
24
|
+
* https://github.com/domeneshop/domeneshop.js (src/lib/invoices.ts).
|
|
25
|
+
*/
|
|
26
|
+
list(status?: string): Promise<Invoice[]>;
|
|
27
|
+
/** Retrieves a single invoice. */
|
|
28
|
+
get(invoiceId: number): Promise<Invoice>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=invoices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoices.d.ts","sourceRoot":"","sources":["../../../src/domeneshop/resources/invoices.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,sGAAsG;AACtG,eAAO,MAAM,gBAAgB,wCAAyC,CAAC;AAEvE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,aAAa;IAErD;;;;;;OAMG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAO/C,kCAAkC;IAC5B,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAI/C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { assertDefined } from "../assert.js";
|
|
2
|
+
/** The accepted values for the ListInvoices status filter. "settled" applies only to credit notes. */
|
|
3
|
+
export const INVOICE_STATUSES = ["unpaid", "paid", "settled"];
|
|
4
|
+
export class InvoicesResource {
|
|
5
|
+
transport;
|
|
6
|
+
constructor(transport) {
|
|
7
|
+
this.transport = transport;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Lists invoices from the past three years, optionally filtered by status.
|
|
11
|
+
*
|
|
12
|
+
* The status query parameter is missing from the published OpenAPI spec
|
|
13
|
+
* but is supported; Domeneshop's own JavaScript client relies on it. See
|
|
14
|
+
* https://github.com/domeneshop/domeneshop.js (src/lib/invoices.ts).
|
|
15
|
+
*/
|
|
16
|
+
async list(status) {
|
|
17
|
+
const { data } = await this.transport.request("GET", "/invoices", {
|
|
18
|
+
query: { status },
|
|
19
|
+
});
|
|
20
|
+
return data ?? [];
|
|
21
|
+
}
|
|
22
|
+
/** Retrieves a single invoice. */
|
|
23
|
+
async get(invoiceId) {
|
|
24
|
+
const { data } = await this.transport.request("GET", `/invoices/${String(invoiceId)}`);
|
|
25
|
+
return assertDefined(data, "domeneshop: empty response for invoice");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=invoices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../../src/domeneshop/resources/invoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,sGAAsG;AACtG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAgBvE,MAAM,OAAO,gBAAgB;IACE;IAA7B,YAA6B,SAAwB;QAAxB,cAAS,GAAT,SAAS,CAAe;IAAG,CAAC;IAEzD;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,MAAe;QACxB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAY,KAAK,EAAE,WAAW,EAAE;YAC3E,KAAK,EAAE,EAAE,MAAM,EAAE;SAClB,CAAC,CAAC;QACH,OAAO,IAAI,IAAI,EAAE,CAAC;IACpB,CAAC;IAED,kCAAkC;IAClC,KAAK,CAAC,GAAG,CAAC,SAAiB;QACzB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAU,KAAK,EAAE,aAAa,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAChG,OAAO,aAAa,CAAC,IAAI,EAAE,wCAAwC,CAAC,CAAC;IACvE,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { DomeneshopClient } from "./domeneshop/index.js";
|
|
4
|
+
import { createServer } from "./mcp/index.js";
|
|
5
|
+
import { VERSION } from "./version.js";
|
|
6
|
+
async function main() {
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
if (args.includes("--version") || args.includes("-version")) {
|
|
9
|
+
console.log(`domeneshop-mcp ${VERSION}`);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const token = process.env["DOMENESHOP_API_TOKEN"];
|
|
13
|
+
const secret = process.env["DOMENESHOP_API_SECRET"];
|
|
14
|
+
if (!token || !secret) {
|
|
15
|
+
console.error("DOMENESHOP_API_TOKEN and DOMENESHOP_API_SECRET must be set " +
|
|
16
|
+
"(create credentials at https://www.domeneshop.no/admin?view=api)");
|
|
17
|
+
process.exitCode = 1;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const client = new DomeneshopClient(token, secret);
|
|
21
|
+
const server = createServer(client);
|
|
22
|
+
const transport = new StdioServerTransport();
|
|
23
|
+
await server.connect(transport);
|
|
24
|
+
}
|
|
25
|
+
main().catch((error) => {
|
|
26
|
+
console.error("domeneshop-mcp:", error instanceof Error ? error.message : error);
|
|
27
|
+
process.exitCode = 1;
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,KAAK,UAAU,IAAI;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAC;QACzC,OAAO;IACT,CAAC;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACpD,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;QACtB,OAAO,CAAC,KAAK,CACX,6DAA6D;YAC3D,kEAAkE,CACrE,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACrB,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACjF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ToolAnnotations } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Annotation presets. The MCP spec treats these as hints clients use to
|
|
4
|
+
* decide what may run without asking the user, so every tool declares them
|
|
5
|
+
* explicitly instead of relying on defaults.
|
|
6
|
+
*/
|
|
7
|
+
/** Marks a tool that only reads state. */
|
|
8
|
+
export declare function readOnly(): ToolAnnotations;
|
|
9
|
+
/** Marks a tool that creates new state without replacing any. */
|
|
10
|
+
export declare function additive(): ToolAnnotations;
|
|
11
|
+
/** Marks a tool that overwrites or removes existing state. Repeating the same call leaves the same result, hence idempotent. */
|
|
12
|
+
export declare function destructive(): ToolAnnotations;
|
|
13
|
+
//# sourceMappingURL=annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../src/mcp/annotations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAE1E;;;;GAIG;AAEH,0CAA0C;AAC1C,wBAAgB,QAAQ,IAAI,eAAe,CAE1C;AAED,iEAAiE;AACjE,wBAAgB,QAAQ,IAAI,eAAe,CAE1C;AAED,gIAAgI;AAChI,wBAAgB,WAAW,IAAI,eAAe,CAE7C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Annotation presets. The MCP spec treats these as hints clients use to
|
|
3
|
+
* decide what may run without asking the user, so every tool declares them
|
|
4
|
+
* explicitly instead of relying on defaults.
|
|
5
|
+
*/
|
|
6
|
+
/** Marks a tool that only reads state. */
|
|
7
|
+
export function readOnly() {
|
|
8
|
+
return { readOnlyHint: true, idempotentHint: true };
|
|
9
|
+
}
|
|
10
|
+
/** Marks a tool that creates new state without replacing any. */
|
|
11
|
+
export function additive() {
|
|
12
|
+
return { destructiveHint: false };
|
|
13
|
+
}
|
|
14
|
+
/** Marks a tool that overwrites or removes existing state. Repeating the same call leaves the same result, hence idempotent. */
|
|
15
|
+
export function destructive() {
|
|
16
|
+
return { destructiveHint: true, idempotentHint: true };
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.js","sourceRoot":"","sources":["../../src/mcp/annotations.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,0CAA0C;AAC1C,MAAM,UAAU,QAAQ;IACtB,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;AACtD,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,QAAQ;IACtB,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;AACpC,CAAC;AAED,gIAAgI;AAChI,MAAM,UAAU,WAAW;IACzB,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
/** Marshals value as indented JSON and returns it as a tool text result. */
|
|
3
|
+
export declare function jsonResult(value: unknown): CallToolResult;
|
|
4
|
+
/** Wraps a plain string as a tool text result. */
|
|
5
|
+
export declare function textResult(text: string): CallToolResult;
|
|
6
|
+
/** Wraps an error as a failed tool result, per the MCP convention of reporting tool failures via `isError`. */
|
|
7
|
+
export declare function errorResult(error: unknown): CallToolResult;
|
|
8
|
+
//# sourceMappingURL=result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../src/mcp/result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,4EAA4E;AAC5E,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAEzD;AAED,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAEvD;AAED,+GAA+G;AAC/G,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAK1D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Marshals value as indented JSON and returns it as a tool text result. */
|
|
2
|
+
export function jsonResult(value) {
|
|
3
|
+
return textResult(JSON.stringify(value, null, 2));
|
|
4
|
+
}
|
|
5
|
+
/** Wraps a plain string as a tool text result. */
|
|
6
|
+
export function textResult(text) {
|
|
7
|
+
return { content: [{ type: "text", text }] };
|
|
8
|
+
}
|
|
9
|
+
/** Wraps an error as a failed tool result, per the MCP convention of reporting tool failures via `isError`. */
|
|
10
|
+
export function errorResult(error) {
|
|
11
|
+
return {
|
|
12
|
+
content: [{ type: "text", text: error instanceof Error ? error.message : String(error) }],
|
|
13
|
+
isError: true,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/mcp/result.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAC/C,CAAC;AAED,+GAA+G;AAC/G,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACzF,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/mcp/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,wGAAwG;AACxG,MAAM,MAAM,UAAU,CAAC,KAAK,SAAS,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/mcp/schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { DomeneshopClient } from "../domeneshop/index.js";
|
|
3
|
+
/** Creates an MCP server with all Domeneshop tools registered. */
|
|
4
|
+
export declare function createServer(client: DomeneshopClient): McpServer;
|
|
5
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAQ/D,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAUhE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { VERSION } from "../version.js";
|
|
3
|
+
import { registerDNSTools } from "./tools/dns.js";
|
|
4
|
+
import { registerDomainTools } from "./tools/domains.js";
|
|
5
|
+
import { registerDynDNSTools } from "./tools/dyndns.js";
|
|
6
|
+
import { registerForwardTools } from "./tools/forwards.js";
|
|
7
|
+
import { registerInvoiceTools } from "./tools/invoices.js";
|
|
8
|
+
/** Creates an MCP server with all Domeneshop tools registered. */
|
|
9
|
+
export function createServer(client) {
|
|
10
|
+
const server = new McpServer({ name: "domeneshop-mcp", version: VERSION });
|
|
11
|
+
registerDomainTools(server, client);
|
|
12
|
+
registerDNSTools(server, client);
|
|
13
|
+
registerForwardTools(server, client);
|
|
14
|
+
registerDynDNSTools(server, client);
|
|
15
|
+
registerInvoiceTools(server, client);
|
|
16
|
+
return server;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,kEAAkE;AAClE,MAAM,UAAU,YAAY,CAAC,MAAwB;IACnD,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAE3E,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAErC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Wraps a tool handler so that a thrown error (a `DomeneshopApiError` or
|
|
4
|
+
* otherwise) becomes a failed tool result instead of an uncaught rejection.
|
|
5
|
+
*/
|
|
6
|
+
export declare function toolHandler<Args>(handler: (args: Args) => Promise<CallToolResult>): (args: Args) => Promise<CallToolResult>;
|
|
7
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/mcp/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGzE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAC9B,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,cAAc,CAAC,GAC/C,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,cAAc,CAAC,CAQzC"}
|
package/dist/mcp/tool.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { errorResult } from "./result.js";
|
|
2
|
+
/**
|
|
3
|
+
* Wraps a tool handler so that a thrown error (a `DomeneshopApiError` or
|
|
4
|
+
* otherwise) becomes a failed tool result instead of an uncaught rejection.
|
|
5
|
+
*/
|
|
6
|
+
export function toolHandler(handler) {
|
|
7
|
+
return async (args) => {
|
|
8
|
+
try {
|
|
9
|
+
return await handler(args);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
return errorResult(error);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/mcp/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,OAAgD;IAEhD,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dns.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/dns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAa,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AA4H7E,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAqElF"}
|