falsifylab-alpha-mcp 0.1.0__tar.gz
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.
- falsifylab_alpha_mcp-0.1.0/PKG-INFO +68 -0
- falsifylab_alpha_mcp-0.1.0/README.md +52 -0
- falsifylab_alpha_mcp-0.1.0/falsifylab_alpha_mcp.egg-info/PKG-INFO +68 -0
- falsifylab_alpha_mcp-0.1.0/falsifylab_alpha_mcp.egg-info/SOURCES.txt +8 -0
- falsifylab_alpha_mcp-0.1.0/falsifylab_alpha_mcp.egg-info/dependency_links.txt +1 -0
- falsifylab_alpha_mcp-0.1.0/falsifylab_alpha_mcp.egg-info/entry_points.txt +2 -0
- falsifylab_alpha_mcp-0.1.0/falsifylab_alpha_mcp.egg-info/top_level.txt +1 -0
- falsifylab_alpha_mcp-0.1.0/falsifylab_alpha_mcp.py +267 -0
- falsifylab_alpha_mcp-0.1.0/pyproject.toml +29 -0
- falsifylab_alpha_mcp-0.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: falsifylab-alpha-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server surfacing FalsifyLab daily alpha (yield farms, HL vaults, insider trades, SEC 8-Ks)
|
|
5
|
+
Author-email: FalsifyLab <ops@falsifylab.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://falsifylab.com
|
|
8
|
+
Project-URL: Repository, https://github.com/falsifylab/falsifylab-alpha-mcp
|
|
9
|
+
Keywords: mcp,claude,crypto,defi,trading,alpha
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# falsifylab-alpha-mcp
|
|
18
|
+
|
|
19
|
+
MCP server surfacing FalsifyLab daily alpha to Claude Code / Cursor / any MCP-compatible client.
|
|
20
|
+
|
|
21
|
+
## Tools
|
|
22
|
+
|
|
23
|
+
- `top_yield_farms` — last 24h DeFi yield picks with realistic APY (emissions stripped)
|
|
24
|
+
- `hl_vault_leaderboard` — Hyperliquid vault leaderboard (NAV, 30d return, max DD, score)
|
|
25
|
+
- `insider_buy_clusters` — Form 4 cluster buys (3+ insiders bought same ticker)
|
|
26
|
+
- `sec8k_material_today` — material 8-K filings filtered by item code
|
|
27
|
+
- `macro_tape` — SPX/NDX/VIX/UST yields/DXY/GOLD/WTI/BTC/ETH live snapshot
|
|
28
|
+
- `etf_flow_today` — US spot BTC + ETH ETF net flows
|
|
29
|
+
- `polymarket_whale_positions` — top whale wallets + active positions
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install falsifylab-alpha-mcp
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Claude Code config
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
claude mcp add falsifylab-alpha \
|
|
41
|
+
--env FL_API_KEY=<your-key-from-falsifylab.com> \
|
|
42
|
+
-- python -m falsifylab_alpha_mcp
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or in `.mcp.json`:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"falsifylab-alpha": {
|
|
51
|
+
"command": "python",
|
|
52
|
+
"args": ["-m", "falsifylab_alpha_mcp"],
|
|
53
|
+
"env": {"FL_API_KEY": "fl_xxx"}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Pricing
|
|
60
|
+
|
|
61
|
+
- **Free** (no API key): last-24h cached data, rate-limited
|
|
62
|
+
- **Pro $19/mo** (API key): real-time, 90-day history, all filters, no rate limit
|
|
63
|
+
|
|
64
|
+
Get a key at [falsifylab.com/pro](https://falsifylab.com/pro).
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# falsifylab-alpha-mcp
|
|
2
|
+
|
|
3
|
+
MCP server surfacing FalsifyLab daily alpha to Claude Code / Cursor / any MCP-compatible client.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
- `top_yield_farms` — last 24h DeFi yield picks with realistic APY (emissions stripped)
|
|
8
|
+
- `hl_vault_leaderboard` — Hyperliquid vault leaderboard (NAV, 30d return, max DD, score)
|
|
9
|
+
- `insider_buy_clusters` — Form 4 cluster buys (3+ insiders bought same ticker)
|
|
10
|
+
- `sec8k_material_today` — material 8-K filings filtered by item code
|
|
11
|
+
- `macro_tape` — SPX/NDX/VIX/UST yields/DXY/GOLD/WTI/BTC/ETH live snapshot
|
|
12
|
+
- `etf_flow_today` — US spot BTC + ETH ETF net flows
|
|
13
|
+
- `polymarket_whale_positions` — top whale wallets + active positions
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install falsifylab-alpha-mcp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Claude Code config
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
claude mcp add falsifylab-alpha \
|
|
25
|
+
--env FL_API_KEY=<your-key-from-falsifylab.com> \
|
|
26
|
+
-- python -m falsifylab_alpha_mcp
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Or in `.mcp.json`:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"mcpServers": {
|
|
34
|
+
"falsifylab-alpha": {
|
|
35
|
+
"command": "python",
|
|
36
|
+
"args": ["-m", "falsifylab_alpha_mcp"],
|
|
37
|
+
"env": {"FL_API_KEY": "fl_xxx"}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Pricing
|
|
44
|
+
|
|
45
|
+
- **Free** (no API key): last-24h cached data, rate-limited
|
|
46
|
+
- **Pro $19/mo** (API key): real-time, 90-day history, all filters, no rate limit
|
|
47
|
+
|
|
48
|
+
Get a key at [falsifylab.com/pro](https://falsifylab.com/pro).
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
MIT
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: falsifylab-alpha-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server surfacing FalsifyLab daily alpha (yield farms, HL vaults, insider trades, SEC 8-Ks)
|
|
5
|
+
Author-email: FalsifyLab <ops@falsifylab.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://falsifylab.com
|
|
8
|
+
Project-URL: Repository, https://github.com/falsifylab/falsifylab-alpha-mcp
|
|
9
|
+
Keywords: mcp,claude,crypto,defi,trading,alpha
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# falsifylab-alpha-mcp
|
|
18
|
+
|
|
19
|
+
MCP server surfacing FalsifyLab daily alpha to Claude Code / Cursor / any MCP-compatible client.
|
|
20
|
+
|
|
21
|
+
## Tools
|
|
22
|
+
|
|
23
|
+
- `top_yield_farms` — last 24h DeFi yield picks with realistic APY (emissions stripped)
|
|
24
|
+
- `hl_vault_leaderboard` — Hyperliquid vault leaderboard (NAV, 30d return, max DD, score)
|
|
25
|
+
- `insider_buy_clusters` — Form 4 cluster buys (3+ insiders bought same ticker)
|
|
26
|
+
- `sec8k_material_today` — material 8-K filings filtered by item code
|
|
27
|
+
- `macro_tape` — SPX/NDX/VIX/UST yields/DXY/GOLD/WTI/BTC/ETH live snapshot
|
|
28
|
+
- `etf_flow_today` — US spot BTC + ETH ETF net flows
|
|
29
|
+
- `polymarket_whale_positions` — top whale wallets + active positions
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install falsifylab-alpha-mcp
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Claude Code config
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
claude mcp add falsifylab-alpha \
|
|
41
|
+
--env FL_API_KEY=<your-key-from-falsifylab.com> \
|
|
42
|
+
-- python -m falsifylab_alpha_mcp
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or in `.mcp.json`:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"falsifylab-alpha": {
|
|
51
|
+
"command": "python",
|
|
52
|
+
"args": ["-m", "falsifylab_alpha_mcp"],
|
|
53
|
+
"env": {"FL_API_KEY": "fl_xxx"}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Pricing
|
|
60
|
+
|
|
61
|
+
- **Free** (no API key): last-24h cached data, rate-limited
|
|
62
|
+
- **Pro $19/mo** (API key): real-time, 90-day history, all filters, no rate limit
|
|
63
|
+
|
|
64
|
+
Get a key at [falsifylab.com/pro](https://falsifylab.com/pro).
|
|
65
|
+
|
|
66
|
+
## License
|
|
67
|
+
|
|
68
|
+
MIT
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
falsifylab_alpha_mcp.py
|
|
3
|
+
pyproject.toml
|
|
4
|
+
falsifylab_alpha_mcp.egg-info/PKG-INFO
|
|
5
|
+
falsifylab_alpha_mcp.egg-info/SOURCES.txt
|
|
6
|
+
falsifylab_alpha_mcp.egg-info/dependency_links.txt
|
|
7
|
+
falsifylab_alpha_mcp.egg-info/entry_points.txt
|
|
8
|
+
falsifylab_alpha_mcp.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
falsifylab_alpha_mcp
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""falsifylab-alpha-mcp — MCP server for Claude/Cursor surfacing
|
|
3
|
+
FalsifyLab daily alpha (yield farms, HL vaults, insider trades, SEC 8-Ks).
|
|
4
|
+
|
|
5
|
+
Architecture:
|
|
6
|
+
- MCP server (this file) runs LOCALLY on user's machine via stdio
|
|
7
|
+
- Server calls backend at https://api.falsifylab.com (Cloudflare Worker)
|
|
8
|
+
- Backend serves cached data: latest_yields, hl_vaults, insider_buys,
|
|
9
|
+
sec8k_today, macro_tape, etc.
|
|
10
|
+
- Free tier: read-only access to last-24h aggregated cached data
|
|
11
|
+
- Paid tier ($19/mo): real-time + extended history + filters
|
|
12
|
+
|
|
13
|
+
Install (end user):
|
|
14
|
+
pip install falsifylab-alpha-mcp
|
|
15
|
+
# Claude Code mcp config:
|
|
16
|
+
# claude mcp add falsifylab-alpha --env FL_API_KEY=<your-key>
|
|
17
|
+
# or in .mcp.json:
|
|
18
|
+
# {"mcpServers": {"falsifylab-alpha": {
|
|
19
|
+
# "command": "python", "args": ["-m", "falsifylab_alpha_mcp"],
|
|
20
|
+
# "env": {"FL_API_KEY": "fl_xxx"}
|
|
21
|
+
# }}}
|
|
22
|
+
"""
|
|
23
|
+
from __future__ import annotations
|
|
24
|
+
import json
|
|
25
|
+
import os
|
|
26
|
+
import sys
|
|
27
|
+
import urllib.error
|
|
28
|
+
import urllib.request
|
|
29
|
+
from typing import Any
|
|
30
|
+
|
|
31
|
+
VERSION = "0.1.0"
|
|
32
|
+
API_BASE = os.environ.get("FL_API_BASE", "https://api.falsifylab.com")
|
|
33
|
+
API_KEY = os.environ.get("FL_API_KEY", "")
|
|
34
|
+
USER_AGENT = f"falsifylab-alpha-mcp/{VERSION}"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# ===== MCP protocol scaffold (JSON-RPC over stdio) =====
|
|
38
|
+
|
|
39
|
+
def _send(obj: dict) -> None:
|
|
40
|
+
sys.stdout.write(json.dumps(obj) + "\n")
|
|
41
|
+
sys.stdout.flush()
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _recv() -> dict | None:
|
|
45
|
+
line = sys.stdin.readline()
|
|
46
|
+
if not line:
|
|
47
|
+
return None
|
|
48
|
+
return json.loads(line)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _api_get(path: str, params: dict | None = None) -> dict:
|
|
52
|
+
if params:
|
|
53
|
+
from urllib.parse import urlencode
|
|
54
|
+
path = f"{path}?{urlencode(params)}"
|
|
55
|
+
req = urllib.request.Request(
|
|
56
|
+
f"{API_BASE}{path}",
|
|
57
|
+
headers={
|
|
58
|
+
"User-Agent": USER_AGENT,
|
|
59
|
+
"Accept": "application/json",
|
|
60
|
+
**({"Authorization": f"Bearer {API_KEY}"} if API_KEY else {}),
|
|
61
|
+
},
|
|
62
|
+
)
|
|
63
|
+
try:
|
|
64
|
+
with urllib.request.urlopen(req, timeout=20) as r:
|
|
65
|
+
return json.loads(r.read())
|
|
66
|
+
except urllib.error.HTTPError as e:
|
|
67
|
+
body = e.read().decode(errors="ignore")[:400]
|
|
68
|
+
return {"error": f"HTTP {e.code}: {body}"}
|
|
69
|
+
except Exception as e:
|
|
70
|
+
return {"error": str(e)[:200]}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# ===== Tool definitions =====
|
|
74
|
+
|
|
75
|
+
TOOLS = [
|
|
76
|
+
{
|
|
77
|
+
"name": "top_yield_farms",
|
|
78
|
+
"description": "Latest 24h top DeFi yield farm picks with realistic "
|
|
79
|
+
"APY (emissions stripped), risk notes, TVL, protocol. "
|
|
80
|
+
"Sourced from FalsifyLab daily aggregator.",
|
|
81
|
+
"inputSchema": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"properties": {
|
|
84
|
+
"limit": {"type": "integer", "default": 10,
|
|
85
|
+
"description": "max results (1-50)"},
|
|
86
|
+
"min_apy": {"type": "number", "default": 0,
|
|
87
|
+
"description": "filter floor in pct"},
|
|
88
|
+
"asset": {"type": "string",
|
|
89
|
+
"description": "filter by asset symbol (BTC, ETH, SOL, etc.)"},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "hl_vault_leaderboard",
|
|
95
|
+
"description": "Hyperliquid vault leaderboard with NAV, 30d return, "
|
|
96
|
+
"max drawdown, follower count, composite score. "
|
|
97
|
+
"Real-time scrape of HL info API.",
|
|
98
|
+
"inputSchema": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"properties": {
|
|
101
|
+
"limit": {"type": "integer", "default": 10},
|
|
102
|
+
"sort_by": {"type": "string",
|
|
103
|
+
"enum": ["score", "tvl", "return_30d", "followers"],
|
|
104
|
+
"default": "score"},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "insider_buy_clusters",
|
|
110
|
+
"description": "Form 4 insider buy clusters (3+ insiders bought same "
|
|
111
|
+
"ticker in 24-48h). Bullish signal. Filtered to "
|
|
112
|
+
"open-market purchases (P code), excluding awards/gifts.",
|
|
113
|
+
"inputSchema": {
|
|
114
|
+
"type": "object",
|
|
115
|
+
"properties": {
|
|
116
|
+
"window_hours": {"type": "integer", "default": 24},
|
|
117
|
+
"min_insiders": {"type": "integer", "default": 3},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "sec8k_material_today",
|
|
123
|
+
"description": "Material SEC 8-K filings today filtered by item code: "
|
|
124
|
+
"2.02 (earnings), 5.02 (officer change), 2.01 (M&A), "
|
|
125
|
+
"3.02 (dilution), 4.02 (restatement), 3.01 (delisting).",
|
|
126
|
+
"inputSchema": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"properties": {
|
|
129
|
+
"items": {"type": "array", "items": {"type": "string"},
|
|
130
|
+
"description": "item codes (e.g. ['2.02','5.02'])"},
|
|
131
|
+
"ticker": {"type": "string",
|
|
132
|
+
"description": "filter by ticker symbol"},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "macro_tape",
|
|
138
|
+
"description": "Live US macro snapshot: SPX, NDX, RUT, VIX, UST 2y/10y, "
|
|
139
|
+
"DXY, GOLD, WTI, BTC, ETH. Last price + 1d/5d % change.",
|
|
140
|
+
"inputSchema": {
|
|
141
|
+
"type": "object",
|
|
142
|
+
"properties": {
|
|
143
|
+
"symbols": {"type": "array", "items": {"type": "string"}},
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"name": "etf_flow_today",
|
|
149
|
+
"description": "US-listed spot crypto ETF aggregate flows today. "
|
|
150
|
+
"BTC + ETH net flow, 5d streak, cumulative AUM. "
|
|
151
|
+
"Source: SoSoValue.",
|
|
152
|
+
"inputSchema": {"type": "object", "properties": {}},
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "active_airdrop_farms",
|
|
156
|
+
"description": "Active airdrop / points-farming opportunities. "
|
|
157
|
+
"Detected from DefiLlama yield gaps (where reported "
|
|
158
|
+
"APY exceeds base+rewards = likely points program). "
|
|
159
|
+
"Includes realistic APY, TVL, capital required, "
|
|
160
|
+
"confidence score. Sourced from Suki defi_scanner.",
|
|
161
|
+
"inputSchema": {
|
|
162
|
+
"type": "object",
|
|
163
|
+
"properties": {
|
|
164
|
+
"limit": {"type": "integer", "default": 10},
|
|
165
|
+
"min_apy": {"type": "number", "default": 0,
|
|
166
|
+
"description": "filter floor pct (realistic APY)"},
|
|
167
|
+
"min_tvl_usd": {"type": "number", "default": 0,
|
|
168
|
+
"description": "filter pools <X TVL"},
|
|
169
|
+
"chain": {"type": "string",
|
|
170
|
+
"description": "filter (ethereum, base, arbitrum, etc.)"},
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"name": "polymarket_whale_positions",
|
|
176
|
+
"description": "Top Polymarket whale wallets and their current "
|
|
177
|
+
"active positions sized >$10k. Copy-trade reference.",
|
|
178
|
+
"inputSchema": {
|
|
179
|
+
"type": "object",
|
|
180
|
+
"properties": {
|
|
181
|
+
"min_position_usd": {"type": "integer", "default": 10000},
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
# ===== Tool dispatch =====
|
|
189
|
+
|
|
190
|
+
def call_tool(name: str, args: dict) -> dict:
|
|
191
|
+
if name == "top_yield_farms":
|
|
192
|
+
return _api_get("/api/yield/top", args)
|
|
193
|
+
if name == "hl_vault_leaderboard":
|
|
194
|
+
return _api_get("/api/hl_vaults", args)
|
|
195
|
+
if name == "insider_buy_clusters":
|
|
196
|
+
return _api_get("/api/form4/clusters", args)
|
|
197
|
+
if name == "sec8k_material_today":
|
|
198
|
+
return _api_get("/api/sec8k/today", args)
|
|
199
|
+
if name == "macro_tape":
|
|
200
|
+
return _api_get("/api/macro", args)
|
|
201
|
+
if name == "etf_flow_today":
|
|
202
|
+
return _api_get("/api/etf_flow", args)
|
|
203
|
+
if name == "active_airdrop_farms":
|
|
204
|
+
return _api_get("/api/airdrops", args)
|
|
205
|
+
if name == "polymarket_whale_positions":
|
|
206
|
+
return _api_get("/api/polymarket/whales", args)
|
|
207
|
+
return {"error": f"unknown tool: {name}"}
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
# ===== MCP handlers =====
|
|
211
|
+
|
|
212
|
+
def handle(req: dict) -> dict | None:
|
|
213
|
+
method = req.get("method")
|
|
214
|
+
req_id = req.get("id")
|
|
215
|
+
params = req.get("params") or {}
|
|
216
|
+
|
|
217
|
+
if method == "initialize":
|
|
218
|
+
return {
|
|
219
|
+
"jsonrpc": "2.0", "id": req_id,
|
|
220
|
+
"result": {
|
|
221
|
+
"protocolVersion": "2024-11-05",
|
|
222
|
+
"capabilities": {"tools": {}},
|
|
223
|
+
"serverInfo": {"name": "falsifylab-alpha",
|
|
224
|
+
"version": VERSION},
|
|
225
|
+
},
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if method == "tools/list":
|
|
229
|
+
return {
|
|
230
|
+
"jsonrpc": "2.0", "id": req_id,
|
|
231
|
+
"result": {"tools": TOOLS},
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if method == "tools/call":
|
|
235
|
+
name = params.get("name", "")
|
|
236
|
+
args = params.get("arguments") or {}
|
|
237
|
+
result = call_tool(name, args)
|
|
238
|
+
return {
|
|
239
|
+
"jsonrpc": "2.0", "id": req_id,
|
|
240
|
+
"result": {
|
|
241
|
+
"content": [{"type": "text",
|
|
242
|
+
"text": json.dumps(result, indent=2)[:8000]}],
|
|
243
|
+
},
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if method == "notifications/initialized":
|
|
247
|
+
return None # no response for notifications
|
|
248
|
+
|
|
249
|
+
return {
|
|
250
|
+
"jsonrpc": "2.0", "id": req_id,
|
|
251
|
+
"error": {"code": -32601, "message": f"unknown method: {method}"},
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def main() -> int:
|
|
256
|
+
while True:
|
|
257
|
+
req = _recv()
|
|
258
|
+
if req is None:
|
|
259
|
+
break
|
|
260
|
+
resp = handle(req)
|
|
261
|
+
if resp is not None:
|
|
262
|
+
_send(resp)
|
|
263
|
+
return 0
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
if __name__ == "__main__":
|
|
267
|
+
sys.exit(main())
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "falsifylab-alpha-mcp"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "MCP server surfacing FalsifyLab daily alpha (yield farms, HL vaults, insider trades, SEC 8-Ks)"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
authors = [{name = "FalsifyLab", email = "ops@falsifylab.com"}]
|
|
8
|
+
license = {text = "MIT"}
|
|
9
|
+
keywords = ["mcp", "claude", "crypto", "defi", "trading", "alpha"]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 3 - Alpha",
|
|
12
|
+
"Intended Audience :: Developers",
|
|
13
|
+
"License :: OSI Approved :: MIT License",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[project.urls]
|
|
18
|
+
Homepage = "https://falsifylab.com"
|
|
19
|
+
Repository = "https://github.com/falsifylab/falsifylab-alpha-mcp"
|
|
20
|
+
|
|
21
|
+
[project.scripts]
|
|
22
|
+
falsifylab-alpha-mcp = "falsifylab_alpha_mcp:main"
|
|
23
|
+
|
|
24
|
+
[build-system]
|
|
25
|
+
requires = ["setuptools>=68", "wheel"]
|
|
26
|
+
build-backend = "setuptools.build_meta"
|
|
27
|
+
|
|
28
|
+
[tool.setuptools]
|
|
29
|
+
py-modules = ["falsifylab_alpha_mcp"]
|