tradingview-mcp 26.2.0__py3-none-any.whl → 26.3.1__py3-none-any.whl
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.
- tradingview_mcp/constants.py +100 -331
- tradingview_mcp/docs_data.py +41 -0
- tradingview_mcp/resources.py +63 -0
- tradingview_mcp/server.py +79 -1445
- tradingview_mcp/tools/__init__.py +0 -0
- tradingview_mcp/tools/reference.py +70 -0
- tradingview_mcp/tools/screener.py +87 -0
- tradingview_mcp/tools/search.py +350 -0
- tradingview_mcp/tools/technical.py +136 -0
- tradingview_mcp/utils.py +62 -3
- {tradingview_mcp-26.2.0.dist-info → tradingview_mcp-26.3.1.dist-info}/METADATA +10 -3
- {tradingview_mcp-26.2.0.dist-info → tradingview_mcp-26.3.1.dist-info}/RECORD +15 -9
- {tradingview_mcp-26.2.0.dist-info → tradingview_mcp-26.3.1.dist-info}/WHEEL +0 -0
- {tradingview_mcp-26.2.0.dist-info → tradingview_mcp-26.3.1.dist-info}/entry_points.txt +0 -0
- {tradingview_mcp-26.2.0.dist-info → tradingview_mcp-26.3.1.dist-info}/licenses/LICENSE +0 -0
tradingview_mcp/utils.py
CHANGED
|
@@ -54,12 +54,57 @@ def sanitize_exchange(ex: str | None, default: str = "america") -> str:
|
|
|
54
54
|
return default
|
|
55
55
|
|
|
56
56
|
|
|
57
|
+
# Country Code mappings
|
|
58
|
+
COUNTRY_ALIASES = {
|
|
59
|
+
"us": "america",
|
|
60
|
+
"usa": "america",
|
|
61
|
+
"uk": "uk",
|
|
62
|
+
"gb": "uk",
|
|
63
|
+
"de": "germany",
|
|
64
|
+
"fr": "france",
|
|
65
|
+
"it": "italy",
|
|
66
|
+
"es": "spain",
|
|
67
|
+
"pt": "portugal",
|
|
68
|
+
"ch": "switzerland",
|
|
69
|
+
"se": "sweden",
|
|
70
|
+
"no": "norway",
|
|
71
|
+
"fi": "finland",
|
|
72
|
+
"nl": "netherlands",
|
|
73
|
+
"be": "belgium",
|
|
74
|
+
"at": "austria",
|
|
75
|
+
"ie": "ireland",
|
|
76
|
+
"ru": "russia",
|
|
77
|
+
"cn": "china",
|
|
78
|
+
"jp": "japan",
|
|
79
|
+
"kr": "korea",
|
|
80
|
+
"in": "india",
|
|
81
|
+
"id": "indonesia",
|
|
82
|
+
"my": "malaysia",
|
|
83
|
+
"th": "thailand",
|
|
84
|
+
"vn": "vietnam",
|
|
85
|
+
"tw": "taiwan",
|
|
86
|
+
"sg": "singapore",
|
|
87
|
+
"hk": "hongkong",
|
|
88
|
+
"au": "australia",
|
|
89
|
+
"nz": "newzealand",
|
|
90
|
+
"ca": "canada",
|
|
91
|
+
"br": "brazil",
|
|
92
|
+
"mx": "mexico",
|
|
93
|
+
"ar": "argentina",
|
|
94
|
+
"cl": "chile",
|
|
95
|
+
"co": "colombia",
|
|
96
|
+
"pe": "peru",
|
|
97
|
+
"eg": "egypt",
|
|
98
|
+
"tr": "turkey",
|
|
99
|
+
"za": "rsa", # South Africa
|
|
100
|
+
}
|
|
101
|
+
|
|
57
102
|
def sanitize_market(market: str | None, default: str = "america") -> str:
|
|
58
103
|
"""
|
|
59
104
|
Validate and sanitize a market name.
|
|
60
|
-
|
|
105
|
+
|
|
61
106
|
Args:
|
|
62
|
-
market: Market to validate
|
|
107
|
+
market: Market to validate (e.g. 'america', 'tw', 'crypto')
|
|
63
108
|
default: Default value if invalid
|
|
64
109
|
|
|
65
110
|
Returns:
|
|
@@ -67,8 +112,22 @@ def sanitize_market(market: str | None, default: str = "america") -> str:
|
|
|
67
112
|
"""
|
|
68
113
|
if not market:
|
|
69
114
|
return default
|
|
115
|
+
|
|
70
116
|
market = market.strip().lower()
|
|
71
|
-
|
|
117
|
+
|
|
118
|
+
# Check exact match
|
|
119
|
+
if market in MARKETS:
|
|
120
|
+
return market
|
|
121
|
+
|
|
122
|
+
# Check alias match
|
|
123
|
+
if market in COUNTRY_ALIASES:
|
|
124
|
+
return COUNTRY_ALIASES[market]
|
|
125
|
+
|
|
126
|
+
# Check if user passed exchange (e.g. 'nasdaq') by mistake
|
|
127
|
+
if market in EXCHANGE_SCREENER:
|
|
128
|
+
return EXCHANGE_SCREENER[market]
|
|
129
|
+
|
|
130
|
+
return default
|
|
72
131
|
|
|
73
132
|
|
|
74
133
|
def timeframe_to_resolution(tf: str) -> str:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tradingview-mcp
|
|
3
|
-
Version: 26.
|
|
3
|
+
Version: 26.3.1
|
|
4
4
|
Summary: A comprehensive MCP server for TradingView market screening with integrated screener functionality
|
|
5
5
|
Project-URL: Homepage, https://github.com/k73a/tradingview-mcp
|
|
6
6
|
Project-URL: Documentation, https://github.com/k73a/tradingview-mcp#readme
|
|
@@ -43,7 +43,6 @@ Description-Content-Type: text/markdown
|
|
|
43
43
|
MCP server for TradingView market screening. Supports stocks, crypto, forex, futures, bonds across 76+ markets.
|
|
44
44
|
|
|
45
45
|
## Quick Start
|
|
46
|
-
|
|
47
46
|
```json
|
|
48
47
|
{
|
|
49
48
|
"mcpServers": {
|
|
@@ -55,6 +54,12 @@ MCP server for TradingView market screening. Supports stocks, crypto, forex, fut
|
|
|
55
54
|
}
|
|
56
55
|
```
|
|
57
56
|
|
|
57
|
+
## Smart Features
|
|
58
|
+
|
|
59
|
+
- **Auto-Market Detection**: If you search for `EURUSD` or `BTCUSDT`, the server automatically checks Forex and Crypto markets if not found in stocks.
|
|
60
|
+
- **Strict Exchange Support**: Use `EXCHANGE:SYMBOL` format (e.g., `BINANCE:BTCUSDT`, `FX:EURUSD`) to target specific markets.
|
|
61
|
+
- **Smart Filters**: You can use human-readable names in filters (e.g., `"Relative Strength Index (14)"` instead of `"RSI"`).
|
|
62
|
+
|
|
58
63
|
## Main Tools
|
|
59
64
|
|
|
60
65
|
| Tool | Description |
|
|
@@ -87,7 +92,9 @@ MCP server for TradingView market screening. Supports stocks, crypto, forex, fut
|
|
|
87
92
|
| `list_fields_for_market` | List fields for a market |
|
|
88
93
|
| `get_screener_preset` | Get predefined screener presets |
|
|
89
94
|
|
|
90
|
-
## Resources
|
|
95
|
+
## Reference Resources
|
|
96
|
+
|
|
97
|
+
These resources provide raw lists of available markets and fields for reference.
|
|
91
98
|
|
|
92
99
|
| Resource | Description |
|
|
93
100
|
|----------|-------------|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
tradingview_mcp/__init__.py,sha256=V7RLq22Qp1rsMhDYNlXfWkiNaXlo7s4KkNUmSvbGKIM,455
|
|
2
2
|
tradingview_mcp/column.py,sha256=MC7lWksmyaYF4SkVm97Apr8httwip-N-4aVTSyS0CQo,8871
|
|
3
|
-
tradingview_mcp/constants.py,sha256=
|
|
4
|
-
tradingview_mcp/docs_data.py,sha256=
|
|
3
|
+
tradingview_mcp/constants.py,sha256=RlhAbBSbOUUJejyTiYozNjCD29TimVTC-ok2HkDzi_s,5417
|
|
4
|
+
tradingview_mcp/docs_data.py,sha256=PYMZxC2Y6Xqcv4XP2Z7pIKzNSokW440Zq68H5fgSASs,19118
|
|
5
5
|
tradingview_mcp/models.py,sha256=CHSQ46A2ljhvzI6YP8XRItUdoDJw1yYebiBANt9xeD0,3366
|
|
6
6
|
tradingview_mcp/query.py,sha256=gkC4t-2_jtuUK3KgzU62wrIcGoaOmY--1EwAshGQb0Q,10871
|
|
7
|
+
tradingview_mcp/resources.py,sha256=6cbsPhXsq6SFh3bmmSnMtrVkyCx1_xpWWiyqNLCCULk,1910
|
|
7
8
|
tradingview_mcp/scanner.py,sha256=oEfMzaYhQ7ggBdLlPLqKZCMxHkd6MBMaUMcm3p-YvPA,7649
|
|
8
|
-
tradingview_mcp/server.py,sha256=
|
|
9
|
-
tradingview_mcp/utils.py,sha256=
|
|
9
|
+
tradingview_mcp/server.py,sha256=opC61fKfchYn3-XL5ZlPGvsPRZZoLXe-VqGSulhrJHA,7165
|
|
10
|
+
tradingview_mcp/utils.py,sha256=5W0vLcrguwZv8q-ohZfQCqrkxVF1OCWPPVyCJ-bxhOo,11486
|
|
10
11
|
tradingview_mcp/data/__init__.py,sha256=3kot_ZG4a6jbZgyksE9z56n3skI407lsd4y2ThHotKY,298
|
|
11
12
|
tradingview_mcp/data/column_display_names.json,sha256=AFdo6Q2n-wSXWHi2wEExOd2pTItyjocRbrnxqYpCa94,30137
|
|
12
13
|
tradingview_mcp/data/markets.json,sha256=CehqCeVdQhWeCkMX1HWOrgCRjOomWa3VH1v2ZvPnIck,1482
|
|
@@ -31,8 +32,13 @@ tradingview_mcp/data/screeners/main_screeners.json,sha256=kU_xGJ7ePoGN3s8g9PwGrc
|
|
|
31
32
|
tradingview_mcp/data/screeners/markets.json,sha256=vpdrAKg4E_lgg4FxeX2GHNbnSsKQDmgfnyr2ziSdQsk,1004
|
|
32
33
|
tradingview_mcp/data/screeners/stocks.json,sha256=gCnntHTJKJ7n7IqY72fZ4EuBfthtnWUpfHvPqNOvnXo,8843
|
|
33
34
|
tradingview_mcp/data/screeners/stocks_failed.json,sha256=RqBp9XCZ3xvdWZMwuVGysEE2Er_XOQvBZoUHo9uyj6k,1084574
|
|
34
|
-
tradingview_mcp
|
|
35
|
-
tradingview_mcp
|
|
36
|
-
tradingview_mcp
|
|
37
|
-
tradingview_mcp
|
|
38
|
-
tradingview_mcp
|
|
35
|
+
tradingview_mcp/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
|
+
tradingview_mcp/tools/reference.py,sha256=BPip9ntzyRwIyE0SoD8TWqSGLYj7Evt-OM1SQ1uPG8o,2160
|
|
37
|
+
tradingview_mcp/tools/screener.py,sha256=K6uOUFq4GzPeCE4w2oa1LkAHbodQdQcmexw0W3sofeo,3188
|
|
38
|
+
tradingview_mcp/tools/search.py,sha256=_BNdmf4qzUUG5A6orODzm3R2evDcdgBQhY6aRdg09-o,13791
|
|
39
|
+
tradingview_mcp/tools/technical.py,sha256=x5raTT-l-Kn6uGUI_U7MLZRGjHXdgPB8Vss9nox3m5A,4500
|
|
40
|
+
tradingview_mcp-26.3.1.dist-info/METADATA,sha256=XNaWsK_-K7ei3R8sLivRp4VPEYD4BewD_iCSePjOsXw,4818
|
|
41
|
+
tradingview_mcp-26.3.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
42
|
+
tradingview_mcp-26.3.1.dist-info/entry_points.txt,sha256=GZxjGqgVbUlWDp5OzFQoCN_g1UBLyOmfVqCR5uzscnU,57
|
|
43
|
+
tradingview_mcp-26.3.1.dist-info/licenses/LICENSE,sha256=1Hdpp7qGWCXVw1BP6vpdAPO4KrgO0T_c0N3ipkYHKAo,1070
|
|
44
|
+
tradingview_mcp-26.3.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|