asrai-mcp-apikey 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/README.md +76 -0
- package/bin/asrai-mcp-apikey.js +92 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# asrai-mcp-apikey
|
|
2
|
+
|
|
3
|
+
Crypto market analysis MCP server for Claude Desktop — ADVANCED plan, no per-call payments.
|
|
4
|
+
|
|
5
|
+
**Zero install.** Just Node.js (already on your machine via npx).
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
**Step 1** — Add to your Claude Desktop config:
|
|
10
|
+
|
|
11
|
+
| OS | Config path |
|
|
12
|
+
|---|---|
|
|
13
|
+
| macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
14
|
+
| Windows | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
15
|
+
| Linux | `~/.config/Claude/claude_desktop_config.json` |
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"asrai": {
|
|
21
|
+
"command": "npx",
|
|
22
|
+
"args": ["-y", "asrai-mcp-apikey", "--key", "asr-<your_api_key>"]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Or** store your key in `~/.env` (loaded automatically — no `--key` arg needed):
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
ASRAI_KEY=asr-<your_api_key>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"asrai": {
|
|
38
|
+
"command": "npx",
|
|
39
|
+
"args": ["-y", "asrai-mcp-apikey"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Step 2** — Restart Claude Desktop. Done.
|
|
46
|
+
|
|
47
|
+
Get your API key at [asrai.me/agents](https://asrai.me/agents). Requires an **ADVANCED plan** subscription or free trial (10 requests).
|
|
48
|
+
|
|
49
|
+
## What you get
|
|
50
|
+
|
|
51
|
+
15+ crypto analysis tools available directly in Claude:
|
|
52
|
+
|
|
53
|
+
| Tool | What it does | Cost |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `market_overview` | Trending, gainers/losers, RSI, screeners, sentiment, narratives, cashflow | $0.095 |
|
|
56
|
+
| `technical_analysis` | ALSAT, SuperALSAT, PSAR, MACD-DEMA, AlphaTrend, TD, forecast, SMC, S/R, Elliott Wave, Ichimoku | $0.06 |
|
|
57
|
+
| `sentiment` | CBBI, CMC sentiment, AI insights | $0.015 |
|
|
58
|
+
| `forecast` | AI 3-7 day price prediction | $0.005 |
|
|
59
|
+
| `screener` | Find coins by criteria | $0.005 |
|
|
60
|
+
| `smart_money` | Order blocks, FVGs, support/resistance | $0.01 |
|
|
61
|
+
| `elliott_wave` | Elliott Wave analysis | $0.005 |
|
|
62
|
+
| `ichimoku` | Ichimoku cloud | $0.005 |
|
|
63
|
+
| `cashflow` | Capital flow data | $0.005 |
|
|
64
|
+
| `coin_info` | Stats, info, price, tags, CMC AI + auto DEX data | $0.025–$0.03 |
|
|
65
|
+
| `dexscreener` | DEX trading data | $0.005 |
|
|
66
|
+
| `chain_tokens` | Low-cap tokens on chain | $0.005 |
|
|
67
|
+
| `portfolio` | Model portfolio — investment reference | $0.005 |
|
|
68
|
+
| `channel_summary` | Latest crypto narratives | $0.005 |
|
|
69
|
+
| `indicator_guide` | Asrai indicator reference | FREE |
|
|
70
|
+
|
|
71
|
+
Costs shown reflect equivalent x402 value — included in your ADVANCED plan subscription.
|
|
72
|
+
|
|
73
|
+
## Links
|
|
74
|
+
|
|
75
|
+
- Homepage: https://asrai.me/agents
|
|
76
|
+
- GitHub: https://github.com/abuzerasr/asrai-mcp-apikey
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Asrai MCP API Key — stdio bridge for Claude Desktop / npx users.
|
|
4
|
+
*
|
|
5
|
+
* Connects to the remote Asrai MCP server via HTTP Streamable and exposes
|
|
6
|
+
* it locally over stdio so Claude Desktop can use it without a remote URL.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* npx -y asrai-mcp-apikey --key asr-<your_key>
|
|
10
|
+
* ASRAI_KEY=asr-<your_key> npx -y asrai-mcp-apikey
|
|
11
|
+
*
|
|
12
|
+
* Claude Desktop config:
|
|
13
|
+
* {
|
|
14
|
+
* "mcpServers": {
|
|
15
|
+
* "asrai": {
|
|
16
|
+
* "command": "npx",
|
|
17
|
+
* "args": ["-y", "asrai-mcp-apikey", "--key", "asr-<your_key>"]
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { config } from "dotenv";
|
|
24
|
+
import { homedir } from "os";
|
|
25
|
+
import { join } from "path";
|
|
26
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
27
|
+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
28
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
29
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
30
|
+
import {
|
|
31
|
+
ListToolsRequestSchema,
|
|
32
|
+
CallToolRequestSchema,
|
|
33
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
34
|
+
|
|
35
|
+
// Load ~/.env first, then cwd .env as fallback (same pattern as asrai-mcp)
|
|
36
|
+
config({ path: join(homedir(), ".env") });
|
|
37
|
+
config();
|
|
38
|
+
|
|
39
|
+
const REMOTE_BASE = "https://mcp-api.asrai.me";
|
|
40
|
+
|
|
41
|
+
// ── API key resolution ────────────────────────────────────────────────────────
|
|
42
|
+
|
|
43
|
+
function resolveKey() {
|
|
44
|
+
// --key asr-... flag
|
|
45
|
+
const flagIdx = process.argv.indexOf("--key");
|
|
46
|
+
if (flagIdx !== -1 && process.argv[flagIdx + 1]) {
|
|
47
|
+
return process.argv[flagIdx + 1].trim();
|
|
48
|
+
}
|
|
49
|
+
// ASRAI_KEY env var
|
|
50
|
+
if (process.env.ASRAI_KEY) return process.env.ASRAI_KEY.trim();
|
|
51
|
+
|
|
52
|
+
process.stderr.write(
|
|
53
|
+
"[asrai-mcp-apikey] ERROR: API key required.\n" +
|
|
54
|
+
" Use: npx asrai-mcp-apikey --key asr-<your_key>\n" +
|
|
55
|
+
" Or: ASRAI_KEY=asr-<your_key> npx asrai-mcp-apikey\n"
|
|
56
|
+
);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// ── Bridge ───────────────────────────────────────────────────────────────────
|
|
61
|
+
|
|
62
|
+
async function main() {
|
|
63
|
+
const key = resolveKey();
|
|
64
|
+
const remoteUrl = new URL(`${REMOTE_BASE}/mcp?key=${encodeURIComponent(key)}`);
|
|
65
|
+
|
|
66
|
+
// Connect to remote as MCP client
|
|
67
|
+
const remoteClient = new Client({ name: "asrai-bridge", version: "1.0.0" });
|
|
68
|
+
const remoteTransport = new StreamableHTTPClientTransport(remoteUrl);
|
|
69
|
+
await remoteClient.connect(remoteTransport);
|
|
70
|
+
|
|
71
|
+
// Expose locally as MCP server over stdio
|
|
72
|
+
const localServer = new Server(
|
|
73
|
+
{ name: "asrai", version: "1.0.0" },
|
|
74
|
+
{ capabilities: { tools: {} } }
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
localServer.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
78
|
+
return await remoteClient.listTools();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
localServer.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
82
|
+
return await remoteClient.callTool(request.params);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const stdio = new StdioServerTransport();
|
|
86
|
+
await localServer.connect(stdio);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
main().catch((err) => {
|
|
90
|
+
process.stderr.write(`[asrai-mcp-apikey] Fatal: ${err.message}\n`);
|
|
91
|
+
process.exit(1);
|
|
92
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "asrai-mcp-apikey",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Asrai crypto analysis MCP server — API key auth for ADVANCED plan users.",
|
|
5
|
+
"keywords": ["mcp", "crypto", "asrai", "trading", "signals", "apikey"],
|
|
6
|
+
"homepage": "https://asrai.me/agents",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/abuzerasr/asrai-mcp-apikey.git"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"bin": {
|
|
14
|
+
"asrai-mcp-apikey": "./bin/asrai-mcp-apikey.js"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"bin/asrai-mcp-apikey.js",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
25
|
+
"dotenv": "^16.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"express": "^4.21.0",
|
|
29
|
+
"pg": "^8.13.0"
|
|
30
|
+
}
|
|
31
|
+
}
|