iflow-mcp_kukapay_cryptopanic-mcp-server 0.1.0__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.
@@ -0,0 +1,75 @@
1
+ Metadata-Version: 2.4
2
+ Name: iflow-mcp_kukapay_cryptopanic-mcp-server
3
+ Version: 0.1.0
4
+ Summary: Provide the latest cryptocurrency news for AI agents.
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ License-File: LICENSE
8
+ Requires-Dist: dotenv>=0.9.9
9
+ Requires-Dist: mcp[cli]>=1.3.0
10
+ Requires-Dist: requests>=2.32.3
11
+ Dynamic: license-file
12
+
13
+ <a href="https://glama.ai/mcp/servers/dp6kztv7yx">
14
+ <img width="380" height="200" src="https://glama.ai/mcp/servers/dp6kztv7yx/badge" alt="cryptopanic-mcp-server MCP server" />
15
+ </a>
16
+
17
+ # cryptopanic-mcp-server
18
+
19
+ Provide the latest cryptocurrency news to AI agents, powered by [CryptoPanic](https://cryptopanic.com/).
20
+
21
+ [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
22
+ [![Node.js](https://img.shields.io/badge/Node.js-18.x-green.svg)](https://nodejs.org/)
23
+ ![Status](https://img.shields.io/badge/status-active-brightgreen.svg)
24
+
25
+ *Try [Kukapay News MCP](https://github.com/kukapay/kukapay-news-mcp) — no API key required, fully AI-annotated*.
26
+
27
+ ## Tools
28
+
29
+ The server implements only one tool:
30
+
31
+ ```python
32
+ get_crypto_news(kind: str = "news", num_pages: int = 1) -> str
33
+ ```
34
+ - `kind`: Content type (news, media)
35
+ - `num_pages`: Number of pages to fetch (default: 1, max: 10)
36
+
37
+ Example Output:
38
+
39
+ ```
40
+ - Bitcoin Breaks $60k Resistance Amid ETF Optimism
41
+ - Ethereum Layer 2 Solutions Gain Traction
42
+ - New Crypto Regulations Proposed in EU
43
+ - ...
44
+ ```
45
+
46
+
47
+ ## Configuration
48
+
49
+ - CryptoPanic API key & API plan: get one [here](https://cryptopanic.com/developers/api/)
50
+ - Add a server entry to your configuration file:
51
+
52
+ ```
53
+ "mcpServers": {
54
+ "cryptopanic-mcp-server": {
55
+ "command": "uv",
56
+ "args": [
57
+ "--directory",
58
+ "/your/path/to/cryptopanic-mcp-server",
59
+ "run",
60
+ "main.py"
61
+ ],
62
+ "env": {
63
+ "CRYPTOPANIC_API_PLAN": "your_api_plan",
64
+ "CRYPTOPANIC_API_KEY": "your_api_key"
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ - Replace `/your/path/to/cryptopanic-mcp-server` with your actual installation path.
71
+ - Replace `CRYPTOPANIC_API_PLAN` and `CRYPTOPANIC_API_KEY` with your API plan and key from CryptoPanic.
72
+
73
+ ## License
74
+
75
+ MIT License - see `LICENSE` file
@@ -0,0 +1,7 @@
1
+ main.py,sha256=rukUfqp0r0B7tRp0vug3f3ZNUWHIP3oTEAUuEOYZ_0s,2677
2
+ iflow_mcp_kukapay_cryptopanic_mcp_server-0.1.0.dist-info/licenses/LICENSE,sha256=ffuRVlEMATIpIRP8B9mCR7q9hlJ1WF2RYQK5c-TPHDA,1064
3
+ iflow_mcp_kukapay_cryptopanic_mcp_server-0.1.0.dist-info/METADATA,sha256=y69FytJKeaKaimoCIVPoXuJYT0vUFb0C_OSQ-Y4chxg,2149
4
+ iflow_mcp_kukapay_cryptopanic_mcp_server-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
5
+ iflow_mcp_kukapay_cryptopanic_mcp_server-0.1.0.dist-info/entry_points.txt,sha256=Xwf5L_AOJ7sO45Qw_v1DrFBWTZh9T9SfgbuvDdiikhw,53
6
+ iflow_mcp_kukapay_cryptopanic_mcp_server-0.1.0.dist-info/top_level.txt,sha256=ZAMgPdWghn6xTRBO6Kc3ML1y3ZrZLnjZlqbboKXc_AE,5
7
+ iflow_mcp_kukapay_cryptopanic_mcp_server-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ cryptopanic-mcp-server = main:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 kukapay
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.
main.py ADDED
@@ -0,0 +1,80 @@
1
+ import requests
2
+ from mcp.server.fastmcp import FastMCP
3
+ import os
4
+ from dotenv import load_dotenv
5
+
6
+ load_dotenv()
7
+ API_KEY = os.getenv("CRYPTOPANIC_API_KEY")
8
+ API_PLAN = os.getenv("CRYPTOPANIC_API_PLAN", "developer")
9
+
10
+ # For testing purposes, allow empty API key with test mode
11
+ TEST_MODE = os.getenv("TEST_MODE", "false").lower() == "true"
12
+
13
+ # Validate API_KEY (skip validation in test mode)
14
+ if not API_KEY and not TEST_MODE:
15
+ raise ValueError("CRYPTOPANIC_API_KEY environment variable is not set")
16
+
17
+ mcp = FastMCP("crypto news")
18
+
19
+ @mcp.tool()
20
+ def get_crypto_news(kind: str = "news", num_pages: int = 1) -> str:
21
+ """
22
+ Fetch the latest cryptocurrency news from CryptoPanic.
23
+
24
+ Args:
25
+ kind (str, optional): Type of content to fetch. Valid options are:
26
+ - 'news': Fetch news articles (default).
27
+ - 'media': Fetch media content like videos.
28
+ num_pages (int, optional): Number of pages to fetch (each page contains multiple news items).
29
+ Defaults to 1. Maximum is 10 to avoid API rate limits.
30
+
31
+ Returns:
32
+ str: A concatenated string of news titles, each prefixed with a dash (-).
33
+
34
+ Raises:
35
+ ValueError: If the API key is not set or if the API request fails.
36
+ """
37
+ news = fetch_crypto_news(kind, num_pages)
38
+ readable = concatenate_news(news)
39
+ return readable
40
+
41
+ def fetch_crypto_news_page(kind: str = "news", page: int = 1) -> list:
42
+ # In test mode, return mock data
43
+ if TEST_MODE:
44
+ return [
45
+ {"title": "Bitcoin Breaks $60k Resistance Amid ETF Optimism"},
46
+ {"title": "Ethereum Layer 2 Solutions Gain Traction"},
47
+ {"title": "New Crypto Regulations Proposed in EU"}
48
+ ]
49
+
50
+ try:
51
+ url = f"https://cryptopanic.com/api/{API_PLAN}/v2/posts/"
52
+ params = {
53
+ "auth_token": API_KEY,
54
+ "kind": kind,
55
+ "regions": "en",
56
+ "page": page
57
+ }
58
+ response = requests.get(url, params=params)
59
+ return response.json().get("results", [])
60
+ except Exception:
61
+ return []
62
+
63
+ def fetch_crypto_news(kind: str = "news", num_pages: int = 10) -> list:
64
+ all_news = []
65
+ for page in range(1, num_pages + 1):
66
+ news_items = fetch_crypto_news_page(kind, page)
67
+ if not news_items:
68
+ break
69
+ all_news.extend(news_items)
70
+ return all_news
71
+
72
+ def concatenate_news(news_items: list) -> str:
73
+ concatenated_text = ""
74
+ for idx, news in enumerate(news_items):
75
+ title = news.get("title", "No Title")
76
+ concatenated_text += f"- {title}\n"
77
+ return concatenated_text.strip()
78
+
79
+ if __name__ == "__main__":
80
+ mcp.run(transport="stdio")