@hasna/microservices 0.0.16 → 0.0.17
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 +143 -23
- package/bin/index.js +711 -13998
- package/bin/mcp.js +228 -10987
- package/dist/index.js +166 -10056
- package/package.json +25 -25
- package/microservices/microservice-ads/package.json +0 -28
- package/microservices/microservice-ads/src/cli/index.ts +0 -605
- package/microservices/microservice-ads/src/db/campaigns.ts +0 -797
- package/microservices/microservice-ads/src/db/database.ts +0 -91
- package/microservices/microservice-ads/src/db/migrations.ts +0 -60
- package/microservices/microservice-ads/src/index.ts +0 -39
- package/microservices/microservice-ads/src/mcp/index.ts +0 -480
- package/microservices/microservice-analytics/package.json +0 -28
- package/microservices/microservice-analytics/src/cli/index.ts +0 -373
- package/microservices/microservice-analytics/src/db/analytics.ts +0 -564
- package/microservices/microservice-analytics/src/db/database.ts +0 -91
- package/microservices/microservice-analytics/src/db/migrations.ts +0 -50
- package/microservices/microservice-analytics/src/index.ts +0 -37
- package/microservices/microservice-analytics/src/mcp/index.ts +0 -334
- package/microservices/microservice-assets/package.json +0 -28
- package/microservices/microservice-assets/src/cli/index.ts +0 -375
- package/microservices/microservice-assets/src/db/assets.ts +0 -370
- package/microservices/microservice-assets/src/db/database.ts +0 -91
- package/microservices/microservice-assets/src/db/migrations.ts +0 -51
- package/microservices/microservice-assets/src/index.ts +0 -32
- package/microservices/microservice-assets/src/mcp/index.ts +0 -346
- package/microservices/microservice-bookkeeping/package.json +0 -28
- package/microservices/microservice-bookkeeping/src/cli/index.ts +0 -386
- package/microservices/microservice-bookkeeping/src/db/bookkeeping.ts +0 -591
- package/microservices/microservice-bookkeeping/src/db/database.ts +0 -91
- package/microservices/microservice-bookkeeping/src/db/migrations.ts +0 -52
- package/microservices/microservice-bookkeeping/src/index.ts +0 -32
- package/microservices/microservice-bookkeeping/src/mcp/index.ts +0 -284
- package/microservices/microservice-calendar/package.json +0 -28
- package/microservices/microservice-calendar/src/cli/index.ts +0 -287
- package/microservices/microservice-calendar/src/db/calendar.ts +0 -328
- package/microservices/microservice-calendar/src/db/database.ts +0 -91
- package/microservices/microservice-calendar/src/db/migrations.ts +0 -47
- package/microservices/microservice-calendar/src/index.ts +0 -24
- package/microservices/microservice-calendar/src/mcp/index.ts +0 -226
- package/microservices/microservice-company/package.json +0 -28
- package/microservices/microservice-company/src/cli/index.ts +0 -1126
- package/microservices/microservice-company/src/db/company.ts +0 -854
- package/microservices/microservice-company/src/db/database.ts +0 -91
- package/microservices/microservice-company/src/db/migrations.ts +0 -214
- package/microservices/microservice-company/src/db/workflow-migrations.ts +0 -44
- package/microservices/microservice-company/src/index.ts +0 -60
- package/microservices/microservice-company/src/lib/audit.ts +0 -168
- package/microservices/microservice-company/src/lib/finance.ts +0 -299
- package/microservices/microservice-company/src/lib/settings.ts +0 -85
- package/microservices/microservice-company/src/lib/workflows.ts +0 -698
- package/microservices/microservice-company/src/mcp/index.ts +0 -991
- package/microservices/microservice-compliance/package.json +0 -28
- package/microservices/microservice-compliance/src/cli/index.ts +0 -467
- package/microservices/microservice-compliance/src/db/compliance.ts +0 -633
- package/microservices/microservice-compliance/src/db/database.ts +0 -91
- package/microservices/microservice-compliance/src/db/migrations.ts +0 -63
- package/microservices/microservice-compliance/src/index.ts +0 -46
- package/microservices/microservice-compliance/src/mcp/index.ts +0 -438
- package/microservices/microservice-contacts/package.json +0 -28
- package/microservices/microservice-contacts/src/cli/index.ts +0 -393
- package/microservices/microservice-contacts/src/db/companies.ts +0 -167
- package/microservices/microservice-contacts/src/db/contacts.ts +0 -249
- package/microservices/microservice-contacts/src/db/database.ts +0 -91
- package/microservices/microservice-contacts/src/db/migrations.ts +0 -71
- package/microservices/microservice-contacts/src/db/relationships.ts +0 -53
- package/microservices/microservice-contacts/src/index.ts +0 -42
- package/microservices/microservice-contacts/src/mcp/index.ts +0 -303
- package/microservices/microservice-contracts/package.json +0 -28
- package/microservices/microservice-contracts/src/cli/index.ts +0 -770
- package/microservices/microservice-contracts/src/db/contracts.ts +0 -925
- package/microservices/microservice-contracts/src/db/database.ts +0 -91
- package/microservices/microservice-contracts/src/db/migrations.ts +0 -141
- package/microservices/microservice-contracts/src/index.ts +0 -43
- package/microservices/microservice-contracts/src/mcp/index.ts +0 -617
- package/microservices/microservice-crm/package.json +0 -28
- package/microservices/microservice-crm/src/cli/index.ts +0 -396
- package/microservices/microservice-crm/src/db/database.ts +0 -91
- package/microservices/microservice-crm/src/db/migrations.ts +0 -66
- package/microservices/microservice-crm/src/db/pipeline.ts +0 -397
- package/microservices/microservice-crm/src/index.ts +0 -34
- package/microservices/microservice-crm/src/mcp/index.ts +0 -294
- package/microservices/microservice-documents/package.json +0 -28
- package/microservices/microservice-documents/src/cli/index.ts +0 -246
- package/microservices/microservice-documents/src/db/database.ts +0 -91
- package/microservices/microservice-documents/src/db/documents.ts +0 -316
- package/microservices/microservice-documents/src/db/migrations.ts +0 -49
- package/microservices/microservice-documents/src/index.ts +0 -24
- package/microservices/microservice-documents/src/mcp/index.ts +0 -202
- package/microservices/microservice-domains/package.json +0 -28
- package/microservices/microservice-domains/src/cli/index.ts +0 -1111
- package/microservices/microservice-domains/src/db/database.ts +0 -91
- package/microservices/microservice-domains/src/db/domains.ts +0 -1164
- package/microservices/microservice-domains/src/db/migrations.ts +0 -60
- package/microservices/microservice-domains/src/index.ts +0 -65
- package/microservices/microservice-domains/src/lib/brandsight.ts +0 -350
- package/microservices/microservice-domains/src/lib/godaddy.ts +0 -338
- package/microservices/microservice-domains/src/lib/namecheap.ts +0 -262
- package/microservices/microservice-domains/src/lib/registrar.ts +0 -355
- package/microservices/microservice-domains/src/mcp/index.ts +0 -781
- package/microservices/microservice-expenses/package.json +0 -28
- package/microservices/microservice-expenses/src/cli/index.ts +0 -267
- package/microservices/microservice-expenses/src/db/database.ts +0 -91
- package/microservices/microservice-expenses/src/db/expenses.ts +0 -345
- package/microservices/microservice-expenses/src/db/migrations.ts +0 -45
- package/microservices/microservice-expenses/src/index.ts +0 -25
- package/microservices/microservice-expenses/src/mcp/index.ts +0 -196
- package/microservices/microservice-habits/package.json +0 -28
- package/microservices/microservice-habits/src/cli/index.ts +0 -315
- package/microservices/microservice-habits/src/db/database.ts +0 -91
- package/microservices/microservice-habits/src/db/habits.ts +0 -451
- package/microservices/microservice-habits/src/db/migrations.ts +0 -46
- package/microservices/microservice-habits/src/index.ts +0 -31
- package/microservices/microservice-habits/src/mcp/index.ts +0 -313
- package/microservices/microservice-health/package.json +0 -28
- package/microservices/microservice-health/src/cli/index.ts +0 -484
- package/microservices/microservice-health/src/db/database.ts +0 -91
- package/microservices/microservice-health/src/db/health.ts +0 -708
- package/microservices/microservice-health/src/db/migrations.ts +0 -70
- package/microservices/microservice-health/src/index.ts +0 -63
- package/microservices/microservice-health/src/mcp/index.ts +0 -437
- package/microservices/microservice-hiring/package.json +0 -28
- package/microservices/microservice-hiring/src/cli/index.ts +0 -741
- package/microservices/microservice-hiring/src/db/database.ts +0 -91
- package/microservices/microservice-hiring/src/db/hiring.ts +0 -1085
- package/microservices/microservice-hiring/src/db/migrations.ts +0 -89
- package/microservices/microservice-hiring/src/index.ts +0 -80
- package/microservices/microservice-hiring/src/lib/scoring.ts +0 -206
- package/microservices/microservice-hiring/src/mcp/index.ts +0 -709
- package/microservices/microservice-inventory/package.json +0 -28
- package/microservices/microservice-inventory/src/cli/index.ts +0 -365
- package/microservices/microservice-inventory/src/db/database.ts +0 -91
- package/microservices/microservice-inventory/src/db/inventory.ts +0 -393
- package/microservices/microservice-inventory/src/db/migrations.ts +0 -54
- package/microservices/microservice-inventory/src/index.ts +0 -28
- package/microservices/microservice-inventory/src/mcp/index.ts +0 -250
- package/microservices/microservice-invoices/dashboard/index.html +0 -12
- package/microservices/microservice-invoices/dashboard/package.json +0 -29
- package/microservices/microservice-invoices/dashboard/tsconfig.json +0 -14
- package/microservices/microservice-invoices/dashboard/vite.config.ts +0 -15
- package/microservices/microservice-invoices/package.json +0 -31
- package/microservices/microservice-invoices/src/cli/index.ts +0 -308
- package/microservices/microservice-invoices/src/db/business.ts +0 -241
- package/microservices/microservice-invoices/src/db/clients.ts +0 -127
- package/microservices/microservice-invoices/src/db/database.ts +0 -91
- package/microservices/microservice-invoices/src/db/invoices.ts +0 -345
- package/microservices/microservice-invoices/src/db/migrations.ts +0 -184
- package/microservices/microservice-invoices/src/index.ts +0 -56
- package/microservices/microservice-invoices/src/mcp/index.ts +0 -242
- package/microservices/microservice-invoices/src/server/index.ts +0 -162
- package/microservices/microservice-leads/package.json +0 -28
- package/microservices/microservice-leads/src/cli/index.ts +0 -596
- package/microservices/microservice-leads/src/db/database.ts +0 -91
- package/microservices/microservice-leads/src/db/leads.ts +0 -520
- package/microservices/microservice-leads/src/db/lists.ts +0 -151
- package/microservices/microservice-leads/src/db/migrations.ts +0 -93
- package/microservices/microservice-leads/src/index.ts +0 -65
- package/microservices/microservice-leads/src/lib/enrichment.ts +0 -202
- package/microservices/microservice-leads/src/lib/scoring.ts +0 -134
- package/microservices/microservice-leads/src/mcp/index.ts +0 -533
- package/microservices/microservice-notes/package.json +0 -28
- package/microservices/microservice-notes/src/cli/index.ts +0 -63
- package/microservices/microservice-notes/src/db/database.ts +0 -91
- package/microservices/microservice-notes/src/db/migrations.ts +0 -40
- package/microservices/microservice-notes/src/db/notes.ts +0 -114
- package/microservices/microservice-notes/src/index.ts +0 -2
- package/microservices/microservice-notes/src/mcp/index.ts +0 -37
- package/microservices/microservice-notifications/package.json +0 -28
- package/microservices/microservice-notifications/src/cli/index.ts +0 -349
- package/microservices/microservice-notifications/src/db/database.ts +0 -91
- package/microservices/microservice-notifications/src/db/migrations.ts +0 -62
- package/microservices/microservice-notifications/src/db/notifications.ts +0 -509
- package/microservices/microservice-notifications/src/index.ts +0 -41
- package/microservices/microservice-notifications/src/mcp/index.ts +0 -422
- package/microservices/microservice-payments/package.json +0 -28
- package/microservices/microservice-payments/src/cli/index.ts +0 -609
- package/microservices/microservice-payments/src/db/database.ts +0 -91
- package/microservices/microservice-payments/src/db/migrations.ts +0 -81
- package/microservices/microservice-payments/src/db/payments.ts +0 -1204
- package/microservices/microservice-payments/src/index.ts +0 -51
- package/microservices/microservice-payments/src/mcp/index.ts +0 -683
- package/microservices/microservice-payroll/package.json +0 -28
- package/microservices/microservice-payroll/src/cli/index.ts +0 -643
- package/microservices/microservice-payroll/src/db/database.ts +0 -91
- package/microservices/microservice-payroll/src/db/migrations.ts +0 -95
- package/microservices/microservice-payroll/src/db/payroll.ts +0 -1377
- package/microservices/microservice-payroll/src/index.ts +0 -48
- package/microservices/microservice-payroll/src/mcp/index.ts +0 -666
- package/microservices/microservice-products/package.json +0 -28
- package/microservices/microservice-products/src/cli/index.ts +0 -416
- package/microservices/microservice-products/src/db/categories.ts +0 -154
- package/microservices/microservice-products/src/db/database.ts +0 -91
- package/microservices/microservice-products/src/db/migrations.ts +0 -58
- package/microservices/microservice-products/src/db/pricing-tiers.ts +0 -66
- package/microservices/microservice-products/src/db/products.ts +0 -452
- package/microservices/microservice-products/src/index.ts +0 -53
- package/microservices/microservice-products/src/mcp/index.ts +0 -453
- package/microservices/microservice-projects/package.json +0 -28
- package/microservices/microservice-projects/src/cli/index.ts +0 -480
- package/microservices/microservice-projects/src/db/database.ts +0 -91
- package/microservices/microservice-projects/src/db/migrations.ts +0 -65
- package/microservices/microservice-projects/src/db/projects.ts +0 -715
- package/microservices/microservice-projects/src/index.ts +0 -57
- package/microservices/microservice-projects/src/mcp/index.ts +0 -501
- package/microservices/microservice-proposals/package.json +0 -28
- package/microservices/microservice-proposals/src/cli/index.ts +0 -400
- package/microservices/microservice-proposals/src/db/database.ts +0 -91
- package/microservices/microservice-proposals/src/db/migrations.ts +0 -52
- package/microservices/microservice-proposals/src/db/proposals.ts +0 -532
- package/microservices/microservice-proposals/src/index.ts +0 -37
- package/microservices/microservice-proposals/src/mcp/index.ts +0 -375
- package/microservices/microservice-reading/package.json +0 -28
- package/microservices/microservice-reading/src/cli/index.ts +0 -464
- package/microservices/microservice-reading/src/db/database.ts +0 -91
- package/microservices/microservice-reading/src/db/migrations.ts +0 -59
- package/microservices/microservice-reading/src/db/reading.ts +0 -524
- package/microservices/microservice-reading/src/index.ts +0 -51
- package/microservices/microservice-reading/src/mcp/index.ts +0 -368
- package/microservices/microservice-shipping/package.json +0 -28
- package/microservices/microservice-shipping/src/cli/index.ts +0 -606
- package/microservices/microservice-shipping/src/db/database.ts +0 -91
- package/microservices/microservice-shipping/src/db/migrations.ts +0 -69
- package/microservices/microservice-shipping/src/db/shipping.ts +0 -1093
- package/microservices/microservice-shipping/src/index.ts +0 -53
- package/microservices/microservice-shipping/src/mcp/index.ts +0 -533
- package/microservices/microservice-social/package.json +0 -29
- package/microservices/microservice-social/src/cli/index.ts +0 -1583
- package/microservices/microservice-social/src/db/database.ts +0 -91
- package/microservices/microservice-social/src/db/migrations.ts +0 -160
- package/microservices/microservice-social/src/db/social.ts +0 -1076
- package/microservices/microservice-social/src/index.ts +0 -46
- package/microservices/microservice-social/src/lib/audience.ts +0 -353
- package/microservices/microservice-social/src/lib/content-ai.ts +0 -278
- package/microservices/microservice-social/src/lib/media.ts +0 -311
- package/microservices/microservice-social/src/lib/mentions.ts +0 -434
- package/microservices/microservice-social/src/lib/metrics-sync.ts +0 -264
- package/microservices/microservice-social/src/lib/publisher.ts +0 -377
- package/microservices/microservice-social/src/lib/scheduler.ts +0 -229
- package/microservices/microservice-social/src/lib/sentiment.ts +0 -256
- package/microservices/microservice-social/src/lib/threads.ts +0 -291
- package/microservices/microservice-social/src/mcp/index.ts +0 -1425
- package/microservices/microservice-social/src/server/index.ts +0 -441
- package/microservices/microservice-subscriptions/package.json +0 -28
- package/microservices/microservice-subscriptions/src/cli/index.ts +0 -715
- package/microservices/microservice-subscriptions/src/db/database.ts +0 -91
- package/microservices/microservice-subscriptions/src/db/migrations.ts +0 -125
- package/microservices/microservice-subscriptions/src/db/subscriptions.ts +0 -1256
- package/microservices/microservice-subscriptions/src/index.ts +0 -41
- package/microservices/microservice-subscriptions/src/mcp/index.ts +0 -631
- package/microservices/microservice-timesheets/package.json +0 -28
- package/microservices/microservice-timesheets/src/cli/index.ts +0 -373
- package/microservices/microservice-timesheets/src/db/database.ts +0 -91
- package/microservices/microservice-timesheets/src/db/locale.ts +0 -217
- package/microservices/microservice-timesheets/src/db/migrations.ts +0 -74
- package/microservices/microservice-timesheets/src/db/timesheets.ts +0 -447
- package/microservices/microservice-timesheets/src/index.ts +0 -44
- package/microservices/microservice-timesheets/src/mcp/index.ts +0 -269
- package/microservices/microservice-transcriber/package.json +0 -29
- package/microservices/microservice-transcriber/src/cli/index.ts +0 -1593
- package/microservices/microservice-transcriber/src/db/annotations.ts +0 -37
- package/microservices/microservice-transcriber/src/db/comments.ts +0 -166
- package/microservices/microservice-transcriber/src/db/database.ts +0 -91
- package/microservices/microservice-transcriber/src/db/migrations.ts +0 -118
- package/microservices/microservice-transcriber/src/db/proofread.ts +0 -119
- package/microservices/microservice-transcriber/src/db/transcripts.ts +0 -395
- package/microservices/microservice-transcriber/src/index.ts +0 -43
- package/microservices/microservice-transcriber/src/lib/config.ts +0 -77
- package/microservices/microservice-transcriber/src/lib/diff.ts +0 -91
- package/microservices/microservice-transcriber/src/lib/downloader.ts +0 -638
- package/microservices/microservice-transcriber/src/lib/feeds.ts +0 -62
- package/microservices/microservice-transcriber/src/lib/live.ts +0 -94
- package/microservices/microservice-transcriber/src/lib/notion.ts +0 -129
- package/microservices/microservice-transcriber/src/lib/proofread.ts +0 -296
- package/microservices/microservice-transcriber/src/lib/providers.ts +0 -713
- package/microservices/microservice-transcriber/src/lib/summarizer.ts +0 -147
- package/microservices/microservice-transcriber/src/lib/translator.ts +0 -75
- package/microservices/microservice-transcriber/src/lib/webhook.ts +0 -37
- package/microservices/microservice-transcriber/src/mcp/index.ts +0 -1330
- package/microservices/microservice-transcriber/src/server/index.ts +0 -199
- package/microservices/microservice-travel/package.json +0 -28
- package/microservices/microservice-travel/src/cli/index.ts +0 -505
- package/microservices/microservice-travel/src/db/database.ts +0 -91
- package/microservices/microservice-travel/src/db/migrations.ts +0 -77
- package/microservices/microservice-travel/src/db/travel.ts +0 -802
- package/microservices/microservice-travel/src/index.ts +0 -60
- package/microservices/microservice-travel/src/mcp/index.ts +0 -495
- package/microservices/microservice-wiki/package.json +0 -28
- package/microservices/microservice-wiki/src/cli/index.ts +0 -345
- package/microservices/microservice-wiki/src/db/database.ts +0 -91
- package/microservices/microservice-wiki/src/db/migrations.ts +0 -55
- package/microservices/microservice-wiki/src/db/wiki.ts +0 -395
- package/microservices/microservice-wiki/src/index.ts +0 -32
- package/microservices/microservice-wiki/src/mcp/index.ts +0 -344
|
@@ -1,781 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
import {
|
|
7
|
-
createDomain,
|
|
8
|
-
getDomain,
|
|
9
|
-
listDomains,
|
|
10
|
-
updateDomain,
|
|
11
|
-
deleteDomain,
|
|
12
|
-
countDomains,
|
|
13
|
-
searchDomains,
|
|
14
|
-
getByRegistrar,
|
|
15
|
-
listExpiring,
|
|
16
|
-
listSslExpiring,
|
|
17
|
-
getDomainStats,
|
|
18
|
-
createDnsRecord,
|
|
19
|
-
listDnsRecords,
|
|
20
|
-
updateDnsRecord,
|
|
21
|
-
deleteDnsRecord,
|
|
22
|
-
createAlert,
|
|
23
|
-
listAlerts,
|
|
24
|
-
deleteAlert,
|
|
25
|
-
whoisLookup,
|
|
26
|
-
checkDnsPropagation,
|
|
27
|
-
checkSsl,
|
|
28
|
-
exportZoneFile,
|
|
29
|
-
importZoneFile,
|
|
30
|
-
discoverSubdomains,
|
|
31
|
-
validateDns,
|
|
32
|
-
exportPortfolio,
|
|
33
|
-
checkAllDomains,
|
|
34
|
-
getDomainByName,
|
|
35
|
-
} from "../db/domains.js";
|
|
36
|
-
import {
|
|
37
|
-
syncToLocalDb,
|
|
38
|
-
renewDomain as namecheapRenew,
|
|
39
|
-
checkAvailability as namecheapCheck,
|
|
40
|
-
} from "../lib/namecheap.js";
|
|
41
|
-
import {
|
|
42
|
-
syncToLocalDb as godaddySyncToLocalDb,
|
|
43
|
-
renewDomain as godaddyRenewDomain,
|
|
44
|
-
} from "../lib/godaddy.js";
|
|
45
|
-
import {
|
|
46
|
-
getAvailableProviders,
|
|
47
|
-
syncAll,
|
|
48
|
-
} from "../lib/registrar.js";
|
|
49
|
-
import {
|
|
50
|
-
monitorBrand,
|
|
51
|
-
getSimilarDomains,
|
|
52
|
-
getThreatAssessment,
|
|
53
|
-
} from "../lib/brandsight.js";
|
|
54
|
-
|
|
55
|
-
const server = new McpServer({
|
|
56
|
-
name: "microservice-domains",
|
|
57
|
-
version: "0.0.1",
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// --- Domains ---
|
|
61
|
-
|
|
62
|
-
server.registerTool(
|
|
63
|
-
"create_domain",
|
|
64
|
-
{
|
|
65
|
-
title: "Create Domain",
|
|
66
|
-
description: "Add a new domain to the portfolio.",
|
|
67
|
-
inputSchema: {
|
|
68
|
-
name: z.string(),
|
|
69
|
-
registrar: z.string().optional(),
|
|
70
|
-
status: z.enum(["active", "expired", "transferring", "redemption"]).optional(),
|
|
71
|
-
registered_at: z.string().optional(),
|
|
72
|
-
expires_at: z.string().optional(),
|
|
73
|
-
auto_renew: z.boolean().optional(),
|
|
74
|
-
nameservers: z.array(z.string()).optional(),
|
|
75
|
-
ssl_expires_at: z.string().optional(),
|
|
76
|
-
ssl_issuer: z.string().optional(),
|
|
77
|
-
notes: z.string().optional(),
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
async (params) => {
|
|
81
|
-
const domain = createDomain(params);
|
|
82
|
-
return { content: [{ type: "text", text: JSON.stringify(domain, null, 2) }] };
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
server.registerTool(
|
|
87
|
-
"get_domain",
|
|
88
|
-
{
|
|
89
|
-
title: "Get Domain",
|
|
90
|
-
description: "Get a domain by ID.",
|
|
91
|
-
inputSchema: { id: z.string() },
|
|
92
|
-
},
|
|
93
|
-
async ({ id }) => {
|
|
94
|
-
const domain = getDomain(id);
|
|
95
|
-
if (!domain) {
|
|
96
|
-
return { content: [{ type: "text", text: `Domain '${id}' not found.` }], isError: true };
|
|
97
|
-
}
|
|
98
|
-
return { content: [{ type: "text", text: JSON.stringify(domain, null, 2) }] };
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
server.registerTool(
|
|
103
|
-
"list_domains",
|
|
104
|
-
{
|
|
105
|
-
title: "List Domains",
|
|
106
|
-
description: "List domains with optional filters.",
|
|
107
|
-
inputSchema: {
|
|
108
|
-
search: z.string().optional(),
|
|
109
|
-
status: z.enum(["active", "expired", "transferring", "redemption"]).optional(),
|
|
110
|
-
registrar: z.string().optional(),
|
|
111
|
-
limit: z.number().optional(),
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
async (params) => {
|
|
115
|
-
const domains = listDomains(params);
|
|
116
|
-
return {
|
|
117
|
-
content: [
|
|
118
|
-
{ type: "text", text: JSON.stringify({ domains, count: domains.length }, null, 2) },
|
|
119
|
-
],
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
server.registerTool(
|
|
125
|
-
"update_domain",
|
|
126
|
-
{
|
|
127
|
-
title: "Update Domain",
|
|
128
|
-
description: "Update an existing domain.",
|
|
129
|
-
inputSchema: {
|
|
130
|
-
id: z.string(),
|
|
131
|
-
name: z.string().optional(),
|
|
132
|
-
registrar: z.string().optional(),
|
|
133
|
-
status: z.enum(["active", "expired", "transferring", "redemption"]).optional(),
|
|
134
|
-
registered_at: z.string().optional(),
|
|
135
|
-
expires_at: z.string().optional(),
|
|
136
|
-
auto_renew: z.boolean().optional(),
|
|
137
|
-
nameservers: z.array(z.string()).optional(),
|
|
138
|
-
ssl_expires_at: z.string().optional(),
|
|
139
|
-
ssl_issuer: z.string().optional(),
|
|
140
|
-
notes: z.string().optional(),
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
async ({ id, ...input }) => {
|
|
144
|
-
const domain = updateDomain(id, input);
|
|
145
|
-
if (!domain) {
|
|
146
|
-
return { content: [{ type: "text", text: `Domain '${id}' not found.` }], isError: true };
|
|
147
|
-
}
|
|
148
|
-
return { content: [{ type: "text", text: JSON.stringify(domain, null, 2) }] };
|
|
149
|
-
}
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
server.registerTool(
|
|
153
|
-
"delete_domain",
|
|
154
|
-
{
|
|
155
|
-
title: "Delete Domain",
|
|
156
|
-
description: "Delete a domain by ID.",
|
|
157
|
-
inputSchema: { id: z.string() },
|
|
158
|
-
},
|
|
159
|
-
async ({ id }) => {
|
|
160
|
-
const deleted = deleteDomain(id);
|
|
161
|
-
return { content: [{ type: "text", text: JSON.stringify({ id, deleted }) }] };
|
|
162
|
-
}
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
server.registerTool(
|
|
166
|
-
"search_domains",
|
|
167
|
-
{
|
|
168
|
-
title: "Search Domains",
|
|
169
|
-
description: "Search domains by name, registrar, or notes.",
|
|
170
|
-
inputSchema: { query: z.string() },
|
|
171
|
-
},
|
|
172
|
-
async ({ query }) => {
|
|
173
|
-
const results = searchDomains(query);
|
|
174
|
-
return {
|
|
175
|
-
content: [
|
|
176
|
-
{ type: "text", text: JSON.stringify({ results, count: results.length }, null, 2) },
|
|
177
|
-
],
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
);
|
|
181
|
-
|
|
182
|
-
server.registerTool(
|
|
183
|
-
"count_domains",
|
|
184
|
-
{
|
|
185
|
-
title: "Count Domains",
|
|
186
|
-
description: "Get the total number of domains.",
|
|
187
|
-
inputSchema: {},
|
|
188
|
-
},
|
|
189
|
-
async () => {
|
|
190
|
-
const count = countDomains();
|
|
191
|
-
return { content: [{ type: "text", text: JSON.stringify({ count }) }] };
|
|
192
|
-
}
|
|
193
|
-
);
|
|
194
|
-
|
|
195
|
-
server.registerTool(
|
|
196
|
-
"list_expiring_domains",
|
|
197
|
-
{
|
|
198
|
-
title: "List Expiring Domains",
|
|
199
|
-
description: "List domains expiring within N days.",
|
|
200
|
-
inputSchema: { days: z.number().default(30) },
|
|
201
|
-
},
|
|
202
|
-
async ({ days }) => {
|
|
203
|
-
const domains = listExpiring(days);
|
|
204
|
-
return {
|
|
205
|
-
content: [
|
|
206
|
-
{ type: "text", text: JSON.stringify({ domains, count: domains.length }, null, 2) },
|
|
207
|
-
],
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
);
|
|
211
|
-
|
|
212
|
-
server.registerTool(
|
|
213
|
-
"list_ssl_expiring",
|
|
214
|
-
{
|
|
215
|
-
title: "List SSL Expiring",
|
|
216
|
-
description: "List domains with SSL certificates expiring within N days.",
|
|
217
|
-
inputSchema: { days: z.number().default(30) },
|
|
218
|
-
},
|
|
219
|
-
async ({ days }) => {
|
|
220
|
-
const domains = listSslExpiring(days);
|
|
221
|
-
return {
|
|
222
|
-
content: [
|
|
223
|
-
{ type: "text", text: JSON.stringify({ domains, count: domains.length }, null, 2) },
|
|
224
|
-
],
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
);
|
|
228
|
-
|
|
229
|
-
server.registerTool(
|
|
230
|
-
"get_domains_by_registrar",
|
|
231
|
-
{
|
|
232
|
-
title: "Get Domains by Registrar",
|
|
233
|
-
description: "List all domains from a specific registrar.",
|
|
234
|
-
inputSchema: { registrar: z.string() },
|
|
235
|
-
},
|
|
236
|
-
async ({ registrar }) => {
|
|
237
|
-
const domains = getByRegistrar(registrar);
|
|
238
|
-
return {
|
|
239
|
-
content: [
|
|
240
|
-
{ type: "text", text: JSON.stringify({ domains, count: domains.length }, null, 2) },
|
|
241
|
-
],
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
);
|
|
245
|
-
|
|
246
|
-
server.registerTool(
|
|
247
|
-
"get_domain_stats",
|
|
248
|
-
{
|
|
249
|
-
title: "Get Domain Stats",
|
|
250
|
-
description: "Get domain portfolio statistics.",
|
|
251
|
-
inputSchema: {},
|
|
252
|
-
},
|
|
253
|
-
async () => {
|
|
254
|
-
const stats = getDomainStats();
|
|
255
|
-
return { content: [{ type: "text", text: JSON.stringify(stats, null, 2) }] };
|
|
256
|
-
}
|
|
257
|
-
);
|
|
258
|
-
|
|
259
|
-
// --- DNS Records ---
|
|
260
|
-
|
|
261
|
-
server.registerTool(
|
|
262
|
-
"create_dns_record",
|
|
263
|
-
{
|
|
264
|
-
title: "Create DNS Record",
|
|
265
|
-
description: "Create a new DNS record for a domain.",
|
|
266
|
-
inputSchema: {
|
|
267
|
-
domain_id: z.string(),
|
|
268
|
-
type: z.enum(["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SRV"]),
|
|
269
|
-
name: z.string(),
|
|
270
|
-
value: z.string(),
|
|
271
|
-
ttl: z.number().optional(),
|
|
272
|
-
priority: z.number().optional(),
|
|
273
|
-
},
|
|
274
|
-
},
|
|
275
|
-
async (params) => {
|
|
276
|
-
const record = createDnsRecord(params);
|
|
277
|
-
return { content: [{ type: "text", text: JSON.stringify(record, null, 2) }] };
|
|
278
|
-
}
|
|
279
|
-
);
|
|
280
|
-
|
|
281
|
-
server.registerTool(
|
|
282
|
-
"list_dns_records",
|
|
283
|
-
{
|
|
284
|
-
title: "List DNS Records",
|
|
285
|
-
description: "List DNS records for a domain.",
|
|
286
|
-
inputSchema: {
|
|
287
|
-
domain_id: z.string(),
|
|
288
|
-
type: z.enum(["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SRV"]).optional(),
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
async ({ domain_id, type }) => {
|
|
292
|
-
const records = listDnsRecords(domain_id, type);
|
|
293
|
-
return {
|
|
294
|
-
content: [
|
|
295
|
-
{ type: "text", text: JSON.stringify({ records, count: records.length }, null, 2) },
|
|
296
|
-
],
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
);
|
|
300
|
-
|
|
301
|
-
server.registerTool(
|
|
302
|
-
"update_dns_record",
|
|
303
|
-
{
|
|
304
|
-
title: "Update DNS Record",
|
|
305
|
-
description: "Update a DNS record.",
|
|
306
|
-
inputSchema: {
|
|
307
|
-
id: z.string(),
|
|
308
|
-
type: z.enum(["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SRV"]).optional(),
|
|
309
|
-
name: z.string().optional(),
|
|
310
|
-
value: z.string().optional(),
|
|
311
|
-
ttl: z.number().optional(),
|
|
312
|
-
priority: z.number().optional(),
|
|
313
|
-
},
|
|
314
|
-
},
|
|
315
|
-
async ({ id, ...input }) => {
|
|
316
|
-
const record = updateDnsRecord(id, input);
|
|
317
|
-
if (!record) {
|
|
318
|
-
return { content: [{ type: "text", text: `DNS record '${id}' not found.` }], isError: true };
|
|
319
|
-
}
|
|
320
|
-
return { content: [{ type: "text", text: JSON.stringify(record, null, 2) }] };
|
|
321
|
-
}
|
|
322
|
-
);
|
|
323
|
-
|
|
324
|
-
server.registerTool(
|
|
325
|
-
"delete_dns_record",
|
|
326
|
-
{
|
|
327
|
-
title: "Delete DNS Record",
|
|
328
|
-
description: "Delete a DNS record by ID.",
|
|
329
|
-
inputSchema: { id: z.string() },
|
|
330
|
-
},
|
|
331
|
-
async ({ id }) => {
|
|
332
|
-
const deleted = deleteDnsRecord(id);
|
|
333
|
-
return { content: [{ type: "text", text: JSON.stringify({ id, deleted }) }] };
|
|
334
|
-
}
|
|
335
|
-
);
|
|
336
|
-
|
|
337
|
-
// --- Alerts ---
|
|
338
|
-
|
|
339
|
-
server.registerTool(
|
|
340
|
-
"create_alert",
|
|
341
|
-
{
|
|
342
|
-
title: "Create Alert",
|
|
343
|
-
description: "Set an alert for a domain (expiry, SSL expiry, or DNS change).",
|
|
344
|
-
inputSchema: {
|
|
345
|
-
domain_id: z.string(),
|
|
346
|
-
type: z.enum(["expiry", "ssl_expiry", "dns_change"]),
|
|
347
|
-
trigger_days_before: z.number().optional(),
|
|
348
|
-
},
|
|
349
|
-
},
|
|
350
|
-
async (params) => {
|
|
351
|
-
const alert = createAlert(params);
|
|
352
|
-
return { content: [{ type: "text", text: JSON.stringify(alert, null, 2) }] };
|
|
353
|
-
}
|
|
354
|
-
);
|
|
355
|
-
|
|
356
|
-
server.registerTool(
|
|
357
|
-
"list_alerts",
|
|
358
|
-
{
|
|
359
|
-
title: "List Alerts",
|
|
360
|
-
description: "List alerts for a domain.",
|
|
361
|
-
inputSchema: { domain_id: z.string() },
|
|
362
|
-
},
|
|
363
|
-
async ({ domain_id }) => {
|
|
364
|
-
const alerts = listAlerts(domain_id);
|
|
365
|
-
return {
|
|
366
|
-
content: [
|
|
367
|
-
{ type: "text", text: JSON.stringify({ alerts, count: alerts.length }, null, 2) },
|
|
368
|
-
],
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
);
|
|
372
|
-
|
|
373
|
-
server.registerTool(
|
|
374
|
-
"delete_alert",
|
|
375
|
-
{
|
|
376
|
-
title: "Delete Alert",
|
|
377
|
-
description: "Delete an alert by ID.",
|
|
378
|
-
inputSchema: { id: z.string() },
|
|
379
|
-
},
|
|
380
|
-
async ({ id }) => {
|
|
381
|
-
const deleted = deleteAlert(id);
|
|
382
|
-
return { content: [{ type: "text", text: JSON.stringify({ id, deleted }) }] };
|
|
383
|
-
}
|
|
384
|
-
);
|
|
385
|
-
|
|
386
|
-
// --- WHOIS Lookup ---
|
|
387
|
-
|
|
388
|
-
server.registerTool(
|
|
389
|
-
"whois_lookup",
|
|
390
|
-
{
|
|
391
|
-
title: "WHOIS Lookup",
|
|
392
|
-
description: "Run a WHOIS lookup for a domain. Parses registrar, expiry, nameservers from output. Updates DB record if found.",
|
|
393
|
-
inputSchema: { domain: z.string().describe("Domain name (e.g. example.com)") },
|
|
394
|
-
},
|
|
395
|
-
async ({ domain }) => {
|
|
396
|
-
try {
|
|
397
|
-
const result = whoisLookup(domain);
|
|
398
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
399
|
-
} catch (error: unknown) {
|
|
400
|
-
return {
|
|
401
|
-
content: [{ type: "text", text: `WHOIS lookup failed: ${error instanceof Error ? error.message : String(error)}` }],
|
|
402
|
-
isError: true,
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
);
|
|
407
|
-
|
|
408
|
-
// --- DNS Propagation Check ---
|
|
409
|
-
|
|
410
|
-
server.registerTool(
|
|
411
|
-
"check_dns_propagation",
|
|
412
|
-
{
|
|
413
|
-
title: "Check DNS Propagation",
|
|
414
|
-
description: "Check DNS propagation by querying multiple DNS servers (Google, Cloudflare, Quad9, OpenDNS).",
|
|
415
|
-
inputSchema: {
|
|
416
|
-
domain: z.string().describe("Domain name to check"),
|
|
417
|
-
record_type: z.string().default("A").describe("DNS record type (A, AAAA, CNAME, MX, TXT, NS)"),
|
|
418
|
-
},
|
|
419
|
-
},
|
|
420
|
-
async ({ domain, record_type }) => {
|
|
421
|
-
const result = checkDnsPropagation(domain, record_type);
|
|
422
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
423
|
-
}
|
|
424
|
-
);
|
|
425
|
-
|
|
426
|
-
// --- SSL Check ---
|
|
427
|
-
|
|
428
|
-
server.registerTool(
|
|
429
|
-
"check_ssl",
|
|
430
|
-
{
|
|
431
|
-
title: "Check SSL Certificate",
|
|
432
|
-
description: "Check SSL certificate for a domain. Extracts issuer and expiry. Updates DB record if found.",
|
|
433
|
-
inputSchema: { domain: z.string().describe("Domain name (e.g. example.com)") },
|
|
434
|
-
},
|
|
435
|
-
async ({ domain }) => {
|
|
436
|
-
const result = checkSsl(domain);
|
|
437
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
438
|
-
}
|
|
439
|
-
);
|
|
440
|
-
|
|
441
|
-
// --- Zone File Export ---
|
|
442
|
-
|
|
443
|
-
server.registerTool(
|
|
444
|
-
"export_zone_file",
|
|
445
|
-
{
|
|
446
|
-
title: "Export Zone File",
|
|
447
|
-
description: "Export DNS records for a domain as a BIND-format zone file.",
|
|
448
|
-
inputSchema: { domain_id: z.string().describe("Domain ID") },
|
|
449
|
-
},
|
|
450
|
-
async ({ domain_id }) => {
|
|
451
|
-
const zone = exportZoneFile(domain_id);
|
|
452
|
-
if (!zone) {
|
|
453
|
-
return { content: [{ type: "text", text: `Domain '${domain_id}' not found.` }], isError: true };
|
|
454
|
-
}
|
|
455
|
-
return { content: [{ type: "text", text: zone }] };
|
|
456
|
-
}
|
|
457
|
-
);
|
|
458
|
-
|
|
459
|
-
// --- Zone File Import ---
|
|
460
|
-
|
|
461
|
-
server.registerTool(
|
|
462
|
-
"import_zone_file",
|
|
463
|
-
{
|
|
464
|
-
title: "Import Zone File",
|
|
465
|
-
description: "Import DNS records from BIND zone file content into a domain.",
|
|
466
|
-
inputSchema: {
|
|
467
|
-
domain_id: z.string().describe("Domain ID"),
|
|
468
|
-
content: z.string().describe("Zone file content"),
|
|
469
|
-
},
|
|
470
|
-
},
|
|
471
|
-
async ({ domain_id, content }) => {
|
|
472
|
-
const result = importZoneFile(domain_id, content);
|
|
473
|
-
if (!result) {
|
|
474
|
-
return { content: [{ type: "text", text: `Domain '${domain_id}' not found.` }], isError: true };
|
|
475
|
-
}
|
|
476
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
477
|
-
}
|
|
478
|
-
);
|
|
479
|
-
|
|
480
|
-
// --- Subdomain Discovery ---
|
|
481
|
-
|
|
482
|
-
server.registerTool(
|
|
483
|
-
"discover_subdomains",
|
|
484
|
-
{
|
|
485
|
-
title: "Discover Subdomains",
|
|
486
|
-
description: "Discover subdomains via certificate transparency logs (crt.sh).",
|
|
487
|
-
inputSchema: { domain: z.string().describe("Domain name") },
|
|
488
|
-
},
|
|
489
|
-
async ({ domain }) => {
|
|
490
|
-
const result = await discoverSubdomains(domain);
|
|
491
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
492
|
-
}
|
|
493
|
-
);
|
|
494
|
-
|
|
495
|
-
// --- DNS Validation ---
|
|
496
|
-
|
|
497
|
-
server.registerTool(
|
|
498
|
-
"validate_dns",
|
|
499
|
-
{
|
|
500
|
-
title: "Validate DNS",
|
|
501
|
-
description: "Validate DNS records for common issues (CNAME conflicts, missing MX, orphan records).",
|
|
502
|
-
inputSchema: { domain_id: z.string().describe("Domain ID") },
|
|
503
|
-
},
|
|
504
|
-
async ({ domain_id }) => {
|
|
505
|
-
const result = validateDns(domain_id);
|
|
506
|
-
if (!result) {
|
|
507
|
-
return { content: [{ type: "text", text: `Domain '${domain_id}' not found.` }], isError: true };
|
|
508
|
-
}
|
|
509
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
510
|
-
}
|
|
511
|
-
);
|
|
512
|
-
|
|
513
|
-
// --- Portfolio Export ---
|
|
514
|
-
|
|
515
|
-
server.registerTool(
|
|
516
|
-
"export_portfolio",
|
|
517
|
-
{
|
|
518
|
-
title: "Export Portfolio",
|
|
519
|
-
description: "Export all domains as CSV or JSON with expiry, SSL, registrar, and auto-renew info.",
|
|
520
|
-
inputSchema: {
|
|
521
|
-
format: z.enum(["csv", "json"]).default("json").describe("Export format"),
|
|
522
|
-
},
|
|
523
|
-
},
|
|
524
|
-
async ({ format }) => {
|
|
525
|
-
const output = exportPortfolio(format);
|
|
526
|
-
return { content: [{ type: "text", text: output }] };
|
|
527
|
-
}
|
|
528
|
-
);
|
|
529
|
-
|
|
530
|
-
// --- Bulk Domain Check ---
|
|
531
|
-
|
|
532
|
-
server.registerTool(
|
|
533
|
-
"check_all_domains",
|
|
534
|
-
{
|
|
535
|
-
title: "Check All Domains",
|
|
536
|
-
description: "Run WHOIS + SSL + DNS validation on all domains. Returns a summary of issues found.",
|
|
537
|
-
inputSchema: {},
|
|
538
|
-
},
|
|
539
|
-
async () => {
|
|
540
|
-
const results = checkAllDomains();
|
|
541
|
-
return { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] };
|
|
542
|
-
}
|
|
543
|
-
);
|
|
544
|
-
|
|
545
|
-
// --- Namecheap Integration ---
|
|
546
|
-
|
|
547
|
-
server.registerTool(
|
|
548
|
-
"sync_namecheap",
|
|
549
|
-
{
|
|
550
|
-
title: "Sync Namecheap Domains",
|
|
551
|
-
description: "Sync all domains from Namecheap account to local database. Requires NAMECHEAP_API_KEY, NAMECHEAP_USERNAME, and NAMECHEAP_CLIENT_IP env vars.",
|
|
552
|
-
inputSchema: {},
|
|
553
|
-
},
|
|
554
|
-
async () => {
|
|
555
|
-
try {
|
|
556
|
-
const result = await syncToLocalDb({
|
|
557
|
-
getDomainByName,
|
|
558
|
-
createDomain,
|
|
559
|
-
updateDomain,
|
|
560
|
-
});
|
|
561
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
562
|
-
} catch (error: unknown) {
|
|
563
|
-
return {
|
|
564
|
-
content: [{ type: "text", text: `Sync failed: ${error instanceof Error ? error.message : String(error)}` }],
|
|
565
|
-
isError: true,
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
);
|
|
570
|
-
|
|
571
|
-
server.registerTool(
|
|
572
|
-
"renew_via_namecheap",
|
|
573
|
-
{
|
|
574
|
-
title: "Renew Domain via Namecheap",
|
|
575
|
-
description: "Renew a domain through the Namecheap API.",
|
|
576
|
-
inputSchema: {
|
|
577
|
-
domain: z.string().describe("Domain name to renew (e.g. example.com)"),
|
|
578
|
-
years: z.number().default(1).describe("Number of years to renew"),
|
|
579
|
-
},
|
|
580
|
-
},
|
|
581
|
-
async ({ domain, years }) => {
|
|
582
|
-
try {
|
|
583
|
-
const result = await namecheapRenew(domain, years);
|
|
584
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
585
|
-
} catch (error: unknown) {
|
|
586
|
-
return {
|
|
587
|
-
content: [{ type: "text", text: `Renewal failed: ${error instanceof Error ? error.message : String(error)}` }],
|
|
588
|
-
isError: true,
|
|
589
|
-
};
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
);
|
|
593
|
-
|
|
594
|
-
server.registerTool(
|
|
595
|
-
"check_availability_namecheap",
|
|
596
|
-
{
|
|
597
|
-
title: "Check Domain Availability",
|
|
598
|
-
description: "Check if a domain name is available for registration via Namecheap.",
|
|
599
|
-
inputSchema: {
|
|
600
|
-
domain: z.string().describe("Domain name to check (e.g. example.com)"),
|
|
601
|
-
},
|
|
602
|
-
},
|
|
603
|
-
async ({ domain }) => {
|
|
604
|
-
try {
|
|
605
|
-
const result = await namecheapCheck(domain);
|
|
606
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
607
|
-
} catch (error: unknown) {
|
|
608
|
-
return {
|
|
609
|
-
content: [{ type: "text", text: `Check failed: ${error instanceof Error ? error.message : String(error)}` }],
|
|
610
|
-
isError: true,
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
);
|
|
615
|
-
|
|
616
|
-
// --- GoDaddy Integration ---
|
|
617
|
-
|
|
618
|
-
server.registerTool(
|
|
619
|
-
"sync_godaddy",
|
|
620
|
-
{
|
|
621
|
-
title: "Sync GoDaddy Domains",
|
|
622
|
-
description: "Sync all domains from GoDaddy account to local database. Requires GODADDY_API_KEY and GODADDY_API_SECRET env vars.",
|
|
623
|
-
inputSchema: {},
|
|
624
|
-
},
|
|
625
|
-
async () => {
|
|
626
|
-
try {
|
|
627
|
-
const result = await godaddySyncToLocalDb({
|
|
628
|
-
getDomainByName,
|
|
629
|
-
createDomain,
|
|
630
|
-
updateDomain,
|
|
631
|
-
});
|
|
632
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
633
|
-
} catch (error: unknown) {
|
|
634
|
-
return {
|
|
635
|
-
content: [{ type: "text", text: `Sync failed: ${error instanceof Error ? error.message : String(error)}` }],
|
|
636
|
-
isError: true,
|
|
637
|
-
};
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
);
|
|
641
|
-
|
|
642
|
-
server.registerTool(
|
|
643
|
-
"renew_via_godaddy",
|
|
644
|
-
{
|
|
645
|
-
title: "Renew Domain via GoDaddy",
|
|
646
|
-
description: "Renew a domain through the GoDaddy API for 1 year.",
|
|
647
|
-
inputSchema: {
|
|
648
|
-
domain: z.string().describe("Domain name to renew (e.g. example.com)"),
|
|
649
|
-
},
|
|
650
|
-
},
|
|
651
|
-
async ({ domain }) => {
|
|
652
|
-
try {
|
|
653
|
-
const result = await godaddyRenewDomain(domain);
|
|
654
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
655
|
-
} catch (error: unknown) {
|
|
656
|
-
return {
|
|
657
|
-
content: [{ type: "text", text: `Renewal failed: ${error instanceof Error ? error.message : String(error)}` }],
|
|
658
|
-
isError: true,
|
|
659
|
-
};
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
);
|
|
663
|
-
|
|
664
|
-
// --- Unified Provider Tools ---
|
|
665
|
-
|
|
666
|
-
server.registerTool(
|
|
667
|
-
"sync_all_providers",
|
|
668
|
-
{
|
|
669
|
-
title: "Sync All Providers",
|
|
670
|
-
description: "Sync domains from all configured registrar providers (Namecheap, GoDaddy) to local database.",
|
|
671
|
-
inputSchema: {},
|
|
672
|
-
},
|
|
673
|
-
async () => {
|
|
674
|
-
try {
|
|
675
|
-
const result = await syncAll({
|
|
676
|
-
getDomainByName,
|
|
677
|
-
createDomain,
|
|
678
|
-
updateDomain,
|
|
679
|
-
});
|
|
680
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
681
|
-
} catch (error: unknown) {
|
|
682
|
-
return {
|
|
683
|
-
content: [{ type: "text", text: `Sync failed: ${error instanceof Error ? error.message : String(error)}` }],
|
|
684
|
-
isError: true,
|
|
685
|
-
};
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
);
|
|
689
|
-
|
|
690
|
-
server.registerTool(
|
|
691
|
-
"list_providers",
|
|
692
|
-
{
|
|
693
|
-
title: "List Providers",
|
|
694
|
-
description: "Show which registrar providers are configured (have API keys set).",
|
|
695
|
-
inputSchema: {},
|
|
696
|
-
},
|
|
697
|
-
async () => {
|
|
698
|
-
const providers = getAvailableProviders();
|
|
699
|
-
return { content: [{ type: "text", text: JSON.stringify(providers, null, 2) }] };
|
|
700
|
-
}
|
|
701
|
-
);
|
|
702
|
-
|
|
703
|
-
// --- Brandsight Tools ---
|
|
704
|
-
|
|
705
|
-
server.registerTool(
|
|
706
|
-
"monitor_brand",
|
|
707
|
-
{
|
|
708
|
-
title: "Monitor Brand",
|
|
709
|
-
description: "Monitor a brand name for new domain registrations that are similar (typosquats, homoglyphs, keyword matches). Uses Brandsight API.",
|
|
710
|
-
inputSchema: {
|
|
711
|
-
brand: z.string().describe("Brand name to monitor"),
|
|
712
|
-
},
|
|
713
|
-
},
|
|
714
|
-
async ({ brand }) => {
|
|
715
|
-
try {
|
|
716
|
-
const result = await monitorBrand(brand);
|
|
717
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
718
|
-
} catch (error: unknown) {
|
|
719
|
-
return {
|
|
720
|
-
content: [{ type: "text", text: `Monitor failed: ${error instanceof Error ? error.message : String(error)}` }],
|
|
721
|
-
isError: true,
|
|
722
|
-
};
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
);
|
|
726
|
-
|
|
727
|
-
server.registerTool(
|
|
728
|
-
"similar_domains",
|
|
729
|
-
{
|
|
730
|
-
title: "Similar Domains",
|
|
731
|
-
description: "Find typosquat/competing domains similar to the given domain. Uses Brandsight API.",
|
|
732
|
-
inputSchema: {
|
|
733
|
-
domain: z.string().describe("Domain to find similar domains for"),
|
|
734
|
-
},
|
|
735
|
-
},
|
|
736
|
-
async ({ domain }) => {
|
|
737
|
-
try {
|
|
738
|
-
const result = await getSimilarDomains(domain);
|
|
739
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
740
|
-
} catch (error: unknown) {
|
|
741
|
-
return {
|
|
742
|
-
content: [{ type: "text", text: `Similar domains check failed: ${error instanceof Error ? error.message : String(error)}` }],
|
|
743
|
-
isError: true,
|
|
744
|
-
};
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
);
|
|
748
|
-
|
|
749
|
-
server.registerTool(
|
|
750
|
-
"domain_threats",
|
|
751
|
-
{
|
|
752
|
-
title: "Domain Threats",
|
|
753
|
-
description: "Get a threat assessment for a domain including risk level, threats, and recommendation. Uses Brandsight API.",
|
|
754
|
-
inputSchema: {
|
|
755
|
-
domain: z.string().describe("Domain to assess threats for"),
|
|
756
|
-
},
|
|
757
|
-
},
|
|
758
|
-
async ({ domain }) => {
|
|
759
|
-
try {
|
|
760
|
-
const result = await getThreatAssessment(domain);
|
|
761
|
-
return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
|
|
762
|
-
} catch (error: unknown) {
|
|
763
|
-
return {
|
|
764
|
-
content: [{ type: "text", text: `Threat assessment failed: ${error instanceof Error ? error.message : String(error)}` }],
|
|
765
|
-
isError: true,
|
|
766
|
-
};
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
);
|
|
770
|
-
|
|
771
|
-
// --- Start ---
|
|
772
|
-
async function main() {
|
|
773
|
-
const transport = new StdioServerTransport();
|
|
774
|
-
await server.connect(transport);
|
|
775
|
-
console.error("microservice-domains MCP server running on stdio");
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
main().catch((error) => {
|
|
779
|
-
console.error("Fatal error:", error);
|
|
780
|
-
process.exit(1);
|
|
781
|
-
});
|