@bloomfilter/mcp-server 0.1.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/LICENSE +21 -0
- package/README.md +114 -0
- package/dist/client.d.ts +40 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +297 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +166 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/account.d.ts +10 -0
- package/dist/tools/account.d.ts.map +1 -0
- package/dist/tools/account.js +31 -0
- package/dist/tools/account.js.map +1 -0
- package/dist/tools/dns.d.ts +37 -0
- package/dist/tools/dns.d.ts.map +1 -0
- package/dist/tools/dns.js +131 -0
- package/dist/tools/dns.js.map +1 -0
- package/dist/tools/domain-info.d.ts +12 -0
- package/dist/tools/domain-info.d.ts.map +1 -0
- package/dist/tools/domain-info.js +32 -0
- package/dist/tools/domain-info.js.map +1 -0
- package/dist/tools/pricing.d.ts +12 -0
- package/dist/tools/pricing.d.ts.map +1 -0
- package/dist/tools/pricing.js +46 -0
- package/dist/tools/pricing.js.map +1 -0
- package/dist/tools/register.d.ts +16 -0
- package/dist/tools/register.d.ts.map +1 -0
- package/dist/tools/register.js +59 -0
- package/dist/tools/register.js.map +1 -0
- package/dist/tools/renew.d.ts +16 -0
- package/dist/tools/renew.d.ts.map +1 -0
- package/dist/tools/renew.js +45 -0
- package/dist/tools/renew.js.map +1 -0
- package/dist/tools/search.d.ts +13 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +37 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/types.d.ts +145 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +28 -0
- package/dist/types.js.map +1 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BloomFilter
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# @bloomfilter/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP server for [Bloomfilter](https://bloomfilter.xyz), register ICANN domain names and manage DNS records from AI agents.
|
|
4
|
+
|
|
5
|
+
Bloomfilter is a domain registration API that uses [x402](https://www.x402.org/) for payments. Point your AI agent at the Bloomfilter API, give it a wallet with some USDC, and it can autonomously search, register, and configure domains.
|
|
6
|
+
|
|
7
|
+
No login, no credit card, no dashboard. Just HTTP requests and a crypto wallet.
|
|
8
|
+
|
|
9
|
+
This MCP server wraps the Bloomfilter API so that any MCP-compatible client (Claude Desktop, Cursor, Windsurf, custom agents, etc.) can use it as a tool provider.
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
BLOOMFILTER_PRIVATE_KEY=0x... npx @bloomfilter/mcp-server
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The server communicates over stdio (JSON-RPC). It's meant to be launched by an MCP client, not run standalone.
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
Add this JSON to your MCP client's config file:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"bloomfilter": {
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": ["-y", "@bloomfilter/mcp-server"],
|
|
29
|
+
"env": {
|
|
30
|
+
"BLOOMFILTER_PRIVATE_KEY": "0x..."
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Config file location by client
|
|
38
|
+
|
|
39
|
+
| Client | Config file |
|
|
40
|
+
| ----------------------------------------------------------------------------------------- | ------------------------------------- |
|
|
41
|
+
| [Claude Desktop](https://claude.ai/download) | `claude_desktop_config.json` |
|
|
42
|
+
| [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) | `~/.claude/settings.json` |
|
|
43
|
+
| [Cursor](https://cursor.com) | `.cursor/mcp.json` |
|
|
44
|
+
| [Windsurf](https://windsurf.com) | `~/.codeium/windsurf/mcp_config.json` |
|
|
45
|
+
| [VS Code + Copilot](https://code.visualstudio.com/docs/copilot/customization/mcp-servers) | `.vscode/mcp.json` |
|
|
46
|
+
| [Cline](https://docs.cline.bot/mcp/configuring-mcp-servers) | Via Cline MCP settings UI |
|
|
47
|
+
| [JetBrains IDEs](https://www.jetbrains.com/help/ai-assistant/mcp.html) | Settings > Tools > AI Assistant > MCP |
|
|
48
|
+
|
|
49
|
+
Any MCP-compatible client that supports stdio servers will work.
|
|
50
|
+
|
|
51
|
+
### Environment variables
|
|
52
|
+
|
|
53
|
+
| Variable | Required | Default | Description |
|
|
54
|
+
| ------------------------- | ------------------- | ----------------------------- | -------------------------------------------------------------------- |
|
|
55
|
+
| `BLOOMFILTER_PRIVATE_KEY` | For paid operations | - | EVM private key (hex). Used for x402 payments and wallet-based auth. |
|
|
56
|
+
| `BLOOMFILTER_API_URL` | No | `https://api.bloomfilter.xyz` | API base URL. |
|
|
57
|
+
|
|
58
|
+
Without a private key, only `search_domains` and `get_pricing` work. Everything else requires a wallet.
|
|
59
|
+
|
|
60
|
+
## Tools
|
|
61
|
+
|
|
62
|
+
The server exposes 10 tools:
|
|
63
|
+
|
|
64
|
+
### Free (no wallet needed)
|
|
65
|
+
|
|
66
|
+
- **`search_domains`:** Check if a domain is available and get pricing. Searches across multiple TLDs at once.
|
|
67
|
+
- **`get_pricing`:** Get registration, renewal, and transfer pricing for one or all supported TLDs.
|
|
68
|
+
|
|
69
|
+
### Authenticated (wallet required)
|
|
70
|
+
|
|
71
|
+
- **`get_domain_info`:** Get details about a registered domain: status, expiry, nameservers, lock state.
|
|
72
|
+
- **`register_domain`:** Register a new domain. Pays with USDC via x402 automatically. Handles async provisioning.
|
|
73
|
+
- **`renew_domain`:** Extend a domain registration. Same x402 payment flow.
|
|
74
|
+
- **`get_account`:** View wallet address, domain count, total spent.
|
|
75
|
+
|
|
76
|
+
### DNS Management (wallet required, $0.10 USDC per mutation)
|
|
77
|
+
|
|
78
|
+
- **`list_dns_records`:** List all DNS records for a domain.
|
|
79
|
+
- **`add_dns_record`:** Add a DNS record (A, AAAA, CNAME, MX, TXT, NS, SRV, CAA, FORWARD).
|
|
80
|
+
- **`update_dns_record`:** Update an existing DNS record by ID.
|
|
81
|
+
- **`delete_dns_record`:** Delete a DNS record by ID.
|
|
82
|
+
|
|
83
|
+
## How Payments Work
|
|
84
|
+
|
|
85
|
+
Bloomfilter uses the [x402 protocol](https://www.x402.org/), an HTTP-native payment standard. When a tool triggers a paid API call, the server handles payment negotiation automatically:
|
|
86
|
+
|
|
87
|
+
1. The API responds with HTTP 402 and a payment requirement
|
|
88
|
+
2. The MCP server signs a USDC payment with your wallet
|
|
89
|
+
3. The API verifies the payment and completes the request
|
|
90
|
+
|
|
91
|
+
All payments are in USDC on Base (an Ethereum L2). You need USDC in the wallet corresponding to your private key.
|
|
92
|
+
|
|
93
|
+
## Authentication
|
|
94
|
+
|
|
95
|
+
The server authenticates with the Bloomfilter API using SIWE (Sign-In With Ethereum). This happens automatically on the first authenticated tool call. No setup needed beyond providing your private key.
|
|
96
|
+
|
|
97
|
+
## Documentation
|
|
98
|
+
|
|
99
|
+
Full API reference and guides at [docs.bloomfilter.xyz](https://docs.bloomfilter.xyz).
|
|
100
|
+
|
|
101
|
+
## Building from Source
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
git clone https://github.com/BloomFilter-Labs/mcp-server-bloomfilter.git
|
|
105
|
+
cd mcp-server-bloomfilter
|
|
106
|
+
npm install
|
|
107
|
+
npm run build
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Requires Node.js 20+.
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
MIT
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bloomfilter API client with x402 payment support and SIWE authentication.
|
|
3
|
+
*
|
|
4
|
+
* This module creates an axios instance optionally wrapped with @x402/axios
|
|
5
|
+
* for automatic 402 payment handling, plus lazy SIWE authentication with
|
|
6
|
+
* token caching and refresh.
|
|
7
|
+
*/
|
|
8
|
+
import type { AxiosInstance } from "axios";
|
|
9
|
+
import type { BloomfilterConfig, McpToolResult, JobStatusResponse } from "./types.js";
|
|
10
|
+
export interface BloomfilterClient {
|
|
11
|
+
/** The underlying axios instance (with x402 wrapping if private key provided) */
|
|
12
|
+
http: AxiosInstance;
|
|
13
|
+
/** Ensure the client is authenticated (lazy SIWE flow) */
|
|
14
|
+
ensureAuth(): Promise<void>;
|
|
15
|
+
/** Get auth headers for authenticated requests */
|
|
16
|
+
getAuthHeaders(): Record<string, string>;
|
|
17
|
+
/** Check if a private key is configured; returns error result if not, null if OK */
|
|
18
|
+
requiresPrivateKey(): McpToolResult | null;
|
|
19
|
+
/** Poll an async job until completion or failure */
|
|
20
|
+
pollJobStatus(jobId: string): Promise<JobStatusResponse>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a Bloomfilter API client.
|
|
24
|
+
*
|
|
25
|
+
* If a private key is provided, the axios instance is wrapped with @x402/axios
|
|
26
|
+
* for automatic 402 payment handling. Authentication uses SIWE (Sign-In With
|
|
27
|
+
* Ethereum) — tokens are cached in memory and refreshed automatically.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createBloomfilterClient(config: BloomfilterConfig): Promise<BloomfilterClient>;
|
|
30
|
+
/**
|
|
31
|
+
* Format any error into a consistent MCP tool result.
|
|
32
|
+
*
|
|
33
|
+
* Handles:
|
|
34
|
+
* - Axios errors with Bloomfilter API error responses
|
|
35
|
+
* - Rate limiting (429)
|
|
36
|
+
* - Network/connection errors
|
|
37
|
+
* - Generic errors
|
|
38
|
+
*/
|
|
39
|
+
export declare function formatToolError(error: unknown, apiUrl?: string): McpToolResult;
|
|
40
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAM3C,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EAIb,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAmBpB,MAAM,WAAW,iBAAiB;IAChC,iFAAiF;IACjF,IAAI,EAAE,aAAa,CAAC;IACpB,0DAA0D;IAC1D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,kDAAkD;IAClD,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,oFAAoF;IACpF,kBAAkB,IAAI,aAAa,GAAG,IAAI,CAAC;IAC3C,oDAAoD;IACpD,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC1D;AAaD;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,iBAAiB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CA0L5B;AAID;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CA6G9E"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bloomfilter API client with x402 payment support and SIWE authentication.
|
|
3
|
+
*
|
|
4
|
+
* This module creates an axios instance optionally wrapped with @x402/axios
|
|
5
|
+
* for automatic 402 payment handling, plus lazy SIWE authentication with
|
|
6
|
+
* token caching and refresh.
|
|
7
|
+
*/
|
|
8
|
+
import axios from "axios";
|
|
9
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
10
|
+
import { createSiweMessage } from "viem/siwe";
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import { HTTP_TIMEOUT_MS, JOB_POLL_INTERVAL_MS, JOB_TIMEOUT_MS } from "./types.js";
|
|
13
|
+
// ── Config Validation ────────────────────────────────────────────────────────
|
|
14
|
+
const configSchema = z.object({
|
|
15
|
+
apiUrl: z.string().url("apiUrl must be a valid URL"),
|
|
16
|
+
privateKey: z
|
|
17
|
+
.custom((val) => typeof val === "string" && /^0x[0-9a-fA-F]{64}$/.test(val), {
|
|
18
|
+
message: "privateKey must be a 0x-prefixed 32-byte hex string",
|
|
19
|
+
})
|
|
20
|
+
.optional(),
|
|
21
|
+
network: z
|
|
22
|
+
.string()
|
|
23
|
+
.regex(/^eip155:\d+$/, 'network must be in CAIP-2 format (e.g. "eip155:8453")'),
|
|
24
|
+
});
|
|
25
|
+
// ── Factory ─────────────────────────────────────────────────────────────────
|
|
26
|
+
/**
|
|
27
|
+
* Create a Bloomfilter API client.
|
|
28
|
+
*
|
|
29
|
+
* If a private key is provided, the axios instance is wrapped with @x402/axios
|
|
30
|
+
* for automatic 402 payment handling. Authentication uses SIWE (Sign-In With
|
|
31
|
+
* Ethereum) — tokens are cached in memory and refreshed automatically.
|
|
32
|
+
*/
|
|
33
|
+
export async function createBloomfilterClient(config) {
|
|
34
|
+
// Validate config upfront — fail fast with clear messages
|
|
35
|
+
configSchema.parse(config);
|
|
36
|
+
let account;
|
|
37
|
+
let tokenCache;
|
|
38
|
+
// Create base axios instance
|
|
39
|
+
let httpClient = axios.create({
|
|
40
|
+
baseURL: config.apiUrl,
|
|
41
|
+
timeout: HTTP_TIMEOUT_MS,
|
|
42
|
+
headers: { "Content-Type": "application/json" },
|
|
43
|
+
});
|
|
44
|
+
// If private key is provided, set up wallet + x402 payment wrapping
|
|
45
|
+
if (config.privateKey) {
|
|
46
|
+
account = privateKeyToAccount(config.privateKey);
|
|
47
|
+
console.error(`[bloomfilter-mcp] Wallet: ${account.address}`);
|
|
48
|
+
try {
|
|
49
|
+
// Dynamic import to avoid issues when private key is not provided
|
|
50
|
+
const { wrapAxiosWithPayment, x402Client } = await import("@x402/axios");
|
|
51
|
+
const { ExactEvmScheme } = await import("@x402/evm");
|
|
52
|
+
const x402 = new x402Client().register("eip155:*", new ExactEvmScheme(account));
|
|
53
|
+
httpClient = wrapAxiosWithPayment(httpClient, x402);
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
console.error("[bloomfilter-mcp] Warning: Failed to initialize x402 payment support.", err instanceof Error ? err.message : err);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// ── SIWE Auth ───────────────────────────────────────────────────────────
|
|
60
|
+
async function authenticate() {
|
|
61
|
+
if (!account) {
|
|
62
|
+
throw new Error("Cannot authenticate without a private key");
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
// 1. Get nonce from API
|
|
66
|
+
const { data: nonceData } = await httpClient.get("/auth/nonce");
|
|
67
|
+
// 2. Construct SIWE message
|
|
68
|
+
const message = createSiweMessage({
|
|
69
|
+
address: account.address,
|
|
70
|
+
chainId: nonceData.chainId,
|
|
71
|
+
domain: nonceData.domain,
|
|
72
|
+
nonce: nonceData.nonce,
|
|
73
|
+
uri: nonceData.uri,
|
|
74
|
+
version: "1",
|
|
75
|
+
issuedAt: new Date(),
|
|
76
|
+
});
|
|
77
|
+
// 3. Sign the message
|
|
78
|
+
const signature = await account.signMessage({ message });
|
|
79
|
+
// 4. Verify with the API
|
|
80
|
+
const { data: authData } = await httpClient.post("/auth/verify", {
|
|
81
|
+
message,
|
|
82
|
+
signature,
|
|
83
|
+
});
|
|
84
|
+
// 5. Cache tokens
|
|
85
|
+
tokenCache = {
|
|
86
|
+
accessToken: authData.accessToken,
|
|
87
|
+
refreshToken: authData.refreshToken,
|
|
88
|
+
expiresAt: Date.now() + authData.expiresIn * 1000 - 60_000, // 1 min buffer
|
|
89
|
+
};
|
|
90
|
+
console.error(`[bloomfilter-mcp] Authenticated as ${account.address}`);
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
94
|
+
throw new Error(`Authentication failed: ${detail}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async function refreshAuth() {
|
|
98
|
+
if (!tokenCache)
|
|
99
|
+
return false;
|
|
100
|
+
try {
|
|
101
|
+
const { data } = await httpClient.post("/auth/refresh", {
|
|
102
|
+
refreshToken: tokenCache.refreshToken,
|
|
103
|
+
});
|
|
104
|
+
tokenCache = {
|
|
105
|
+
accessToken: data.accessToken,
|
|
106
|
+
refreshToken: data.refreshToken,
|
|
107
|
+
expiresAt: Date.now() + data.expiresIn * 1000 - 60_000,
|
|
108
|
+
};
|
|
109
|
+
console.error("[bloomfilter-mcp] Token refreshed");
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
console.error("[bloomfilter-mcp] Token refresh failed, re-authenticating");
|
|
114
|
+
tokenCache = undefined;
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async function ensureAuth() {
|
|
119
|
+
if (!account) {
|
|
120
|
+
throw new Error("BLOOMFILTER_PRIVATE_KEY is required for authenticated operations");
|
|
121
|
+
}
|
|
122
|
+
// No tokens yet — full auth
|
|
123
|
+
if (!tokenCache) {
|
|
124
|
+
await authenticate();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
// Token still valid
|
|
128
|
+
if (Date.now() < tokenCache.expiresAt) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
// Token expired — try refresh, fall back to full auth
|
|
132
|
+
const refreshed = await refreshAuth();
|
|
133
|
+
if (!refreshed) {
|
|
134
|
+
await authenticate();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function getAuthHeaders() {
|
|
138
|
+
if (!tokenCache)
|
|
139
|
+
return {};
|
|
140
|
+
return { Authorization: `Bearer ${tokenCache.accessToken}` };
|
|
141
|
+
}
|
|
142
|
+
function requiresPrivateKey() {
|
|
143
|
+
if (config.privateKey)
|
|
144
|
+
return null;
|
|
145
|
+
return {
|
|
146
|
+
content: [
|
|
147
|
+
{
|
|
148
|
+
type: "text",
|
|
149
|
+
text: "Error: BLOOMFILTER_PRIVATE_KEY is required for this operation. " +
|
|
150
|
+
"Set it as an environment variable to enable domain registration, " +
|
|
151
|
+
"renewal, DNS management, and account access.\n\n" +
|
|
152
|
+
"Example: BLOOMFILTER_PRIVATE_KEY=0x... bloomfilter-mcp",
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
isError: true,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
// ── Job Polling ─────────────────────────────────────────────────────────
|
|
159
|
+
async function pollJobStatus(jobId) {
|
|
160
|
+
const startTime = Date.now();
|
|
161
|
+
while (Date.now() - startTime < JOB_TIMEOUT_MS) {
|
|
162
|
+
// Re-check auth on each poll — long polling loops can outlast token expiry
|
|
163
|
+
await ensureAuth();
|
|
164
|
+
const { data } = await httpClient.get(`/domains/status/${jobId}`, {
|
|
165
|
+
headers: getAuthHeaders(),
|
|
166
|
+
});
|
|
167
|
+
if (data.status === "completed") {
|
|
168
|
+
return data;
|
|
169
|
+
}
|
|
170
|
+
if (data.status === "failed") {
|
|
171
|
+
throw new Error(data.error ?? `Job ${jobId} failed: domain provisioning was unsuccessful`);
|
|
172
|
+
}
|
|
173
|
+
// Wait before polling again
|
|
174
|
+
await new Promise((resolve) => setTimeout(resolve, JOB_POLL_INTERVAL_MS));
|
|
175
|
+
}
|
|
176
|
+
throw new Error(`Job ${jobId} timed out after ${JOB_TIMEOUT_MS / 1000}s. ` +
|
|
177
|
+
"The domain may still be provisioning — check status later with get_domain_info.");
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
http: httpClient,
|
|
181
|
+
ensureAuth,
|
|
182
|
+
getAuthHeaders,
|
|
183
|
+
requiresPrivateKey,
|
|
184
|
+
pollJobStatus,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
// ── Error Formatting ──────────────────────────────────────────────────────
|
|
188
|
+
/**
|
|
189
|
+
* Format any error into a consistent MCP tool result.
|
|
190
|
+
*
|
|
191
|
+
* Handles:
|
|
192
|
+
* - Axios errors with Bloomfilter API error responses
|
|
193
|
+
* - Rate limiting (429)
|
|
194
|
+
* - Network/connection errors
|
|
195
|
+
* - Generic errors
|
|
196
|
+
*/
|
|
197
|
+
export function formatToolError(error, apiUrl) {
|
|
198
|
+
if (axios.isAxiosError(error)) {
|
|
199
|
+
// Rate limited
|
|
200
|
+
if (error.response?.status === 429) {
|
|
201
|
+
const data = error.response.data;
|
|
202
|
+
const message = data?.message ?? "Too many requests";
|
|
203
|
+
return {
|
|
204
|
+
content: [{ type: "text", text: `Rate limited: ${message}. Please wait before retrying.` }],
|
|
205
|
+
isError: true,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
// API error response
|
|
209
|
+
if (error.response?.data) {
|
|
210
|
+
const data = error.response.data;
|
|
211
|
+
const status = error.response.status;
|
|
212
|
+
// x402 payment responses — two cases:
|
|
213
|
+
// 1. Initial 402 with accepts array (no x402 wrapper, or wrapper disabled)
|
|
214
|
+
// 2. Retry 402 after x402 wrapper tried to pay but settlement failed
|
|
215
|
+
if (status === 402) {
|
|
216
|
+
if (data.accepts) {
|
|
217
|
+
// Case 1: Initial 402 with payment requirements
|
|
218
|
+
const accepts = data.accepts;
|
|
219
|
+
const amount = accepts[0]?.price ?? accepts[0]?.amount;
|
|
220
|
+
const description = data.resource?.description;
|
|
221
|
+
const detail = description
|
|
222
|
+
? `${description} requires payment of ${amount} USDC`
|
|
223
|
+
: `Payment of ${amount} USDC required`;
|
|
224
|
+
return {
|
|
225
|
+
content: [
|
|
226
|
+
{
|
|
227
|
+
type: "text",
|
|
228
|
+
text: `Payment required: ${detail}. Ensure your wallet has sufficient USDC balance.`,
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
isError: true,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
// Case 2: Payment was attempted but failed (insufficient balance, settlement error, etc.)
|
|
235
|
+
const serverMsg = data.message ?? data.error ?? data.detail;
|
|
236
|
+
const detail = serverMsg ?? "payment was attempted but could not be settled on-chain";
|
|
237
|
+
return {
|
|
238
|
+
content: [
|
|
239
|
+
{
|
|
240
|
+
type: "text",
|
|
241
|
+
text: `Payment failed: ${detail}. Check that your wallet has sufficient USDC balance on Base.`,
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
isError: true,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
const code = data.code ?? `HTTP ${status}`;
|
|
248
|
+
const message = data.message ??
|
|
249
|
+
data.error ??
|
|
250
|
+
data.detail ??
|
|
251
|
+
error.response.statusText ??
|
|
252
|
+
`Request failed with status ${status}`;
|
|
253
|
+
return {
|
|
254
|
+
content: [{ type: "text", text: `Error [${code}]: ${message}` }],
|
|
255
|
+
isError: true,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
// Network/connection error
|
|
259
|
+
if (error.code === "ECONNREFUSED" || error.code === "ENOTFOUND") {
|
|
260
|
+
const url = apiUrl ?? error.config?.baseURL ?? "unknown";
|
|
261
|
+
return {
|
|
262
|
+
content: [
|
|
263
|
+
{
|
|
264
|
+
type: "text",
|
|
265
|
+
text: `Failed to connect to Bloomfilter API at ${url}. ` +
|
|
266
|
+
"Check that the API is running and BLOOMFILTER_API_URL is correct.",
|
|
267
|
+
},
|
|
268
|
+
],
|
|
269
|
+
isError: true,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
// Timeout
|
|
273
|
+
if (error.code === "ECONNABORTED" || error.code === "ERR_CANCELED") {
|
|
274
|
+
return {
|
|
275
|
+
content: [
|
|
276
|
+
{
|
|
277
|
+
type: "text",
|
|
278
|
+
text: "Request timed out. The Bloomfilter API may be slow or unreachable.",
|
|
279
|
+
},
|
|
280
|
+
],
|
|
281
|
+
isError: true,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
// Generic axios error
|
|
285
|
+
return {
|
|
286
|
+
content: [{ type: "text", text: `Request failed: ${error.message}` }],
|
|
287
|
+
isError: true,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
// Non-axios error
|
|
291
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
292
|
+
return {
|
|
293
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
294
|
+
isError: true,
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,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AE,CAAC;YACrE,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAED,kBAAkB;IAClB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;QACtD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* @bloomfilter/mcp-server
|
|
4
|
+
*
|
|
5
|
+
* MCP server for Bloomfilter — enables AI agents to register ICANN domain
|
|
6
|
+
* names, manage DNS records, and check pricing via the Model Context Protocol.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* BLOOMFILTER_PRIVATE_KEY=0x... npx @bloomfilter/mcp-server
|
|
10
|
+
*
|
|
11
|
+
* Environment variables:
|
|
12
|
+
* BLOOMFILTER_API_URL — API base URL (default: https://api.bloomfilter.xyz)
|
|
13
|
+
* BLOOMFILTER_PRIVATE_KEY — EVM private key for payments + auth (optional for free tools)
|
|
14
|
+
* BLOOMFILTER_NETWORK — x402 network (default: eip155:8453)
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;GAaG"}
|