@cryptoapis-io/mcp-aml 0.1.0 → 0.3.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/README.md +31 -3
- package/dist/api/exposure/get-address-exposure/index.d.ts +5 -0
- package/dist/api/exposure/get-address-exposure/index.d.ts.map +1 -0
- package/dist/api/exposure/get-address-exposure/index.js +6 -0
- package/dist/api/exposure/get-address-exposure/index.js.map +1 -0
- package/dist/api/exposure/index.d.ts +4 -0
- package/dist/api/exposure/index.d.ts.map +1 -0
- package/dist/api/exposure/index.js +4 -0
- package/dist/api/exposure/index.js.map +1 -0
- package/dist/api/exposure/list-address-exposure-paths/index.d.ts +5 -0
- package/dist/api/exposure/list-address-exposure-paths/index.d.ts.map +1 -0
- package/dist/api/exposure/list-address-exposure-paths/index.js +11 -0
- package/dist/api/exposure/list-address-exposure-paths/index.js.map +1 -0
- package/dist/api/exposure/types.d.ts +19 -0
- package/dist/api/exposure/types.d.ts.map +1 -0
- package/dist/api/exposure/types.js +21 -0
- package/dist/api/exposure/types.js.map +1 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/cli.js +5 -12
- package/dist/cli.js.map +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +18 -0
- package/dist/prompts/index.js.map +1 -1
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +3 -1
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/supported-capabilities.d.ts +5 -1
- package/dist/resources/supported-capabilities.d.ts.map +1 -1
- package/dist/resources/supported-capabilities.js +15 -1
- package/dist/resources/supported-capabilities.js.map +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +12 -32
- package/dist/server.js.map +1 -1
- package/dist/tools/aml/get-address-exposure/credits.d.ts +3 -0
- package/dist/tools/aml/get-address-exposure/credits.d.ts.map +1 -0
- package/dist/tools/aml/get-address-exposure/credits.js +3 -0
- package/dist/tools/aml/get-address-exposure/credits.js.map +1 -0
- package/dist/tools/aml/index.d.ts.map +1 -1
- package/dist/tools/aml/index.js +42 -1
- package/dist/tools/aml/index.js.map +1 -1
- package/dist/tools/aml/list-address-exposure-paths/credits.d.ts +3 -0
- package/dist/tools/aml/list-address-exposure-paths/credits.d.ts.map +1 -0
- package/dist/tools/aml/list-address-exposure-paths/credits.js +3 -0
- package/dist/tools/aml/list-address-exposure-paths/credits.js.map +1 -0
- package/dist/tools/aml/schema.d.ts +19 -4
- package/dist/tools/aml/schema.d.ts.map +1 -1
- package/dist/tools/aml/schema.js +34 -3
- package/dist/tools/aml/schema.js.map +1 -1
- package/dist/tools/index.d.ts +12 -3
- package/dist/tools/index.d.ts.map +1 -1
- package/package.json +9 -9
- package/server.json +6 -4
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@ MCP server for [Crypto APIs](https://cryptoapis.io/) AML (Anti-Money Laundering)
|
|
|
8
8
|
|
|
9
9
|
- Verify whether an address is flagged or associated with fraud, sanctions, ransomware, exploits, darknet markets, or other AML risk categories
|
|
10
10
|
- Screen a transaction and its participants against AML data, returning risk score, risk band, and flagged addresses with roles/categories/severity
|
|
11
|
+
- Get an address's exposure to risky entities/categories via the AML exposure graph
|
|
12
|
+
- List the paths connecting an address to risky entities in the AML exposure graph, with cursor pagination
|
|
11
13
|
|
|
12
14
|
## Prerequisites
|
|
13
15
|
|
|
@@ -32,7 +34,7 @@ npx @cryptoapis-io/mcp-aml --api-key YOUR_API_KEY
|
|
|
32
34
|
export CRYPTOAPIS_API_KEY=YOUR_API_KEY
|
|
33
35
|
npx @cryptoapis-io/mcp-aml
|
|
34
36
|
|
|
35
|
-
# HTTP transport
|
|
37
|
+
# HTTP transport (listens on 127.0.0.1; see "Exposing the server beyond localhost")
|
|
36
38
|
npx @cryptoapis-io/mcp-aml --transport http --port 3000 --api-key YOUR_API_KEY
|
|
37
39
|
```
|
|
38
40
|
|
|
@@ -87,6 +89,8 @@ npx @modelcontextprotocol/inspector npx @cryptoapis-io/mcp-aml --api-key YOUR_AP
|
|
|
87
89
|
2. In your n8n workflow, add an **AI Agent** node
|
|
88
90
|
3. Under **Tools**, add an **MCP Client Tool** and set the URL to `http://localhost:3000/mcp`
|
|
89
91
|
|
|
92
|
+
> **n8n in Docker:** `localhost` inside the container is not your machine. Start the server with `--host 0.0.0.0` and `MCP_AUTH_TOKEN` set (see [Exposing the server beyond localhost](#exposing-the-server-beyond-localhost)), use `http://host.docker.internal:3000/mcp` as the URL, and add an `Authorization: Bearer <token>` header to the MCP Client Tool credential.
|
|
93
|
+
|
|
90
94
|
> All servers default to port 3000. Use `--port` to assign different ports when running multiple servers.
|
|
91
95
|
|
|
92
96
|
## Available Tools
|
|
@@ -97,10 +101,14 @@ npx @modelcontextprotocol/inspector npx @cryptoapis-io/mcp-aml --api-key YOUR_AP
|
|
|
97
101
|
|--------|-------------|
|
|
98
102
|
| `verify-address` | Check if an address is flagged for fraud, sanctions, or other AML risk categories. Params: `address` |
|
|
99
103
|
| `screen-transaction` | Screen a transaction and its participants against AML data. Params: `blockchain`, `transactionHash` |
|
|
104
|
+
| `get-address-exposure` | Get an address's exposure to risky entities/categories in the AML exposure graph. Params: `blockchain`, `address` |
|
|
105
|
+
| `list-address-exposure-paths` | List the paths connecting an address to risky entities in the AML exposure graph. Params: `blockchain`, `address`; optional `rootAddress` (only return routes originating from this flagged root address), `limit` (1-50, default 10), `startingAfter` (cursor — pass back the response's `nextStartingAfter` to page) |
|
|
100
106
|
|
|
101
107
|
`screen-transaction` supports: ethereum, ethereum-classic, binance-smart-chain, bitcoin, bitcoin-cash, dash, dogecoin, litecoin, arbitrum, polygon, avalanche, optimism, base, zcash, xrp, solana, tezos, kaspa, tron.
|
|
102
108
|
|
|
103
|
-
|
|
109
|
+
`get-address-exposure` and `list-address-exposure-paths` support a narrower set of 13 chains (no exposure graph for arbitrum, avalanche, base, optimism, tezos, or kaspa): ethereum, binance-smart-chain, ethereum-classic, polygon, tron, bitcoin, bitcoin-cash, litecoin, dogecoin, dash, zcash, xrp, solana.
|
|
110
|
+
|
|
111
|
+
> **Note:** these are the highest per-call credit cost endpoints in the Crypto APIs suite — `verify-address` is 200,000 credits, `screen-transaction` is 500,000 credits per call, `get-address-exposure` is 200,000 credits per request, and `list-address-exposure-paths` is 100,000 credits per page.
|
|
104
112
|
|
|
105
113
|
## CLI Arguments
|
|
106
114
|
|
|
@@ -108,7 +116,9 @@ npx @modelcontextprotocol/inspector npx @cryptoapis-io/mcp-aml --api-key YOUR_AP
|
|
|
108
116
|
|----------|-------------|---------|
|
|
109
117
|
| `--api-key` | Crypto APIs API key | `CRYPTOAPIS_API_KEY` env var |
|
|
110
118
|
| `--transport` | Transport type: `stdio` or `http` | `stdio` |
|
|
111
|
-
| `--host` | HTTP host
|
|
119
|
+
| `--host` | HTTP host (use `0.0.0.0` to accept remote connections — requires an auth token with `--api-key`) | `127.0.0.1` |
|
|
120
|
+
| `--auth-token` | Bearer token callers must send (`Authorization: Bearer <token>`); prefer the `MCP_AUTH_TOKEN` env var | `MCP_AUTH_TOKEN` env var |
|
|
121
|
+
| `--allowed-hosts` | Comma-separated `Host` header allowlist for non-loopback binds | — |
|
|
112
122
|
| `--port` | HTTP port | `3000` |
|
|
113
123
|
| `--path` | HTTP path | `/mcp` |
|
|
114
124
|
| `--stateless` | Enable stateless HTTP mode | `false` |
|
|
@@ -126,6 +136,24 @@ npx @cryptoapis-io/mcp-aml --transport http --port 3000
|
|
|
126
136
|
# Clients send x-api-key header with each request
|
|
127
137
|
```
|
|
128
138
|
|
|
139
|
+
### Exposing the server beyond localhost
|
|
140
|
+
|
|
141
|
+
HTTP mode listens on `127.0.0.1` by default, so only processes on the same machine can reach it.
|
|
142
|
+
To accept connections from other machines or containers, bind explicitly and protect the port:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Startup-key mode: callers must present the token (the server refuses to start without one)
|
|
146
|
+
export MCP_AUTH_TOKEN=$(openssl rand -hex 32)
|
|
147
|
+
npx @cryptoapis-io/mcp-aml --transport http --host 0.0.0.0 --port 3000 --api-key YOUR_API_KEY \
|
|
148
|
+
--allowed-hosts mcp.internal.example
|
|
149
|
+
# Clients send: Authorization: Bearer $MCP_AUTH_TOKEN
|
|
150
|
+
|
|
151
|
+
# Per-request key mode: no startup key, every request must carry the caller's own x-api-key
|
|
152
|
+
npx @cryptoapis-io/mcp-aml --transport http --host 0.0.0.0 --port 3000
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
`--allowed-hosts` restricts the `Host` header (DNS rebinding protection) when not bound to loopback. Prefer `MCP_AUTH_TOKEN` over `--auth-token`: command-line arguments are visible in the process list.
|
|
156
|
+
|
|
129
157
|
> Stdio transport always requires an API key at startup.
|
|
130
158
|
|
|
131
159
|
## Important: API Key Required
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CryptoApisHttpClient, RequestMetadata } from "@cryptoapis-io/mcp-shared";
|
|
2
|
+
import type { GetAddressExposureRequest } from "../types.js";
|
|
3
|
+
export type GetAddressExposureInput = GetAddressExposureRequest & RequestMetadata;
|
|
4
|
+
export declare function getAddressExposure(client: CryptoApisHttpClient, input: GetAddressExposureInput): Promise<import("@cryptoapis-io/mcp-shared").RequestResult<unknown>>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/exposure/get-address-exposure/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,MAAM,uBAAuB,GAAG,yBAAyB,GAAG,eAAe,CAAC;AAElF,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,EAAE,KAAK,EAAE,uBAAuB,uEAIpG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/exposure/get-address-exposure/index.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAA4B,EAAE,KAA8B;IACjG,OAAO,MAAM,CAAC,OAAO,CAAU,KAAK,EAAE,iBAAiB,KAAK,CAAC,UAAU,IAAI,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE;QAC5G,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;KACpC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/exposure/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/exposure/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,wCAAwC,CAAC;AACvD,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CryptoApisHttpClient, RequestMetadata } from "@cryptoapis-io/mcp-shared";
|
|
2
|
+
import type { ListAddressExposurePathsRequest } from "../types.js";
|
|
3
|
+
export type ListAddressExposurePathsInput = ListAddressExposurePathsRequest & RequestMetadata;
|
|
4
|
+
export declare function listAddressExposurePaths(client: CryptoApisHttpClient, input: ListAddressExposurePathsInput): Promise<import("@cryptoapis-io/mcp-shared").RequestResult<unknown>>;
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/exposure/list-address-exposure-paths/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,MAAM,6BAA6B,GAAG,+BAA+B,GAAG,eAAe,CAAC;AAE9F,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,oBAAoB,EAAE,KAAK,EAAE,6BAA6B,uEAahH"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export async function listAddressExposurePaths(client, input) {
|
|
2
|
+
return client.request("GET", `/aml/exposure/${input.blockchain}/${encodeURIComponent(input.address)}/paths`, {
|
|
3
|
+
query: {
|
|
4
|
+
context: input.context,
|
|
5
|
+
rootAddress: input.rootAddress,
|
|
6
|
+
limit: input.limit,
|
|
7
|
+
startingAfter: input.startingAfter,
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/exposure/list-address-exposure-paths/index.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,MAA4B,EAAE,KAAoC;IAC7G,OAAO,MAAM,CAAC,OAAO,CACjB,KAAK,EACL,iBAAiB,KAAK,CAAC,UAAU,IAAI,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAC9E;QACI,KAAK,EAAE;YACH,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,aAAa,EAAE,KAAK,CAAC,aAAa;SACrC;KACJ,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blockchains supported by the AML Exposure graph (Get Address Exposure, List Address
|
|
3
|
+
* Exposure Paths). Narrower than AML_SCREENABLE_BLOCKCHAINS: arbitrum, avalanche, base,
|
|
4
|
+
* optimism, tezos and kaspa have no exposure graph.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AML_EXPOSURE_BLOCKCHAINS: readonly ["ethereum", "binance-smart-chain", "ethereum-classic", "polygon", "tron", "bitcoin", "bitcoin-cash", "litecoin", "dogecoin", "dash", "zcash", "xrp", "solana"];
|
|
7
|
+
export type AmlExposureBlockchain = (typeof AML_EXPOSURE_BLOCKCHAINS)[number];
|
|
8
|
+
export type GetAddressExposureRequest = {
|
|
9
|
+
blockchain: AmlExposureBlockchain;
|
|
10
|
+
address: string;
|
|
11
|
+
};
|
|
12
|
+
export type ListAddressExposurePathsRequest = {
|
|
13
|
+
blockchain: AmlExposureBlockchain;
|
|
14
|
+
address: string;
|
|
15
|
+
rootAddress?: string;
|
|
16
|
+
limit?: number;
|
|
17
|
+
startingAfter?: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/api/exposure/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,0KAc3B,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E,MAAM,MAAM,yBAAyB,GAAG;IACpC,UAAU,EAAE,qBAAqB,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC1C,UAAU,EAAE,qBAAqB,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blockchains supported by the AML Exposure graph (Get Address Exposure, List Address
|
|
3
|
+
* Exposure Paths). Narrower than AML_SCREENABLE_BLOCKCHAINS: arbitrum, avalanche, base,
|
|
4
|
+
* optimism, tezos and kaspa have no exposure graph.
|
|
5
|
+
*/
|
|
6
|
+
export const AML_EXPOSURE_BLOCKCHAINS = [
|
|
7
|
+
"ethereum",
|
|
8
|
+
"binance-smart-chain",
|
|
9
|
+
"ethereum-classic",
|
|
10
|
+
"polygon",
|
|
11
|
+
"tron",
|
|
12
|
+
"bitcoin",
|
|
13
|
+
"bitcoin-cash",
|
|
14
|
+
"litecoin",
|
|
15
|
+
"dogecoin",
|
|
16
|
+
"dash",
|
|
17
|
+
"zcash",
|
|
18
|
+
"xrp",
|
|
19
|
+
"solana",
|
|
20
|
+
];
|
|
21
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/exposure/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACpC,UAAU;IACV,qBAAqB;IACrB,kBAAkB;IAClB,SAAS;IACT,MAAM;IACN,SAAS;IACT,cAAc;IACd,UAAU;IACV,UAAU;IACV,MAAM;IACN,OAAO;IACP,KAAK;IACL,QAAQ;CACF,CAAC"}
|
package/dist/api/index.d.ts
CHANGED
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC"}
|
package/dist/api/index.js
CHANGED
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
+
import { parseHttpCliOptions } from "@cryptoapis-io/mcp-shared";
|
|
1
2
|
import { startAmlServer } from "./server.js";
|
|
2
3
|
function getArg(name) {
|
|
3
4
|
const idx = process.argv.indexOf(`--${name}`);
|
|
4
|
-
|
|
5
|
-
return undefined;
|
|
6
|
-
return process.argv[idx + 1];
|
|
7
|
-
}
|
|
8
|
-
function hasFlag(name) {
|
|
9
|
-
return process.argv.includes(`--${name}`);
|
|
5
|
+
return idx === -1 ? undefined : process.argv[idx + 1];
|
|
10
6
|
}
|
|
11
7
|
async function main() {
|
|
12
8
|
const transport = (getArg("transport") ?? "stdio");
|
|
@@ -15,14 +11,11 @@ async function main() {
|
|
|
15
11
|
await startAmlServer({ transport: "stdio", apiKey });
|
|
16
12
|
return;
|
|
17
13
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const path = getArg("path") ?? "/mcp";
|
|
21
|
-
const stateless = hasFlag("stateless");
|
|
22
|
-
await startAmlServer({ transport: "http", host, port, path, stateless, apiKey });
|
|
14
|
+
// --host (default 127.0.0.1), --port, --path, --stateless, --auth-token / MCP_AUTH_TOKEN, --allowed-hosts
|
|
15
|
+
await startAmlServer({ transport: "http", apiKey, ...parseHttpCliOptions() });
|
|
23
16
|
}
|
|
24
17
|
main().catch((err) => {
|
|
25
|
-
console.error(err);
|
|
18
|
+
console.error(err instanceof Error ? err.message : err);
|
|
26
19
|
process.exit(1);
|
|
27
20
|
});
|
|
28
21
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,SAAS,MAAM,CAAC,IAAY;IACxB,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC9C,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,SAAS,MAAM,CAAC,IAAY;IACxB,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC9C,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,KAAK,UAAU,IAAI;IACf,MAAM,SAAS,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,OAAO,CAAqB,CAAC;IACvE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IACjC,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;QACxB,MAAM,cAAc,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QACrD,OAAO;IACX,CAAC;IACD,0GAA0G;IAC1G,MAAM,cAAc,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,mBAAmB,EAAE,EAAE,CAAC,CAAC;AAClF,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiDvD"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -21,5 +21,23 @@ export function registerPrompts(server) {
|
|
|
21
21
|
},
|
|
22
22
|
],
|
|
23
23
|
}));
|
|
24
|
+
server.registerPrompt("check-address-exposure", {
|
|
25
|
+
description: "Check a blockchain address's exposure to risky entities via the AML exposure graph (200,000 credits per request; 100,000 credits per page for paths)",
|
|
26
|
+
argsSchema: {
|
|
27
|
+
blockchain: z.string().describe("Blockchain protocol - one of the exposure-supported chains"),
|
|
28
|
+
address: z.string().describe("Blockchain address to check exposure for"),
|
|
29
|
+
rootAddress: z.string().optional().describe("Only return routes originating from this flagged root address"),
|
|
30
|
+
},
|
|
31
|
+
}, (args) => ({
|
|
32
|
+
messages: [
|
|
33
|
+
{
|
|
34
|
+
role: "user",
|
|
35
|
+
content: {
|
|
36
|
+
type: "text",
|
|
37
|
+
text: `Use the aml tool with action get-address-exposure to check address ${args.address} on ${args.blockchain} for exposure to risky entities (200,000 credits). Then use action list-address-exposure-paths (100,000 credits per page${args.rootAddress ? `, rootAddress ${args.rootAddress}` : ""}) to list the connecting paths, passing the response's nextStartingAfter back as startingAfter to page through all results. Report the exposure categories, risk levels, and the paths found.\n\n${formatAmlCapabilities(supportedCapabilities)}`,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
}));
|
|
24
42
|
}
|
|
25
43
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAEtG,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC7C,MAAM,CAAC,cAAc,CACjB,gBAAgB,EAChB;QACI,WAAW,EAAE,2DAA2D;QACxE,UAAU,EAAE;YACR,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;YACvE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6DAA6D,CAAC;YACzG,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;SACnH;KACJ,EACD,CAAC,IAAI,EAAmB,EAAE,CAAC,CAAC;QACxB,QAAQ,EAAE;YACN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qB,CAAC,qBAAqB,CAAC,EAAE;wBAChS,CAAC,CAAC,gEAAgE,IAAI,CAAC,OAAO,yFAAyF,qBAAqB,CAAC,qBAAqB,CAAC,EAAE;iBAC5N;aACJ;SACJ;KACJ,CAAC,CACL,CAAC;IAEF,MAAM,CAAC,cAAc,CACjB,wBAAwB,EACxB;QACI,WAAW,EACP,sJAAsJ;QAC1J,UAAU,EAAE;YACR,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;YAC7F,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;YACxE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+DAA+D,CAAC;SAC/G;KACJ,EACD,CAAC,IAAI,EAAmB,EAAE,CAAC,CAAC;QACxB,QAAQ,EAAE;YACN;gBACI,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACL,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,sEAAsE,IAAI,CAAC,OAAO,OAAO,IAAI,CAAC,UAAU,2HAA2H,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,oMAAoM,qBAAqB,CAAC,qBAAqB,CAAC,EAAE;iBACzhB;aACJ;SACJ;KACJ,CAAC,CACL,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKzE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAkBzD"}
|
package/dist/resources/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { supportedCapabilities } from "./supported-capabilities.js";
|
|
2
2
|
const RESOURCE_URI = "cryptoapis://aml/supported-capabilities";
|
|
3
3
|
export function registerResources(server) {
|
|
4
|
-
server.registerResource("supported-capabilities", RESOURCE_URI, {
|
|
4
|
+
server.registerResource("supported-capabilities", RESOURCE_URI, {
|
|
5
|
+
description: "Available AML tools, actions, and the blockchains screen-transaction and the exposure actions support",
|
|
6
|
+
}, (uri) => ({
|
|
5
7
|
contents: [
|
|
6
8
|
{
|
|
7
9
|
uri: uri.href,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,YAAY,GAAG,yCAAyC,CAAC;AAE/D,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IAC/C,MAAM,CAAC,gBAAgB,CACnB,wBAAwB,EACxB,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,MAAM,YAAY,GAAG,yCAAyC,CAAC;AAE/D,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IAC/C,MAAM,CAAC,gBAAgB,CACnB,wBAAwB,EACxB,YAAY,EACZ;QACI,WAAW,EACP,uGAAuG;KAC9G,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACN,QAAQ,EAAE;YACN;gBACI,GAAG,EAAE,GAAG,CAAC,IAAI;gBACb,QAAQ,EAAE,kBAAkB;gBAC5B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;aACvD;SACJ;KACJ,CAAC,CACL,CAAC;AACN,CAAC"}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
* Static resource describing the AML capabilities available in this package.
|
|
3
3
|
*
|
|
4
4
|
* verify-address has no blockchain parameter (address format alone identifies the chain);
|
|
5
|
-
* screen-transaction requires an explicit blockchain from AML_SCREENABLE_BLOCKCHAINS
|
|
5
|
+
* screen-transaction requires an explicit blockchain from AML_SCREENABLE_BLOCKCHAINS;
|
|
6
|
+
* get-address-exposure and list-address-exposure-paths require a blockchain from the
|
|
7
|
+
* narrower AML_EXPOSURE_BLOCKCHAINS (no exposure graph for arbitrum, avalanche, base,
|
|
8
|
+
* optimism, tezos or kaspa).
|
|
6
9
|
*/
|
|
7
10
|
export type AmlCapability = {
|
|
8
11
|
tool: string;
|
|
@@ -17,6 +20,7 @@ export type AmlCapability = {
|
|
|
17
20
|
export type SupportedCapabilitiesResource = {
|
|
18
21
|
description: string;
|
|
19
22
|
screenableBlockchains: readonly string[];
|
|
23
|
+
exposureBlockchains: readonly string[];
|
|
20
24
|
capabilities: readonly AmlCapability[];
|
|
21
25
|
};
|
|
22
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supported-capabilities.d.ts","sourceRoot":"","sources":["../../src/resources/supported-capabilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"supported-capabilities.d.ts","sourceRoot":"","sources":["../../src/resources/supported-capabilities.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,MAAM,MAAM,aAAa,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;QAClC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;KACtC,EAAE,CAAC;CACP,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,YAAY,EAAE,SAAS,aAAa,EAAE,CAAC;CAC1C,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,6BAA6B,GAAG,MAAM,CAejF;AAED,eAAO,MAAM,qBAAqB,EAAE,6BAkCnC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AML_SCREENABLE_BLOCKCHAINS } from "../api/transactions/screen-transaction/types.js";
|
|
2
|
+
import { AML_EXPOSURE_BLOCKCHAINS } from "../api/exposure/types.js";
|
|
2
3
|
/**
|
|
3
4
|
* Format AML capabilities as human-readable text for embedding in prompt output.
|
|
4
5
|
*/
|
|
@@ -12,11 +13,13 @@ export function formatAmlCapabilities(data) {
|
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
lines.push(`\nscreen-transaction supported blockchains: ${data.screenableBlockchains.join(", ")}`);
|
|
16
|
+
lines.push(`\nget-address-exposure/list-address-exposure-paths supported blockchains: ${data.exposureBlockchains.join(", ")}`);
|
|
15
17
|
return lines.join("\n");
|
|
16
18
|
}
|
|
17
19
|
export const supportedCapabilities = {
|
|
18
|
-
description: "AML risk-screening tools for blockchain addresses and transactions. verify-address works across any supported chain from the address format alone; screen-transaction
|
|
20
|
+
description: "AML risk-screening tools for blockchain addresses and transactions. verify-address works across any supported chain from the address format alone; screen-transaction, get-address-exposure and list-address-exposure-paths require the blockchain to be specified explicitly.",
|
|
19
21
|
screenableBlockchains: AML_SCREENABLE_BLOCKCHAINS,
|
|
22
|
+
exposureBlockchains: AML_EXPOSURE_BLOCKCHAINS,
|
|
20
23
|
capabilities: [
|
|
21
24
|
{
|
|
22
25
|
tool: "aml",
|
|
@@ -32,6 +35,17 @@ export const supportedCapabilities = {
|
|
|
32
35
|
description: "Screen a transaction and its participants against AML data",
|
|
33
36
|
requiredParams: ["blockchain", "transactionHash"],
|
|
34
37
|
},
|
|
38
|
+
{
|
|
39
|
+
name: "get-address-exposure",
|
|
40
|
+
description: "Get an address's exposure to risky entities/categories in the AML exposure graph (200,000 credits per request)",
|
|
41
|
+
requiredParams: ["blockchain", "address"],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "list-address-exposure-paths",
|
|
45
|
+
description: "List the paths connecting an address to risky entities in the AML exposure graph (100,000 credits per page)",
|
|
46
|
+
requiredParams: ["blockchain", "address"],
|
|
47
|
+
optionalParams: ["rootAddress", "limit", "startingAfter"],
|
|
48
|
+
},
|
|
35
49
|
],
|
|
36
50
|
},
|
|
37
51
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supported-capabilities.js","sourceRoot":"","sources":["../../src/resources/supported-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"supported-capabilities.js","sourceRoot":"","sources":["../../src/resources/supported-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AA8BpE;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAmC;IACrE,MAAM,KAAK,GAAa,CAAC,6BAA6B,CAAC,CAAC;IACxD,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;QAChD,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;YAC/B,MAAM,MAAM,GACR,MAAM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C,cAAc,EAAE,CAAC,aAAa,EAAE,OAAO,EAAE,eAAe,CAAC;iBAC5D;aACJ;SACJ;KACJ;CACJ,CAAC"}
|
package/dist/server.d.ts
CHANGED
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAuDA,MAAM,MAAM,YAAY,GAClB;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC;IACI,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAER,wBAAsB,cAAc,CAAC,IAAI,EAAE,YAAY,iBAuBtD"}
|
package/dist/server.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
2
|
-
import express from "express";
|
|
3
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
|
-
import {
|
|
6
|
-
import { CryptoApisHttpClient, formatCreditsForDescription, loadSharedConfig, McpLogger, runWithApiKey, } from "@cryptoapis-io/mcp-shared";
|
|
3
|
+
import { CryptoApisHttpClient, formatCreditsForDescription, loadSharedConfig, McpLogger, startHttpServer } from "@cryptoapis-io/mcp-shared";
|
|
7
4
|
import { tools } from "./tools/index.js";
|
|
8
5
|
import { registerResources } from "./resources/index.js";
|
|
9
6
|
import { registerPrompts } from "./prompts/index.js";
|
|
@@ -52,40 +49,23 @@ export async function startAmlServer(opts) {
|
|
|
52
49
|
const isHttp = opts.transport === "http";
|
|
53
50
|
const cfg = loadSharedConfig({ apiKey: opts.apiKey, allowMissingApiKey: isHttp });
|
|
54
51
|
const client = new CryptoApisHttpClient(cfg);
|
|
55
|
-
const { server, logger } = buildServer(client);
|
|
56
52
|
if (opts.transport === "stdio") {
|
|
53
|
+
const { server, logger } = buildServer(client);
|
|
57
54
|
const transport = new StdioServerTransport();
|
|
58
55
|
await server.connect(transport);
|
|
59
56
|
logger.logInfo("cryptoapis-aml MCP running (stdio)");
|
|
60
57
|
return;
|
|
61
58
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
app.all(path, (req, res) => {
|
|
73
|
-
const headerApiKey = req.headers["x-api-key"];
|
|
74
|
-
if (headerApiKey && !cfg.apiKey) {
|
|
75
|
-
return runWithApiKey(headerApiKey, () => transport.handleRequest(req, res, req.body));
|
|
76
|
-
}
|
|
77
|
-
return transport.handleRequest(req, res, req.body);
|
|
78
|
-
});
|
|
79
|
-
app.get("/health", (_req, res) => res.status(200).json({ ok: true }));
|
|
80
|
-
app.listen(port, host, () => {
|
|
81
|
-
logger.logInfo(`cryptoapis-aml MCP running (http) at http://${host}:${port}${path}`);
|
|
82
|
-
logger.logInfo(`mode: ${stateless ? "stateless" : "stateful"}`);
|
|
83
|
-
if (cfg.apiKey) {
|
|
84
|
-
logger.logInfo("API key: provided at startup — x-api-key request headers will be ignored");
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
logger.logInfo("API key: not provided — each request must include x-api-key header");
|
|
88
|
-
}
|
|
59
|
+
await startHttpServer({
|
|
60
|
+
name: CRYPTOAPIS_SERVER_INFO.name,
|
|
61
|
+
createServer: () => buildServer(client).server,
|
|
62
|
+
startupApiKey: cfg.apiKey,
|
|
63
|
+
host: opts.host,
|
|
64
|
+
port: opts.port,
|
|
65
|
+
path: opts.path,
|
|
66
|
+
stateless: opts.stateless,
|
|
67
|
+
authToken: opts.authToken,
|
|
68
|
+
allowedHosts: opts.allowedHosts,
|
|
89
69
|
});
|
|
90
70
|
}
|
|
91
71
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5I,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,sBAAsB,GAAG;IAC3B,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,gBAAgB;IACvB,UAAU,EAAE,kCAAkC;IAC9C,KAAK,EAAE;QACH;YACI,GAAG,EAAE,kDAAkD;YACvD,QAAQ,EAAE,eAAe;YACzB,KAAK,EAAE,CAAC,KAAK,CAAC;YACd,KAAK,EAAE,OAAgB;SAC1B;QACD;YACI,GAAG,EAAE,wDAAwD;YAC7D,QAAQ,EAAE,eAAe;YACzB,KAAK,EAAE,CAAC,KAAK,CAAC;YACd,KAAK,EAAE,MAAe;SACzB;KACJ;CACJ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/get-address-exposure/credits.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,eAAO,MAAM,OAAO,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credits.js","sourceRoot":"","sources":["../../../../src/tools/aml/get-address-exposure/credits.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/aml/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/aml/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAsB,aAAa,EAAqB,MAAM,aAAa,CAAC;AAuBnF,eAAO,MAAM,OAAO,EAAE,UAAU,CAAC,OAAO,aAAa,CAgFpD,CAAC"}
|
package/dist/tools/aml/index.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { AmlToolSchema } from "./schema.js";
|
|
1
|
+
import { ACTION_BLOCKCHAINS, AmlToolSchema } from "./schema.js";
|
|
2
2
|
import { verifyAddress } from "../../api/addresses/verify-address/index.js";
|
|
3
3
|
import { screenTransaction } from "../../api/transactions/screen-transaction/index.js";
|
|
4
|
+
import { getAddressExposure } from "../../api/exposure/get-address-exposure/index.js";
|
|
5
|
+
import { listAddressExposurePaths } from "../../api/exposure/list-address-exposure-paths/index.js";
|
|
4
6
|
import { credits as verifyAddressCredits } from "./verify-address/credits.js";
|
|
5
7
|
import { credits as screenTransactionCredits } from "./screen-transaction/credits.js";
|
|
8
|
+
import { credits as getAddressExposureCredits } from "./get-address-exposure/credits.js";
|
|
9
|
+
import { credits as listAddressExposurePathsCredits } from "./list-address-exposure-paths/credits.js";
|
|
6
10
|
const AML_DESCRIPTION = `AML (Anti-Money Laundering) risk checks for addresses and transactions.
|
|
7
11
|
|
|
8
12
|
Actions:
|
|
9
13
|
• verify-address: Check if a blockchain address is flagged or associated with fraud, sanctions, ransomware, exploits, darknet markets, or other AML risk categories. Returns risk score, risk band, and the flagging sources.
|
|
10
14
|
• screen-transaction: Screen a transaction against AML data. Returns whether the transaction is flagged, its risk score/band, and the flagged participant addresses with their roles, scores, severities and categories.
|
|
15
|
+
• get-address-exposure: Get an address's exposure to risky entities/categories across the AML exposure graph. Params: blockchain, address. Costs 200,000 credits per request.
|
|
16
|
+
• list-address-exposure-paths: List the paths connecting an address to risky entities in the AML exposure graph. Params: blockchain, address; optional rootAddress (only return routes originating from this flagged root address), limit (1-50, defaults to 10), startingAfter (pagination cursor). Costs 100,000 credits per page - pass the response's next cursor back as startingAfter to fetch subsequent pages.
|
|
17
|
+
|
|
18
|
+
get-address-exposure and list-address-exposure-paths only support a subset of chains - see the blockchain parameter description.
|
|
11
19
|
|
|
12
20
|
Note: the credit cost of these endpoints is significant — see credits below.`;
|
|
13
21
|
export const amlTool = {
|
|
@@ -16,6 +24,8 @@ export const amlTool = {
|
|
|
16
24
|
credits: {
|
|
17
25
|
"verify-address": verifyAddressCredits,
|
|
18
26
|
"screen-transaction": screenTransactionCredits,
|
|
27
|
+
"get-address-exposure": getAddressExposureCredits,
|
|
28
|
+
"list-address-exposure-paths": listAddressExposurePathsCredits,
|
|
19
29
|
},
|
|
20
30
|
inputSchema: AmlToolSchema,
|
|
21
31
|
handler: (client, logger) => async (input) => {
|
|
@@ -40,6 +50,29 @@ export const amlTool = {
|
|
|
40
50
|
context: input.context,
|
|
41
51
|
});
|
|
42
52
|
break;
|
|
53
|
+
case "get-address-exposure":
|
|
54
|
+
if (!input.address)
|
|
55
|
+
throw new Error("address is required for get-address-exposure");
|
|
56
|
+
assertSupportedExposureBlockchain(input.action, input.blockchain);
|
|
57
|
+
result = await getAddressExposure(client, {
|
|
58
|
+
blockchain: input.blockchain,
|
|
59
|
+
address: input.address,
|
|
60
|
+
context: input.context,
|
|
61
|
+
});
|
|
62
|
+
break;
|
|
63
|
+
case "list-address-exposure-paths":
|
|
64
|
+
if (!input.address)
|
|
65
|
+
throw new Error("address is required for list-address-exposure-paths");
|
|
66
|
+
assertSupportedExposureBlockchain(input.action, input.blockchain);
|
|
67
|
+
result = await listAddressExposurePaths(client, {
|
|
68
|
+
blockchain: input.blockchain,
|
|
69
|
+
address: input.address,
|
|
70
|
+
rootAddress: input.rootAddress,
|
|
71
|
+
limit: input.limit,
|
|
72
|
+
startingAfter: input.startingAfter,
|
|
73
|
+
context: input.context,
|
|
74
|
+
});
|
|
75
|
+
break;
|
|
43
76
|
default:
|
|
44
77
|
throw new Error(`Unknown action: ${input.action}`);
|
|
45
78
|
}
|
|
@@ -67,4 +100,12 @@ export const amlTool = {
|
|
|
67
100
|
};
|
|
68
101
|
},
|
|
69
102
|
};
|
|
103
|
+
function assertSupportedExposureBlockchain(action, blockchain) {
|
|
104
|
+
if (!blockchain)
|
|
105
|
+
throw new Error(`blockchain is required for ${action}`);
|
|
106
|
+
const allowed = ACTION_BLOCKCHAINS[action];
|
|
107
|
+
if (allowed && !allowed.includes(blockchain)) {
|
|
108
|
+
throw new Error(`blockchain must be one of: ${allowed.join(", ")} (got "${blockchain}")`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
70
111
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/aml/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAqB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/aml/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAqB,MAAM,aAAa,CAAC;AACnF,OAAO,EAAE,aAAa,EA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AAI,KAAK,CAAC,mBAAoB,KAA4B,CAAC,MAAM,EAAE,CAAC,CAAC;QACnF,CAAC;QAED,MAAM,CAAC,OAAO,CAAC;YACX,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,eAAe,EAAE,MAAM,CAAC,eAAe;SAC1C,CAAC,CAAC;QAEH,OAAO;YACH,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACjB,GAAI,MAAM,CAAC,IAAe;wBAC1B,eAAe,EAAE,MAAM,CAAC,eAAe;wBACvC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;wBACzC,YAAY,EAAE,MAAM,CAAC,YAAY;wBACjC,eAAe,EAAE,MAAM,CAAC,eAAe;qBAC1C,CAAC;iBACL;aACJ;SACJ,CAAC;IACN,CAAC;CACR,CAAC;AAEF,SAAS,iCAAiC,CACtC,MAAc,EACd,UAA8B;IAE9B,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,MAAM,EAAE,CAAC,CAAC;IACzE,MAAM,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,UAAU,IAAI,CAAC,CAAC;IAC9F,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../../../src/tools/aml/list-address-exposure-paths/credits.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,eAAO,MAAM,OAAO,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credits.js","sourceRoot":"","sources":["../../../../src/tools/aml/list-address-exposure-paths/credits.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC"}
|
|
@@ -1,23 +1,38 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
export declare const AmlAction: z.ZodEnum<["verify-address", "screen-transaction"]>;
|
|
2
|
+
export declare const AmlAction: z.ZodEnum<["verify-address", "screen-transaction", "get-address-exposure", "list-address-exposure-paths"]>;
|
|
3
|
+
/**
|
|
4
|
+
* Per-action blockchain restrictions narrower than the tool-wide AML_SCREENABLE_BLOCKCHAINS
|
|
5
|
+
* union below. Enforced in the tool handler as a pre-flight check, not via Zod
|
|
6
|
+
* .superRefine() (breaks inputSchema introspection in MCP clients like the Inspector).
|
|
7
|
+
*/
|
|
8
|
+
export declare const ACTION_BLOCKCHAINS: Partial<Record<string, readonly string[]>>;
|
|
3
9
|
export declare const AmlToolSchema: z.ZodObject<{
|
|
4
|
-
action: z.ZodEnum<["verify-address", "screen-transaction"]>;
|
|
10
|
+
action: z.ZodEnum<["verify-address", "screen-transaction", "get-address-exposure", "list-address-exposure-paths"]>;
|
|
5
11
|
address: z.ZodOptional<z.ZodString>;
|
|
6
12
|
blockchain: z.ZodOptional<z.ZodEnum<["ethereum", "ethereum-classic", "binance-smart-chain", "bitcoin", "bitcoin-cash", "dash", "dogecoin", "litecoin", "arbitrum", "polygon", "avalanche", "optimism", "base", "zcash", "xrp", "solana", "tezos", "kaspa", "tron"]>>;
|
|
7
13
|
transactionHash: z.ZodOptional<z.ZodString>;
|
|
14
|
+
rootAddress: z.ZodOptional<z.ZodString>;
|
|
15
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
startingAfter: z.ZodOptional<z.ZodString>;
|
|
8
17
|
} & {
|
|
9
18
|
context: z.ZodOptional<z.ZodString>;
|
|
10
19
|
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
action: "verify-address" | "screen-transaction";
|
|
20
|
+
action: "verify-address" | "screen-transaction" | "get-address-exposure" | "list-address-exposure-paths";
|
|
12
21
|
address?: string | undefined;
|
|
13
22
|
blockchain?: "ethereum" | "ethereum-classic" | "binance-smart-chain" | "bitcoin" | "bitcoin-cash" | "dash" | "dogecoin" | "litecoin" | "arbitrum" | "polygon" | "avalanche" | "optimism" | "base" | "zcash" | "xrp" | "solana" | "tezos" | "kaspa" | "tron" | undefined;
|
|
14
23
|
transactionHash?: string | undefined;
|
|
24
|
+
rootAddress?: string | undefined;
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
startingAfter?: string | undefined;
|
|
15
27
|
context?: string | undefined;
|
|
16
28
|
}, {
|
|
17
|
-
action: "verify-address" | "screen-transaction";
|
|
29
|
+
action: "verify-address" | "screen-transaction" | "get-address-exposure" | "list-address-exposure-paths";
|
|
18
30
|
address?: string | undefined;
|
|
19
31
|
blockchain?: "ethereum" | "ethereum-classic" | "binance-smart-chain" | "bitcoin" | "bitcoin-cash" | "dash" | "dogecoin" | "litecoin" | "arbitrum" | "polygon" | "avalanche" | "optimism" | "base" | "zcash" | "xrp" | "solana" | "tezos" | "kaspa" | "tron" | undefined;
|
|
20
32
|
transactionHash?: string | undefined;
|
|
33
|
+
rootAddress?: string | undefined;
|
|
34
|
+
limit?: number | undefined;
|
|
35
|
+
startingAfter?: string | undefined;
|
|
21
36
|
context?: string | undefined;
|
|
22
37
|
}>;
|
|
23
38
|
export type AmlToolInput = z.infer<typeof AmlToolSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/tools/aml/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/tools/aml/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAKzB,eAAO,MAAM,SAAS,4GAKpB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAGzE,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CO,CAAC;AAElC,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
package/dist/tools/aml/schema.js
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
2
|
import { RequestMetadataSchema } from "@cryptoapis-io/mcp-shared";
|
|
3
3
|
import { AML_SCREENABLE_BLOCKCHAINS } from "../../api/transactions/screen-transaction/types.js";
|
|
4
|
-
|
|
4
|
+
import { AML_EXPOSURE_BLOCKCHAINS } from "../../api/exposure/types.js";
|
|
5
|
+
export const AmlAction = z.enum([
|
|
6
|
+
"verify-address",
|
|
7
|
+
"screen-transaction",
|
|
8
|
+
"get-address-exposure",
|
|
9
|
+
"list-address-exposure-paths",
|
|
10
|
+
]);
|
|
11
|
+
/**
|
|
12
|
+
* Per-action blockchain restrictions narrower than the tool-wide AML_SCREENABLE_BLOCKCHAINS
|
|
13
|
+
* union below. Enforced in the tool handler as a pre-flight check, not via Zod
|
|
14
|
+
* .superRefine() (breaks inputSchema introspection in MCP clients like the Inspector).
|
|
15
|
+
*/
|
|
16
|
+
export const ACTION_BLOCKCHAINS = {
|
|
17
|
+
"get-address-exposure": AML_EXPOSURE_BLOCKCHAINS,
|
|
18
|
+
"list-address-exposure-paths": AML_EXPOSURE_BLOCKCHAINS,
|
|
19
|
+
};
|
|
5
20
|
export const AmlToolSchema = z
|
|
6
21
|
.object({
|
|
7
22
|
action: AmlAction.describe("Action to perform"),
|
|
@@ -9,16 +24,32 @@ export const AmlToolSchema = z
|
|
|
9
24
|
.string()
|
|
10
25
|
.min(1)
|
|
11
26
|
.optional()
|
|
12
|
-
.describe("Blockchain address
|
|
27
|
+
.describe("Blockchain address - required for verify-address, get-address-exposure, and list-address-exposure-paths"),
|
|
13
28
|
blockchain: z
|
|
14
29
|
.enum(AML_SCREENABLE_BLOCKCHAINS)
|
|
15
30
|
.optional()
|
|
16
|
-
.describe(`Blockchain protocol
|
|
31
|
+
.describe(`Blockchain protocol - required for screen-transaction, get-address-exposure and list-address-exposure-paths. screen-transaction accepts: ${AML_SCREENABLE_BLOCKCHAINS.join(", ")}. get-address-exposure and list-address-exposure-paths accept only: ${AML_EXPOSURE_BLOCKCHAINS.join(", ")}`),
|
|
17
32
|
transactionHash: z
|
|
18
33
|
.string()
|
|
19
34
|
.min(1)
|
|
20
35
|
.optional()
|
|
21
36
|
.describe("Transaction hash to screen against AML data - required for screen-transaction"),
|
|
37
|
+
rootAddress: z
|
|
38
|
+
.string()
|
|
39
|
+
.min(1)
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("Only return routes that originate from this flagged root address (one of the roots[].rootAddress values returned by get-address-exposure) - optional, applies to list-address-exposure-paths only"),
|
|
42
|
+
limit: z
|
|
43
|
+
.number()
|
|
44
|
+
.int()
|
|
45
|
+
.min(1)
|
|
46
|
+
.max(50)
|
|
47
|
+
.optional()
|
|
48
|
+
.describe("Number of exposure paths to return per page (1-50, defaults to 10) - applies to list-address-exposure-paths only"),
|
|
49
|
+
startingAfter: z
|
|
50
|
+
.string()
|
|
51
|
+
.optional()
|
|
52
|
+
.describe("Pagination cursor - pass the nextStartingAfter value from the previous response to fetch the next page; applies to list-address-exposure-paths only"),
|
|
22
53
|
})
|
|
23
54
|
.merge(RequestMetadataSchema);
|
|
24
55
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/tools/aml/schema.ts"],"names":[],"mappings":"AAAA,OAAO,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CAAC;IAC9F,WAAW,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACL,mMAAmM,CACtM;IACL,KAAK,EAAE,CAAC;SACH,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,EAAE;SACV,QAAQ,CACL,kHAAkH,CACrH;IACL,aAAa,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACL,qJAAqJ,CACxJ;CACR,CAAC;KACD,KAAK,CAAC,qBAAqB,CAAC,CAAC"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
export declare const tools: readonly [import("./types.js").McpToolDef<import("zod").ZodObject<{
|
|
2
|
-
action: import("zod").ZodEnum<["verify-address", "screen-transaction"]>;
|
|
2
|
+
action: import("zod").ZodEnum<["verify-address", "screen-transaction", "get-address-exposure", "list-address-exposure-paths"]>;
|
|
3
3
|
address: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
4
|
blockchain: import("zod").ZodOptional<import("zod").ZodEnum<["ethereum", "ethereum-classic", "binance-smart-chain", "bitcoin", "bitcoin-cash", "dash", "dogecoin", "litecoin", "arbitrum", "polygon", "avalanche", "optimism", "base", "zcash", "xrp", "solana", "tezos", "kaspa", "tron"]>>;
|
|
5
5
|
transactionHash: import("zod").ZodOptional<import("zod").ZodString>;
|
|
6
|
+
rootAddress: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
8
|
+
startingAfter: import("zod").ZodOptional<import("zod").ZodString>;
|
|
6
9
|
} & {
|
|
7
10
|
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
11
|
}, "strip", import("zod").ZodTypeAny, {
|
|
9
|
-
action: "verify-address" | "screen-transaction";
|
|
12
|
+
action: "verify-address" | "screen-transaction" | "get-address-exposure" | "list-address-exposure-paths";
|
|
10
13
|
address?: string | undefined;
|
|
11
14
|
blockchain?: "ethereum" | "ethereum-classic" | "binance-smart-chain" | "bitcoin" | "bitcoin-cash" | "dash" | "dogecoin" | "litecoin" | "arbitrum" | "polygon" | "avalanche" | "optimism" | "base" | "zcash" | "xrp" | "solana" | "tezos" | "kaspa" | "tron" | undefined;
|
|
12
15
|
transactionHash?: string | undefined;
|
|
16
|
+
rootAddress?: string | undefined;
|
|
17
|
+
limit?: number | undefined;
|
|
18
|
+
startingAfter?: string | undefined;
|
|
13
19
|
context?: string | undefined;
|
|
14
20
|
}, {
|
|
15
|
-
action: "verify-address" | "screen-transaction";
|
|
21
|
+
action: "verify-address" | "screen-transaction" | "get-address-exposure" | "list-address-exposure-paths";
|
|
16
22
|
address?: string | undefined;
|
|
17
23
|
blockchain?: "ethereum" | "ethereum-classic" | "binance-smart-chain" | "bitcoin" | "bitcoin-cash" | "dash" | "dogecoin" | "litecoin" | "arbitrum" | "polygon" | "avalanche" | "optimism" | "base" | "zcash" | "xrp" | "solana" | "tezos" | "kaspa" | "tron" | undefined;
|
|
18
24
|
transactionHash?: string | undefined;
|
|
25
|
+
rootAddress?: string | undefined;
|
|
26
|
+
limit?: number | undefined;
|
|
27
|
+
startingAfter?: string | undefined;
|
|
19
28
|
context?: string | undefined;
|
|
20
29
|
}>>, {
|
|
21
30
|
name: "system_info";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAC+zB,CAAC;;;eAA6H,CAAC;;;;;;;;EADz5B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cryptoapis-io/mcp-aml",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "MCP server for AML address verification and transaction screening via Crypto APIs",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Crypto APIs, Inc.",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
"cryptoapis-mcp-aml": "dist/cli.js"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"@cryptoapis-io/mcp-shared": "0.4.0",
|
|
35
36
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
36
|
-
"
|
|
37
|
-
"zod": "^3.25.0",
|
|
38
|
-
"@cryptoapis-io/mcp-shared": "0.3.0"
|
|
39
|
-
},
|
|
40
|
-
"devDependencies": {
|
|
41
|
-
"@types/express": "^5.0.6"
|
|
37
|
+
"zod": "^3.25.0"
|
|
42
38
|
},
|
|
43
39
|
"scripts": {
|
|
44
40
|
"dev": "tsx watch src/cli.ts",
|
|
45
41
|
"build": "tsc -p tsconfig.json",
|
|
46
42
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
47
43
|
"lint": "node -e \"console.log('lint: add eslint if you want')\"",
|
|
48
|
-
"test": "node
|
|
44
|
+
"test": "node --test test/*.test.mjs",
|
|
49
45
|
"clean": "rimraf dist"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "^25.0.3",
|
|
49
|
+
"typescript": "^5.5.4"
|
|
50
50
|
}
|
|
51
|
-
}
|
|
51
|
+
}
|
package/server.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.CryptoAPIs-io/mcp-aml",
|
|
4
|
-
"description": "MCP server for AML address verification
|
|
4
|
+
"description": "MCP server for AML address verification, transaction screening, and exposure checks via Crypto APIs",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/CryptoAPIs-io/cryptoapis-mcp-aml",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.3.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "@cryptoapis-io/mcp-aml",
|
|
14
|
-
"version": "0.
|
|
15
|
-
"transport": {
|
|
14
|
+
"version": "0.3.0",
|
|
15
|
+
"transport": {
|
|
16
|
+
"type": "stdio"
|
|
17
|
+
},
|
|
16
18
|
"environmentVariables": [
|
|
17
19
|
{
|
|
18
20
|
"description": "Crypto APIs API key",
|