@cryptoapis-io/mcp-aml 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 +141 -0
- package/dist/api/addresses/index.d.ts +2 -0
- package/dist/api/addresses/index.d.ts.map +1 -0
- package/dist/api/addresses/index.js +2 -0
- package/dist/api/addresses/index.js.map +1 -0
- package/dist/api/addresses/verify-address/index.d.ts +5 -0
- package/dist/api/addresses/verify-address/index.d.ts.map +1 -0
- package/dist/api/addresses/verify-address/index.js +6 -0
- package/dist/api/addresses/verify-address/index.js.map +1 -0
- package/dist/api/addresses/verify-address/types.d.ts +4 -0
- package/dist/api/addresses/verify-address/types.d.ts.map +1 -0
- package/dist/api/addresses/verify-address/types.js +2 -0
- package/dist/api/addresses/verify-address/types.js.map +1 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +3 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/transactions/index.d.ts +2 -0
- package/dist/api/transactions/index.d.ts.map +1 -0
- package/dist/api/transactions/index.js +2 -0
- package/dist/api/transactions/index.js.map +1 -0
- package/dist/api/transactions/screen-transaction/index.d.ts +5 -0
- package/dist/api/transactions/screen-transaction/index.d.ts.map +1 -0
- package/dist/api/transactions/screen-transaction/index.js +4 -0
- package/dist/api/transactions/screen-transaction/index.js.map +1 -0
- package/dist/api/transactions/screen-transaction/types.d.ts +12 -0
- package/dist/api/transactions/screen-transaction/types.d.ts.map +1 -0
- package/dist/api/transactions/screen-transaction/types.js +27 -0
- package/dist/api/transactions/screen-transaction/types.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +28 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/index.d.ts +3 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +25 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/index.d.ts +3 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +14 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/supported-capabilities.d.ts +27 -0
- package/dist/resources/supported-capabilities.d.ts.map +1 -0
- package/dist/resources/supported-capabilities.js +39 -0
- package/dist/resources/supported-capabilities.js.map +1 -0
- package/dist/server.d.ts +13 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +91 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/aml/index.d.ts +4 -0
- package/dist/tools/aml/index.d.ts.map +1 -0
- package/dist/tools/aml/index.js +70 -0
- package/dist/tools/aml/index.js.map +1 -0
- package/dist/tools/aml/schema.d.ts +24 -0
- package/dist/tools/aml/schema.d.ts.map +1 -0
- package/dist/tools/aml/schema.js +24 -0
- package/dist/tools/aml/schema.js.map +1 -0
- package/dist/tools/aml/screen-transaction/credits.d.ts +3 -0
- package/dist/tools/aml/screen-transaction/credits.d.ts.map +1 -0
- package/dist/tools/aml/screen-transaction/credits.js +3 -0
- package/dist/tools/aml/screen-transaction/credits.js.map +1 -0
- package/dist/tools/aml/verify-address/credits.d.ts +3 -0
- package/dist/tools/aml/verify-address/credits.d.ts.map +1 -0
- package/dist/tools/aml/verify-address/credits.js +3 -0
- package/dist/tools/aml/verify-address/credits.js.map +1 -0
- package/dist/tools/index.d.ts +42 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/types.d.ts +15 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/package.json +51 -0
- package/server.json +27 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Crypto APIs, Inc.
|
|
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,141 @@
|
|
|
1
|
+
# @cryptoapis-io/mcp-aml
|
|
2
|
+
|
|
3
|
+
MCP server for [Crypto APIs](https://cryptoapis.io/) AML (Anti-Money Laundering) product. Verify addresses and screen transactions for fraud, sanctions, and other AML risk categories.
|
|
4
|
+
|
|
5
|
+
> **API Version:** Compatible with Crypto APIs version **2024-12-12**
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Verify whether an address is flagged or associated with fraud, sanctions, ransomware, exploits, darknet markets, or other AML risk categories
|
|
10
|
+
- Screen a transaction and its participants against AML data, returning risk score, risk band, and flagged addresses with roles/categories/severity
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
- Node.js 18+
|
|
15
|
+
- [Crypto APIs](https://cryptoapis.io/) account and API key ([sign up](https://app.cryptoapis.io/signup) | [get API key](https://app.cryptoapis.io/api-keys))
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @cryptoapis-io/mcp-aml
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Or install all Crypto APIs MCP servers: `npm install @cryptoapis-io/mcp`
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# Run with API key
|
|
29
|
+
npx @cryptoapis-io/mcp-aml --api-key YOUR_API_KEY
|
|
30
|
+
|
|
31
|
+
# Or use environment variable
|
|
32
|
+
export CRYPTOAPIS_API_KEY=YOUR_API_KEY
|
|
33
|
+
npx @cryptoapis-io/mcp-aml
|
|
34
|
+
|
|
35
|
+
# HTTP transport
|
|
36
|
+
npx @cryptoapis-io/mcp-aml --transport http --port 3000 --api-key YOUR_API_KEY
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Claude Desktop
|
|
40
|
+
|
|
41
|
+
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS, `%APPDATA%\Claude\claude_desktop_config.json` on Windows):
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"mcpServers": {
|
|
46
|
+
"cryptoapis-aml": {
|
|
47
|
+
"command": "npx",
|
|
48
|
+
"args": ["-y", "@cryptoapis-io/mcp-aml"],
|
|
49
|
+
"env": {
|
|
50
|
+
"CRYPTOAPIS_API_KEY": "your_api_key_here"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Cursor
|
|
58
|
+
|
|
59
|
+
Add to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global):
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"cryptoapis-aml": {
|
|
65
|
+
"command": "npx",
|
|
66
|
+
"args": ["-y", "@cryptoapis-io/mcp-aml"],
|
|
67
|
+
"env": {
|
|
68
|
+
"CRYPTOAPIS_API_KEY": "your_api_key_here"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### MCP Inspector
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npx @modelcontextprotocol/inspector npx @cryptoapis-io/mcp-aml --api-key YOUR_API_KEY
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### n8n
|
|
82
|
+
|
|
83
|
+
1. Start the server in HTTP mode:
|
|
84
|
+
```bash
|
|
85
|
+
npx @cryptoapis-io/mcp-aml --transport http --port 3000 --api-key YOUR_API_KEY
|
|
86
|
+
```
|
|
87
|
+
2. In your n8n workflow, add an **AI Agent** node
|
|
88
|
+
3. Under **Tools**, add an **MCP Client Tool** and set the URL to `http://localhost:3000/mcp`
|
|
89
|
+
|
|
90
|
+
> All servers default to port 3000. Use `--port` to assign different ports when running multiple servers.
|
|
91
|
+
|
|
92
|
+
## Available Tools
|
|
93
|
+
|
|
94
|
+
### `aml`
|
|
95
|
+
|
|
96
|
+
| Action | Description |
|
|
97
|
+
|--------|-------------|
|
|
98
|
+
| `verify-address` | Check if an address is flagged for fraud, sanctions, or other AML risk categories. Params: `address` |
|
|
99
|
+
| `screen-transaction` | Screen a transaction and its participants against AML data. Params: `blockchain`, `transactionHash` |
|
|
100
|
+
|
|
101
|
+
`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
|
+
|
|
103
|
+
> **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.
|
|
104
|
+
|
|
105
|
+
## CLI Arguments
|
|
106
|
+
|
|
107
|
+
| Argument | Description | Default |
|
|
108
|
+
|----------|-------------|---------|
|
|
109
|
+
| `--api-key` | Crypto APIs API key | `CRYPTOAPIS_API_KEY` env var |
|
|
110
|
+
| `--transport` | Transport type: `stdio` or `http` | `stdio` |
|
|
111
|
+
| `--host` | HTTP host | `0.0.0.0` |
|
|
112
|
+
| `--port` | HTTP port | `3000` |
|
|
113
|
+
| `--path` | HTTP path | `/mcp` |
|
|
114
|
+
| `--stateless` | Enable stateless HTTP mode | `false` |
|
|
115
|
+
|
|
116
|
+
### HTTP API Key Modes
|
|
117
|
+
|
|
118
|
+
When using HTTP transport, the server supports two API key modes:
|
|
119
|
+
|
|
120
|
+
- **With `--api-key`:** The key is used for all requests. `x-api-key` request headers are ignored.
|
|
121
|
+
- **Without `--api-key`:** Each request must include an `x-api-key` header with a valid Crypto APIs key. This enables hosting a public server where each user provides their own key.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Per-request key mode (multi-tenant)
|
|
125
|
+
npx @cryptoapis-io/mcp-aml --transport http --port 3000
|
|
126
|
+
# Clients send x-api-key header with each request
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
> Stdio transport always requires an API key at startup.
|
|
130
|
+
|
|
131
|
+
## Important: API Key Required
|
|
132
|
+
|
|
133
|
+
> **Warning:** Making requests without a valid API key — or with an incorrect one — may result in your IP being banned from the Crypto APIs ecosystem. Always ensure a valid API key is configured before starting any server.
|
|
134
|
+
|
|
135
|
+
## Remote MCP Server
|
|
136
|
+
|
|
137
|
+
Crypto APIs provides an official remote MCP server with all tools available via HTTP Streamable transport at [https://ai.cryptoapis.io/mcp](https://ai.cryptoapis.io/mcp). Pass your API key via the `x-api-key` header — no installation required.
|
|
138
|
+
|
|
139
|
+
## License
|
|
140
|
+
|
|
141
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/addresses/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/addresses/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CryptoApisHttpClient, RequestMetadata } from "@cryptoapis-io/mcp-shared";
|
|
2
|
+
import type { VerifyAddressRequest } from "./types.js";
|
|
3
|
+
export type VerifyAddressInput = VerifyAddressRequest & RequestMetadata;
|
|
4
|
+
export declare function verifyAddress(client: CryptoApisHttpClient, input: VerifyAddressInput): 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/addresses/verify-address/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG,eAAe,CAAC;AAExE,wBAAsB,aAAa,CAAC,MAAM,EAAE,oBAAoB,EAAE,KAAK,EAAE,kBAAkB,uEAI1F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/addresses/verify-address/index.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAA4B,EAAE,KAAyB;IACvF,OAAO,MAAM,CAAC,OAAO,CAAU,KAAK,EAAE,kBAAkB,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE;QACzF,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE;KACpC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/api/addresses/verify-address/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/addresses/verify-address/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/transactions/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/transactions/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CryptoApisHttpClient, RequestMetadata } from "@cryptoapis-io/mcp-shared";
|
|
2
|
+
import type { ScreenTransactionRequest } from "./types.js";
|
|
3
|
+
export type ScreenTransactionInput = ScreenTransactionRequest & RequestMetadata;
|
|
4
|
+
export declare function screenTransaction(client: CryptoApisHttpClient, input: ScreenTransactionInput): 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/transactions/screen-transaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D,MAAM,MAAM,sBAAsB,GAAG,wBAAwB,GAAG,eAAe,CAAC;AAEhF,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,oBAAoB,EAAE,KAAK,EAAE,sBAAsB,uEAMlG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/transactions/screen-transaction/index.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAA4B,EAAE,KAA6B;IAC/F,OAAO,MAAM,CAAC,OAAO,CACjB,KAAK,EACL,qBAAqB,KAAK,CAAC,UAAU,IAAI,kBAAkB,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,EACpF,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CACxC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blockchains supported by AML Screen Transaction — the widest per-endpoint enum in the API.
|
|
3
|
+
* Kept local to this package: mcp-shared's BLOCKCHAIN_NETWORKS does not yet include
|
|
4
|
+
* xrp, solana, tezos, or kaspa, and this endpoint has no network dimension.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AML_SCREENABLE_BLOCKCHAINS: readonly ["ethereum", "ethereum-classic", "binance-smart-chain", "bitcoin", "bitcoin-cash", "dash", "dogecoin", "litecoin", "arbitrum", "polygon", "avalanche", "optimism", "base", "zcash", "xrp", "solana", "tezos", "kaspa", "tron"];
|
|
7
|
+
export type AmlScreenableBlockchain = (typeof AML_SCREENABLE_BLOCKCHAINS)[number];
|
|
8
|
+
export type ScreenTransactionRequest = {
|
|
9
|
+
blockchain: AmlScreenableBlockchain;
|
|
10
|
+
transactionHash: string;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/api/transactions/screen-transaction/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,yOAoB7B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF,MAAM,MAAM,wBAAwB,GAAG;IACnC,UAAU,EAAE,uBAAuB,CAAC;IACpC,eAAe,EAAE,MAAM,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blockchains supported by AML Screen Transaction — the widest per-endpoint enum in the API.
|
|
3
|
+
* Kept local to this package: mcp-shared's BLOCKCHAIN_NETWORKS does not yet include
|
|
4
|
+
* xrp, solana, tezos, or kaspa, and this endpoint has no network dimension.
|
|
5
|
+
*/
|
|
6
|
+
export const AML_SCREENABLE_BLOCKCHAINS = [
|
|
7
|
+
"ethereum",
|
|
8
|
+
"ethereum-classic",
|
|
9
|
+
"binance-smart-chain",
|
|
10
|
+
"bitcoin",
|
|
11
|
+
"bitcoin-cash",
|
|
12
|
+
"dash",
|
|
13
|
+
"dogecoin",
|
|
14
|
+
"litecoin",
|
|
15
|
+
"arbitrum",
|
|
16
|
+
"polygon",
|
|
17
|
+
"avalanche",
|
|
18
|
+
"optimism",
|
|
19
|
+
"base",
|
|
20
|
+
"zcash",
|
|
21
|
+
"xrp",
|
|
22
|
+
"solana",
|
|
23
|
+
"tezos",
|
|
24
|
+
"kaspa",
|
|
25
|
+
"tron",
|
|
26
|
+
];
|
|
27
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/api/transactions/screen-transaction/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACtC,UAAU;IACV,kBAAkB;IAClB,qBAAqB;IACrB,SAAS;IACT,cAAc;IACd,MAAM;IACN,UAAU;IACV,UAAU;IACV,UAAU;IACV,SAAS;IACT,WAAW;IACX,UAAU;IACV,MAAM;IACN,OAAO;IACP,KAAK;IACL,QAAQ;IACR,OAAO;IACP,OAAO;IACP,MAAM;CACA,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { startAmlServer } from "./server.js";
|
|
2
|
+
function getArg(name) {
|
|
3
|
+
const idx = process.argv.indexOf(`--${name}`);
|
|
4
|
+
if (idx === -1)
|
|
5
|
+
return undefined;
|
|
6
|
+
return process.argv[idx + 1];
|
|
7
|
+
}
|
|
8
|
+
function hasFlag(name) {
|
|
9
|
+
return process.argv.includes(`--${name}`);
|
|
10
|
+
}
|
|
11
|
+
async function main() {
|
|
12
|
+
const transport = (getArg("transport") ?? "stdio");
|
|
13
|
+
const apiKey = getArg("api-key");
|
|
14
|
+
if (transport === "stdio") {
|
|
15
|
+
await startAmlServer({ transport: "stdio", apiKey });
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const host = getArg("host") ?? "0.0.0.0";
|
|
19
|
+
const port = Number(getArg("port") ?? "3000");
|
|
20
|
+
const path = getArg("path") ?? "/mcp";
|
|
21
|
+
const stateless = hasFlag("stateless");
|
|
22
|
+
await startAmlServer({ transport: "http", host, port, path, stateless, apiKey });
|
|
23
|
+
}
|
|
24
|
+
main().catch((err) => {
|
|
25
|
+
console.error(err);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +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,IAAI,GAAG,KAAK,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACjC,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,OAAO,CAAC,IAAY;IACzB,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;AAC9C,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;IAEjC,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;QACxB,MAAM,cAAc,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QACrD,OAAO;IACX,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC;IACzC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC;IACtC,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEvC,MAAM,cAAc,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;AACrF,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +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,CAyBvD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { supportedCapabilities, formatAmlCapabilities } from "../resources/supported-capabilities.js";
|
|
3
|
+
export function registerPrompts(server) {
|
|
4
|
+
server.registerPrompt("check-aml-risk", {
|
|
5
|
+
description: "Check the AML risk of a blockchain address or transaction",
|
|
6
|
+
argsSchema: {
|
|
7
|
+
address: z.string().optional().describe("Blockchain address to verify"),
|
|
8
|
+
blockchain: z.string().optional().describe("Blockchain protocol, required together with transactionHash"),
|
|
9
|
+
transactionHash: z.string().optional().describe("Transaction hash to screen, required together with blockchain"),
|
|
10
|
+
},
|
|
11
|
+
}, (args) => ({
|
|
12
|
+
messages: [
|
|
13
|
+
{
|
|
14
|
+
role: "user",
|
|
15
|
+
content: {
|
|
16
|
+
type: "text",
|
|
17
|
+
text: args.transactionHash
|
|
18
|
+
? `Use the aml tool with action screen-transaction to check transaction ${args.transactionHash} on ${args.blockchain} for AML risk. Report the risk band, risk score, and any flagged participant addresses with their roles and categories.\n\n${formatAmlCapabilities(supportedCapabilities)}`
|
|
19
|
+
: `Use the aml tool with action verify-address to check address ${args.address} for AML risk. Report the risk band, risk score, categories, and flagging sources.\n\n${formatAmlCapabilities(supportedCapabilities)}`,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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;gBACI,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE;oBACL,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,eAAe;wBACtB,CAAC,CAAC,wEAAwE,IAAI,CAAC,eAAe,OAAO,IAAI,CAAC,UAAU,8HAA8H,qBAAqB,CAAC,qBAAqB,CAAC,EAAE;wBAChS,CAAC,CAAC,gEAAgE,IAAI,CAAC,OAAO,yFAAyF,qBAAqB,CAAC,qBAAqB,CAAC,EAAE;iBAC5N;aACJ;SACJ;KACJ,CAAC,CACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +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,CAezD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { supportedCapabilities } from "./supported-capabilities.js";
|
|
2
|
+
const RESOURCE_URI = "cryptoapis://aml/supported-capabilities";
|
|
3
|
+
export function registerResources(server) {
|
|
4
|
+
server.registerResource("supported-capabilities", RESOURCE_URI, { description: "Available AML tools, actions, and the blockchains screen-transaction supports" }, (uri) => ({
|
|
5
|
+
contents: [
|
|
6
|
+
{
|
|
7
|
+
uri: uri.href,
|
|
8
|
+
mimeType: "application/json",
|
|
9
|
+
text: JSON.stringify(supportedCapabilities, null, 2),
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,EAAE,WAAW,EAAE,+EAA+E,EAAE,EAChG,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"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static resource describing the AML capabilities available in this package.
|
|
3
|
+
*
|
|
4
|
+
* verify-address has no blockchain parameter (address format alone identifies the chain);
|
|
5
|
+
* screen-transaction requires an explicit blockchain from AML_SCREENABLE_BLOCKCHAINS.
|
|
6
|
+
*/
|
|
7
|
+
export type AmlCapability = {
|
|
8
|
+
tool: string;
|
|
9
|
+
description: string;
|
|
10
|
+
actions: {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
requiredParams: readonly string[];
|
|
14
|
+
optionalParams?: readonly string[];
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
export type SupportedCapabilitiesResource = {
|
|
18
|
+
description: string;
|
|
19
|
+
screenableBlockchains: readonly string[];
|
|
20
|
+
capabilities: readonly AmlCapability[];
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Format AML capabilities as human-readable text for embedding in prompt output.
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatAmlCapabilities(data: SupportedCapabilitiesResource): string;
|
|
26
|
+
export declare const supportedCapabilities: SupportedCapabilitiesResource;
|
|
27
|
+
//# sourceMappingURL=supported-capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supported-capabilities.d.ts","sourceRoot":"","sources":["../../src/resources/supported-capabilities.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;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,YAAY,EAAE,SAAS,aAAa,EAAE,CAAC;CAC1C,CAAC;AAEF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,6BAA6B,GAAG,MAAM,CAYjF;AAED,eAAO,MAAM,qBAAqB,EAAE,6BAsBnC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AML_SCREENABLE_BLOCKCHAINS } from "../api/transactions/screen-transaction/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Format AML capabilities as human-readable text for embedding in prompt output.
|
|
4
|
+
*/
|
|
5
|
+
export function formatAmlCapabilities(data) {
|
|
6
|
+
const lines = ["Supported AML capabilities:"];
|
|
7
|
+
for (const cap of data.capabilities) {
|
|
8
|
+
lines.push(`\n${cap.tool}: ${cap.description}`);
|
|
9
|
+
for (const action of cap.actions) {
|
|
10
|
+
const params = action.requiredParams.length > 0 ? ` (requires: ${action.requiredParams.join(", ")})` : "";
|
|
11
|
+
lines.push(` • ${action.name}: ${action.description}${params}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
lines.push(`\nscreen-transaction supported blockchains: ${data.screenableBlockchains.join(", ")}`);
|
|
15
|
+
return lines.join("\n");
|
|
16
|
+
}
|
|
17
|
+
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 requires the blockchain to be specified explicitly.",
|
|
19
|
+
screenableBlockchains: AML_SCREENABLE_BLOCKCHAINS,
|
|
20
|
+
capabilities: [
|
|
21
|
+
{
|
|
22
|
+
tool: "aml",
|
|
23
|
+
description: "Check AML risk for an address or a transaction",
|
|
24
|
+
actions: [
|
|
25
|
+
{
|
|
26
|
+
name: "verify-address",
|
|
27
|
+
description: "Check if an address is flagged or associated with fraud, sanctions, or other AML risk categories",
|
|
28
|
+
requiredParams: ["address"],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "screen-transaction",
|
|
32
|
+
description: "Screen a transaction and its participants against AML data",
|
|
33
|
+
requiredParams: ["blockchain", "transactionHash"],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=supported-capabilities.js.map
|
|
@@ -0,0 +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;AA0B7F;;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,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,eAAe,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/F,KAAK,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,WAAW,GAAG,MAAM,EAAE,CAAC,CAAC;QACrE,CAAC;IACL,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,+CAA+C,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnG,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAkC;IAChE,WAAW,EACP,2NAA2N;IAC/N,qBAAqB,EAAE,0BAA0B;IACjD,YAAY,EAAE;QACV;YACI,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,gDAAgD;YAC7D,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,gBAAgB;oBACtB,WAAW,EAAE,kGAAkG;oBAC/G,cAAc,EAAE,CAAC,SAAS,CAAC;iBAC9B;gBACD;oBACI,IAAI,EAAE,oBAAoB;oBAC1B,WAAW,EAAE,4DAA4D;oBACzE,cAAc,EAAE,CAAC,YAAY,EAAE,iBAAiB,CAAC;iBACpD;aACJ;SACJ;KACJ;CACJ,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type StartOptions = {
|
|
2
|
+
transport: "stdio";
|
|
3
|
+
apiKey?: string;
|
|
4
|
+
} | {
|
|
5
|
+
transport: "http";
|
|
6
|
+
host?: string;
|
|
7
|
+
port?: number;
|
|
8
|
+
path?: string;
|
|
9
|
+
stateless?: boolean;
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function startAmlServer(opts: StartOptions): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAiEA,MAAM,MAAM,YAAY,GAClB;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/G,wBAAsB,cAAc,CAAC,IAAI,EAAE,YAAY,iBA8CtD"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import express from "express";
|
|
3
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
|
+
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
6
|
+
import { CryptoApisHttpClient, formatCreditsForDescription, loadSharedConfig, McpLogger, runWithApiKey, } from "@cryptoapis-io/mcp-shared";
|
|
7
|
+
import { tools } from "./tools/index.js";
|
|
8
|
+
import { registerResources } from "./resources/index.js";
|
|
9
|
+
import { registerPrompts } from "./prompts/index.js";
|
|
10
|
+
const CRYPTOAPIS_SERVER_INFO = {
|
|
11
|
+
name: "cryptoapis-aml",
|
|
12
|
+
version: "0.1.0",
|
|
13
|
+
title: "CryptoAPIs AML",
|
|
14
|
+
websiteUrl: "https://developers.cryptoapis.io",
|
|
15
|
+
icons: [
|
|
16
|
+
{
|
|
17
|
+
src: "https://cryptoapis.io/cryptoapis/images/logo.svg",
|
|
18
|
+
mimeType: "image/svg+xml",
|
|
19
|
+
sizes: ["any"],
|
|
20
|
+
theme: "light",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
src: "https://cryptoapis.io/cryptoapis/images/logo-black.svg",
|
|
24
|
+
mimeType: "image/svg+xml",
|
|
25
|
+
sizes: ["any"],
|
|
26
|
+
theme: "dark",
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
function buildServer(client) {
|
|
31
|
+
const server = new McpServer(CRYPTOAPIS_SERVER_INFO);
|
|
32
|
+
const logger = new McpLogger((params) => server.sendLoggingMessage(params), CRYPTOAPIS_SERVER_INFO.name);
|
|
33
|
+
for (const t of tools) {
|
|
34
|
+
const description = t.credits != null ? `${t.description}\n\n${formatCreditsForDescription(t.credits)}` : t.description;
|
|
35
|
+
server.registerTool(t.name, { description, inputSchema: t.inputSchema }, (input) => {
|
|
36
|
+
logger.logDebug({ tool: t.name, event: "tool_call", input });
|
|
37
|
+
return t.handler(client, logger)(input).catch((err) => {
|
|
38
|
+
logger.logError(err instanceof Error ? err.message : String(err), {
|
|
39
|
+
tool: t.name,
|
|
40
|
+
action: input.action,
|
|
41
|
+
blockchain: input.blockchain,
|
|
42
|
+
});
|
|
43
|
+
throw err;
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
registerResources(server);
|
|
48
|
+
registerPrompts(server);
|
|
49
|
+
return { server, logger };
|
|
50
|
+
}
|
|
51
|
+
export async function startAmlServer(opts) {
|
|
52
|
+
const isHttp = opts.transport === "http";
|
|
53
|
+
const cfg = loadSharedConfig({ apiKey: opts.apiKey, allowMissingApiKey: isHttp });
|
|
54
|
+
const client = new CryptoApisHttpClient(cfg);
|
|
55
|
+
const { server, logger } = buildServer(client);
|
|
56
|
+
if (opts.transport === "stdio") {
|
|
57
|
+
const transport = new StdioServerTransport();
|
|
58
|
+
await server.connect(transport);
|
|
59
|
+
logger.logInfo("cryptoapis-aml MCP running (stdio)");
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const host = opts.host ?? "0.0.0.0";
|
|
63
|
+
const port = opts.port ?? 3000;
|
|
64
|
+
const path = opts.path ?? "/mcp";
|
|
65
|
+
const stateless = opts.stateless ?? false;
|
|
66
|
+
const transport = new StreamableHTTPServerTransport({
|
|
67
|
+
sessionIdGenerator: stateless ? undefined : () => randomUUID(),
|
|
68
|
+
});
|
|
69
|
+
await server.connect(transport);
|
|
70
|
+
const app = express();
|
|
71
|
+
app.use(express.json({ limit: "1mb" }));
|
|
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
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACj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,GAAG,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAEtE,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE;QACxB,MAAM,CAAC,OAAO,CAAC,+CAA+C,IAAI,IAAI,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;QACrF,MAAM,CAAC,OAAO,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;QAChE,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,CAAC,OAAO,CAAC,0EAA0E,CAAC,CAAC;QAC/F,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,OAAO,CAAC,oEAAoE,CAAC,CAAC;QACzF,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +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,EAAE,aAAa,EAAqB,MAAM,aAAa,CAAC;AAc/D,eAAO,MAAM,OAAO,EAAE,UAAU,CAAC,OAAO,aAAa,CAyDpD,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { AmlToolSchema } from "./schema.js";
|
|
2
|
+
import { verifyAddress } from "../../api/addresses/verify-address/index.js";
|
|
3
|
+
import { screenTransaction } from "../../api/transactions/screen-transaction/index.js";
|
|
4
|
+
import { credits as verifyAddressCredits } from "./verify-address/credits.js";
|
|
5
|
+
import { credits as screenTransactionCredits } from "./screen-transaction/credits.js";
|
|
6
|
+
const AML_DESCRIPTION = `AML (Anti-Money Laundering) risk checks for addresses and transactions.
|
|
7
|
+
|
|
8
|
+
Actions:
|
|
9
|
+
• 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
|
+
• 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.
|
|
11
|
+
|
|
12
|
+
Note: the credit cost of these endpoints is significant — see credits below.`;
|
|
13
|
+
export const amlTool = {
|
|
14
|
+
name: "aml",
|
|
15
|
+
description: AML_DESCRIPTION,
|
|
16
|
+
credits: {
|
|
17
|
+
"verify-address": verifyAddressCredits,
|
|
18
|
+
"screen-transaction": screenTransactionCredits,
|
|
19
|
+
},
|
|
20
|
+
inputSchema: AmlToolSchema,
|
|
21
|
+
handler: (client, logger) => async (input) => {
|
|
22
|
+
let result;
|
|
23
|
+
switch (input.action) {
|
|
24
|
+
case "verify-address":
|
|
25
|
+
if (!input.address)
|
|
26
|
+
throw new Error("address is required for verify-address");
|
|
27
|
+
result = await verifyAddress(client, {
|
|
28
|
+
address: input.address,
|
|
29
|
+
context: input.context,
|
|
30
|
+
});
|
|
31
|
+
break;
|
|
32
|
+
case "screen-transaction":
|
|
33
|
+
if (!input.blockchain)
|
|
34
|
+
throw new Error("blockchain is required for screen-transaction");
|
|
35
|
+
if (!input.transactionHash)
|
|
36
|
+
throw new Error("transactionHash is required for screen-transaction");
|
|
37
|
+
result = await screenTransaction(client, {
|
|
38
|
+
blockchain: input.blockchain,
|
|
39
|
+
transactionHash: input.transactionHash,
|
|
40
|
+
context: input.context,
|
|
41
|
+
});
|
|
42
|
+
break;
|
|
43
|
+
default:
|
|
44
|
+
throw new Error(`Unknown action: ${input.action}`);
|
|
45
|
+
}
|
|
46
|
+
logger.logInfo({
|
|
47
|
+
tool: "aml",
|
|
48
|
+
action: input.action,
|
|
49
|
+
creditsConsumed: result.creditsConsumed,
|
|
50
|
+
creditsAvailable: result.creditsAvailable,
|
|
51
|
+
responseTime: result.responseTime,
|
|
52
|
+
throughputUsage: result.throughputUsage,
|
|
53
|
+
});
|
|
54
|
+
return {
|
|
55
|
+
content: [
|
|
56
|
+
{
|
|
57
|
+
type: "text",
|
|
58
|
+
text: JSON.stringify({
|
|
59
|
+
...result.data,
|
|
60
|
+
creditsConsumed: result.creditsConsumed,
|
|
61
|
+
creditsAvailable: result.creditsAvailable,
|
|
62
|
+
responseTime: result.responseTime,
|
|
63
|
+
throughputUsage: result.throughputUsage,
|
|
64
|
+
}),
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/aml/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAqB,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAEtF,MAAM,eAAe,GAAG;;;;;;6EAMqD,CAAC;AAE9E,MAAM,CAAC,MAAM,OAAO,GAAqC;IACrD,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,eAAe;IAC5B,OAAO,EAAE;QACL,gBAAgB,EAAE,oBAAoB;QACtC,oBAAoB,EAAE,wBAAwB;KACjD;IACD,WAAW,EAAE,aAAa;IAC1B,OAAO,EACH,CAAC,MAA4B,EAAE,MAAiB,EAAE,EAAE,CACpD,KAAK,EAAE,KAAmB,EAAE,EAAE;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AAM,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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const AmlAction: z.ZodEnum<["verify-address", "screen-transaction"]>;
|
|
3
|
+
export declare const AmlToolSchema: z.ZodObject<{
|
|
4
|
+
action: z.ZodEnum<["verify-address", "screen-transaction"]>;
|
|
5
|
+
address: z.ZodOptional<z.ZodString>;
|
|
6
|
+
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
|
+
transactionHash: z.ZodOptional<z.ZodString>;
|
|
8
|
+
} & {
|
|
9
|
+
context: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
action: "verify-address" | "screen-transaction";
|
|
12
|
+
address?: string | undefined;
|
|
13
|
+
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
|
+
transactionHash?: string | undefined;
|
|
15
|
+
context?: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
action: "verify-address" | "screen-transaction";
|
|
18
|
+
address?: string | undefined;
|
|
19
|
+
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
|
+
transactionHash?: string | undefined;
|
|
21
|
+
context?: string | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export type AmlToolInput = z.infer<typeof AmlToolSchema>;
|
|
24
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/tools/aml/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB,eAAO,MAAM,SAAS,qDAAmD,CAAC;AAE1E,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;EAoBO,CAAC;AAElC,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { RequestMetadataSchema } from "@cryptoapis-io/mcp-shared";
|
|
3
|
+
import { AML_SCREENABLE_BLOCKCHAINS } from "../../api/transactions/screen-transaction/types.js";
|
|
4
|
+
export const AmlAction = z.enum(["verify-address", "screen-transaction"]);
|
|
5
|
+
export const AmlToolSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
action: AmlAction.describe("Action to perform"),
|
|
8
|
+
address: z
|
|
9
|
+
.string()
|
|
10
|
+
.min(1)
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("Blockchain address to verify against AML databases - required for verify-address"),
|
|
13
|
+
blockchain: z
|
|
14
|
+
.enum(AML_SCREENABLE_BLOCKCHAINS)
|
|
15
|
+
.optional()
|
|
16
|
+
.describe(`Blockchain protocol the transaction belongs to - required for screen-transaction. One of: ${AML_SCREENABLE_BLOCKCHAINS.join(", ")}`),
|
|
17
|
+
transactionHash: z
|
|
18
|
+
.string()
|
|
19
|
+
.min(1)
|
|
20
|
+
.optional()
|
|
21
|
+
.describe("Transaction hash to screen against AML data - required for screen-transaction"),
|
|
22
|
+
})
|
|
23
|
+
.merge(RequestMetadataSchema);
|
|
24
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/tools/aml/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oDAAoD,CAAC;AAEhG,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC,CAAC;AAE1E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC;KACzB,MAAM,CAAC;IACJ,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAC/C,OAAO,EAAE,CAAC;SACL,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,kFAAkF,CAAC;IACjG,UAAU,EAAE,CAAC;SACR,IAAI,CAAC,0BAA0B,CAAC;SAChC,QAAQ,EAAE;SACV,QAAQ,CACL,6FAA6F,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACvI;IACL,eAAe,EAAE,CAAC;SACb,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,+EAA+E,CAAC;CACjG,CAAC;KACD,KAAK,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../../../src/tools/aml/screen-transaction/credits.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,eAAO,MAAM,OAAO,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credits.js","sourceRoot":"","sources":["../../../../src/tools/aml/screen-transaction/credits.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../../../src/tools/aml/verify-address/credits.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,eAAO,MAAM,OAAO,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credits.js","sourceRoot":"","sources":["../../../../src/tools/aml/verify-address/credits.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const tools: readonly [import("./types.js").McpToolDef<import("zod").ZodObject<{
|
|
2
|
+
action: import("zod").ZodEnum<["verify-address", "screen-transaction"]>;
|
|
3
|
+
address: import("zod").ZodOptional<import("zod").ZodString>;
|
|
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
|
+
transactionHash: import("zod").ZodOptional<import("zod").ZodString>;
|
|
6
|
+
} & {
|
|
7
|
+
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
9
|
+
action: "verify-address" | "screen-transaction";
|
|
10
|
+
address?: string | undefined;
|
|
11
|
+
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
|
+
transactionHash?: string | undefined;
|
|
13
|
+
context?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
action: "verify-address" | "screen-transaction";
|
|
16
|
+
address?: string | undefined;
|
|
17
|
+
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
|
+
transactionHash?: string | undefined;
|
|
19
|
+
context?: string | undefined;
|
|
20
|
+
}>>, {
|
|
21
|
+
name: "system_info";
|
|
22
|
+
credits: undefined;
|
|
23
|
+
description: string;
|
|
24
|
+
inputSchema: import("zod").ZodObject<{
|
|
25
|
+
action: import("zod").ZodEnum<["blockchains", "errors", "credits", "callbacks", "limits"]>;
|
|
26
|
+
} & {
|
|
27
|
+
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
28
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
29
|
+
action: "blockchains" | "errors" | "credits" | "callbacks" | "limits";
|
|
30
|
+
context?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
action: "blockchains" | "errors" | "credits" | "callbacks" | "limits";
|
|
33
|
+
context?: string | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
handler: (_client: import("@cryptoapis-io/mcp-shared").CryptoApisHttpClient, _logger: unknown) => (input: import("@cryptoapis-io/mcp-shared").SystemInfoInput) => Promise<{
|
|
36
|
+
content: {
|
|
37
|
+
type: "text";
|
|
38
|
+
text: string;
|
|
39
|
+
}[];
|
|
40
|
+
}>;
|
|
41
|
+
}];
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,cAAc,CAAU,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CryptoApisHttpClient, McpLogger, ToolCredits } from "@cryptoapis-io/mcp-shared";
|
|
2
|
+
import type * as z from "zod";
|
|
3
|
+
export type McpToolDef<TSchema extends z.ZodTypeAny> = {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
credits?: ToolCredits;
|
|
7
|
+
inputSchema: TSchema;
|
|
8
|
+
handler: (client: CryptoApisHttpClient, logger: McpLogger) => (input: z.infer<TSchema>) => Promise<{
|
|
9
|
+
content: {
|
|
10
|
+
type: "text";
|
|
11
|
+
text: string;
|
|
12
|
+
}[];
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC9F,OAAO,KAAK,KAAK,CAAC,MAAM,KAAK,CAAC;AAE9B,MAAM,MAAM,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,UAAU,IAAI;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,CACL,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,SAAS,KAChB,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,CAAC,CAAC;CAC5F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/tools/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cryptoapis-io/mcp-aml",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for AML address verification and transaction screening via Crypto APIs",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Crypto APIs, Inc.",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/CryptoAPIs-io/cryptoapis-mcp-aml.git"
|
|
10
|
+
},
|
|
11
|
+
"mcpName": "io.github.CryptoAPIs-io/mcp-aml",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"mcp",
|
|
14
|
+
"cryptoapis",
|
|
15
|
+
"blockchain",
|
|
16
|
+
"aml",
|
|
17
|
+
"compliance",
|
|
18
|
+
"risk-screening"
|
|
19
|
+
],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"main": "dist/index.js",
|
|
25
|
+
"types": "dist/index.d.ts",
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"README.md",
|
|
29
|
+
"server.json"
|
|
30
|
+
],
|
|
31
|
+
"bin": {
|
|
32
|
+
"cryptoapis-mcp-aml": "dist/cli.js"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
36
|
+
"express": "^4.22.1",
|
|
37
|
+
"zod": "^3.25.0",
|
|
38
|
+
"@cryptoapis-io/mcp-shared": "0.3.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/express": "^5.0.6"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"dev": "tsx watch src/cli.ts",
|
|
45
|
+
"build": "tsc -p tsconfig.json",
|
|
46
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
47
|
+
"lint": "node -e \"console.log('lint: add eslint if you want')\"",
|
|
48
|
+
"test": "node -e \"console.log('test: add later')\"",
|
|
49
|
+
"clean": "rimraf dist"
|
|
50
|
+
}
|
|
51
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.CryptoAPIs-io/mcp-aml",
|
|
4
|
+
"description": "MCP server for AML address verification and transaction screening via Crypto APIs",
|
|
5
|
+
"repository": {
|
|
6
|
+
"url": "https://github.com/CryptoAPIs-io/cryptoapis-mcp-aml",
|
|
7
|
+
"source": "github"
|
|
8
|
+
},
|
|
9
|
+
"version": "0.1.0",
|
|
10
|
+
"packages": [
|
|
11
|
+
{
|
|
12
|
+
"registryType": "npm",
|
|
13
|
+
"identifier": "@cryptoapis-io/mcp-aml",
|
|
14
|
+
"version": "0.1.0",
|
|
15
|
+
"transport": { "type": "stdio" },
|
|
16
|
+
"environmentVariables": [
|
|
17
|
+
{
|
|
18
|
+
"description": "Crypto APIs API key",
|
|
19
|
+
"isRequired": true,
|
|
20
|
+
"format": "string",
|
|
21
|
+
"isSecret": true,
|
|
22
|
+
"name": "CRYPTOAPIS_API_KEY"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|