Skip to content

Commit a936cb3

Browse files
committed
📈 AkTools MCP Server
Add tool: `trading_suggest`
1 parent 5f1290d commit a936cb3

File tree

5 files changed

+27
-9
lines changed

5 files changed

+27
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ docker-compose up -d
9090
- `stock_indicators_a` - A股关键指标
9191
- `stock_indicators_hk` - 港股关键指标
9292
- `stock_indicators_us` - 美股关键指标
93+
- `trading_suggest` - 给出投资建议
9394

9495
</details>
9596

mcp_aktools/__init__.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
_LOGGER = logging.getLogger(__name__)
1616

17-
mcp = FastMCP(name="mcp-aktools", version="0.1.8")
17+
mcp = FastMCP(name="mcp-aktools", version="0.1.9")
1818

1919
field_symbol = Field(description="股票代码")
2020
field_market = Field("sh", description="股票市场,如: sh(上证), sz(深证), hk(港股), us(美股) 等")
@@ -26,7 +26,7 @@
2626

2727
@mcp.tool(
2828
title="查找股票代码",
29-
description="根据股票名称、公司名称等关键词查找股票代码。"
29+
description="根据股票名称、公司名称等关键词查找股票代码,不支持加密货币。"
3030
"该工具比较耗时,当你知道股票代码或用户已指定股票代码时,建议直接通过股票代码使用其他工具",
3131
)
3232
def search(
@@ -63,7 +63,7 @@ def search(
6363

6464
@mcp.tool(
6565
title="获取股票信息",
66-
description="根据股票代码和市场获取股票基本信息",
66+
description="根据股票代码和市场获取股票基本信息,不支持加密货币",
6767
)
6868
def stock_info(
6969
symbol: str = field_symbol,
@@ -85,7 +85,7 @@ def stock_info(
8585

8686
@mcp.tool(
8787
title="获取股票历史价格",
88-
description="根据股票代码和市场获取股票历史价格及技术指标",
88+
description="根据股票代码和市场获取股票历史价格及技术指标,不支持加密货币",
8989
)
9090
def stock_prices(
9191
symbol: str = field_symbol,
@@ -336,7 +336,7 @@ def newsnow_news(channels=None):
336336

337337
@mcp.tool(
338338
title="获取加密货币历史价格",
339-
description="获取OKX加密货币K线数据",
339+
description="获取OKX加密货币的历史K线数据,包括价格、交易量和技术指标",
340340
)
341341
def okx_prices(
342342
instId: str = Field("BTC-USDT", description="产品ID,格式: BTC-USDT"),
@@ -473,6 +473,23 @@ def binance_ai_report(
473473
return '\n'.join(txts)
474474

475475

476+
@mcp.tool(
477+
title="给出投资建议",
478+
description="基于AI对其他工具提供的数据分析结果给出具体投资建议",
479+
)
480+
def trading_suggest(
481+
symbol: str = Field(description="股票代码或加密币种"),
482+
action: str = Field(description="推荐操作: buy/sell/hold"),
483+
score: int = Field(description="置信度,范围: 0-100"),
484+
reason: str = Field(description="推荐理由"),
485+
):
486+
return {
487+
"symbol": symbol,
488+
"action": action,
489+
"score": score,
490+
"reason": reason,
491+
}
492+
476493

477494
def ak_cache(fun, *args, **kwargs) -> pd.DataFrame | None:
478495
key = kwargs.pop("key", None)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mcp-aktools"
3-
version = "0.1.8"
3+
version = "0.1.9"
44
description = "MCP Server for stock and crypto"
55
readme = "README.md"
66
requires-python = ">=3.10"

server.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "io.github.aahl/mcp-aktools",
44
"title": "AkTools MCP Server",
55
"description": "MCP Server for stock and crypto",
6-
"version": "0.1.8",
6+
"version": "0.1.9",
77
"repository": {
88
"url": "https://github.com/aahl/mcp-aktools",
99
"source": "github"
@@ -12,7 +12,7 @@
1212
{
1313
"registryType": "pypi",
1414
"identifier": "mcp-aktools",
15-
"version": "0.1.8",
15+
"version": "0.1.9",
1616
"transport": {"type": "stdio"}
1717
},
1818
{

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)