futu-stock-mcp-server 0.1.1__tar.gz → 0.1.2__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.
Potentially problematic release.
This version of futu-stock-mcp-server might be problematic. Click here for more details.
- {futu_stock_mcp_server-0.1.1 → futu_stock_mcp_server-0.1.2}/PKG-INFO +23 -23
- {futu_stock_mcp_server-0.1.1 → futu_stock_mcp_server-0.1.2}/README.md +22 -22
- {futu_stock_mcp_server-0.1.1 → futu_stock_mcp_server-0.1.2}/pyproject.toml +1 -1
- {futu_stock_mcp_server-0.1.1 → futu_stock_mcp_server-0.1.2}/src/futu_stock_mcp_server/server.py +14 -3
- {futu_stock_mcp_server-0.1.1 → futu_stock_mcp_server-0.1.2}/.gitignore +0 -0
- {futu_stock_mcp_server-0.1.1 → futu_stock_mcp_server-0.1.2}/LICENSE +0 -0
- {futu_stock_mcp_server-0.1.1 → futu_stock_mcp_server-0.1.2}/src/futu_stock_mcp_server/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: futu-stock-mcp-server
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: A Model Context Protocol (MCP) server for accessing Futu OpenAPI functionality
|
|
5
5
|
Project-URL: Homepage, https://github.com/shuizhengqi1/futu-stock-mcp-server
|
|
6
6
|
Project-URL: Documentation, https://github.com/shuizhengqi1/futu-stock-mcp-server#readme
|
|
@@ -40,6 +40,8 @@ Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
|
40
40
|
Requires-Dist: ruff; extra == 'dev'
|
|
41
41
|
Description-Content-Type: text/markdown
|
|
42
42
|
|
|
43
|
+
[](https://mseep.ai/app/shuizhengqi1-futu-stocp-mcp-server)
|
|
44
|
+
|
|
43
45
|
# Futu Stock MCP Server
|
|
44
46
|
|
|
45
47
|
[](https://www.python.org)
|
|
@@ -101,16 +103,25 @@ Description-Content-Type: text/markdown
|
|
|
101
103
|
|
|
102
104
|
## 🚀 快速开始
|
|
103
105
|
|
|
104
|
-
### 方式一:通过
|
|
106
|
+
### 方式一:通过 pipx 安装(推荐)
|
|
105
107
|
|
|
106
108
|
```bash
|
|
109
|
+
# 安装 pipx(如果还没有安装)
|
|
110
|
+
brew install pipx # macOS
|
|
111
|
+
# 或者 pip install --user pipx # 其他系统
|
|
112
|
+
|
|
107
113
|
# 安装包
|
|
108
|
-
|
|
114
|
+
pipx install futu-stock-mcp-server
|
|
109
115
|
|
|
110
116
|
# 运行服务器
|
|
111
117
|
futu-mcp-server
|
|
112
118
|
```
|
|
113
119
|
|
|
120
|
+
> **为什么使用 pipx?**
|
|
121
|
+
> - pipx 专门用于安装 Python 应用程序到全局环境
|
|
122
|
+
> - 自动管理独立的虚拟环境,避免依赖冲突
|
|
123
|
+
> - 命令直接可用,无需激活虚拟环境
|
|
124
|
+
|
|
114
125
|
### 方式二:通过 Docker 运行
|
|
115
126
|
|
|
116
127
|
```bash
|
|
@@ -239,12 +250,13 @@ ruff format .
|
|
|
239
250
|
}
|
|
240
251
|
```
|
|
241
252
|
|
|
242
|
-
3.
|
|
253
|
+
3. **故障排除配置**:
|
|
254
|
+
如果上述配置不工作,可以尝试使用完整路径:
|
|
243
255
|
```json
|
|
244
256
|
{
|
|
245
257
|
"mcpServers": {
|
|
246
258
|
"futu-stock": {
|
|
247
|
-
"command": "/
|
|
259
|
+
"command": "/Users/your-username/.local/bin/futu-mcp-server",
|
|
248
260
|
"env": {
|
|
249
261
|
"FUTU_HOST": "127.0.0.1",
|
|
250
262
|
"FUTU_PORT": "11111"
|
|
@@ -254,22 +266,7 @@ ruff format .
|
|
|
254
266
|
}
|
|
255
267
|
```
|
|
256
268
|
|
|
257
|
-
|
|
258
|
-
```json
|
|
259
|
-
{
|
|
260
|
-
"mcpServers": {
|
|
261
|
-
"futu-stock": {
|
|
262
|
-
"command": "python",
|
|
263
|
-
"args": ["-m", "futu_stock_mcp_server.server"],
|
|
264
|
-
"cwd": "/path/to/futu-stock-mcp-server",
|
|
265
|
-
"env": {
|
|
266
|
-
"FUTU_HOST": "127.0.0.1",
|
|
267
|
-
"FUTU_PORT": "11111"
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
```
|
|
269
|
+
> **提示**:使用 `which futu-mcp-server` 命令查看完整路径
|
|
273
270
|
|
|
274
271
|
### 在其他 MCP 客户端中配置
|
|
275
272
|
|
|
@@ -363,10 +360,13 @@ LOG_LEVEL=INFO
|
|
|
363
360
|
#### 1. 命令 `futu-mcp-server` 找不到
|
|
364
361
|
```bash
|
|
365
362
|
# 确保已正确安装
|
|
366
|
-
|
|
363
|
+
pipx install futu-stock-mcp-server
|
|
367
364
|
|
|
368
|
-
#
|
|
365
|
+
# 检查命令是否可用
|
|
369
366
|
which futu-mcp-server
|
|
367
|
+
|
|
368
|
+
# 如果还是找不到,检查 PATH
|
|
369
|
+
echo $PATH | grep -o '[^:]*\.local/bin[^:]*'
|
|
370
370
|
```
|
|
371
371
|
|
|
372
372
|
#### 2. Ctrl+C 无法退出服务器
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
[](https://mseep.ai/app/shuizhengqi1-futu-stocp-mcp-server)
|
|
2
|
+
|
|
1
3
|
# Futu Stock MCP Server
|
|
2
4
|
|
|
3
5
|
[](https://www.python.org)
|
|
@@ -59,16 +61,25 @@
|
|
|
59
61
|
|
|
60
62
|
## 🚀 快速开始
|
|
61
63
|
|
|
62
|
-
### 方式一:通过
|
|
64
|
+
### 方式一:通过 pipx 安装(推荐)
|
|
63
65
|
|
|
64
66
|
```bash
|
|
67
|
+
# 安装 pipx(如果还没有安装)
|
|
68
|
+
brew install pipx # macOS
|
|
69
|
+
# 或者 pip install --user pipx # 其他系统
|
|
70
|
+
|
|
65
71
|
# 安装包
|
|
66
|
-
|
|
72
|
+
pipx install futu-stock-mcp-server
|
|
67
73
|
|
|
68
74
|
# 运行服务器
|
|
69
75
|
futu-mcp-server
|
|
70
76
|
```
|
|
71
77
|
|
|
78
|
+
> **为什么使用 pipx?**
|
|
79
|
+
> - pipx 专门用于安装 Python 应用程序到全局环境
|
|
80
|
+
> - 自动管理独立的虚拟环境,避免依赖冲突
|
|
81
|
+
> - 命令直接可用,无需激活虚拟环境
|
|
82
|
+
|
|
72
83
|
### 方式二:通过 Docker 运行
|
|
73
84
|
|
|
74
85
|
```bash
|
|
@@ -197,12 +208,13 @@ ruff format .
|
|
|
197
208
|
}
|
|
198
209
|
```
|
|
199
210
|
|
|
200
|
-
3.
|
|
211
|
+
3. **故障排除配置**:
|
|
212
|
+
如果上述配置不工作,可以尝试使用完整路径:
|
|
201
213
|
```json
|
|
202
214
|
{
|
|
203
215
|
"mcpServers": {
|
|
204
216
|
"futu-stock": {
|
|
205
|
-
"command": "/
|
|
217
|
+
"command": "/Users/your-username/.local/bin/futu-mcp-server",
|
|
206
218
|
"env": {
|
|
207
219
|
"FUTU_HOST": "127.0.0.1",
|
|
208
220
|
"FUTU_PORT": "11111"
|
|
@@ -212,22 +224,7 @@ ruff format .
|
|
|
212
224
|
}
|
|
213
225
|
```
|
|
214
226
|
|
|
215
|
-
|
|
216
|
-
```json
|
|
217
|
-
{
|
|
218
|
-
"mcpServers": {
|
|
219
|
-
"futu-stock": {
|
|
220
|
-
"command": "python",
|
|
221
|
-
"args": ["-m", "futu_stock_mcp_server.server"],
|
|
222
|
-
"cwd": "/path/to/futu-stock-mcp-server",
|
|
223
|
-
"env": {
|
|
224
|
-
"FUTU_HOST": "127.0.0.1",
|
|
225
|
-
"FUTU_PORT": "11111"
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
```
|
|
227
|
+
> **提示**:使用 `which futu-mcp-server` 命令查看完整路径
|
|
231
228
|
|
|
232
229
|
### 在其他 MCP 客户端中配置
|
|
233
230
|
|
|
@@ -321,10 +318,13 @@ LOG_LEVEL=INFO
|
|
|
321
318
|
#### 1. 命令 `futu-mcp-server` 找不到
|
|
322
319
|
```bash
|
|
323
320
|
# 确保已正确安装
|
|
324
|
-
|
|
321
|
+
pipx install futu-stock-mcp-server
|
|
325
322
|
|
|
326
|
-
#
|
|
323
|
+
# 检查命令是否可用
|
|
327
324
|
which futu-mcp-server
|
|
325
|
+
|
|
326
|
+
# 如果还是找不到,检查 PATH
|
|
327
|
+
echo $PATH | grep -o '[^:]*\.local/bin[^:]*'
|
|
328
328
|
```
|
|
329
329
|
|
|
330
330
|
#### 2. Ctrl+C 无法退出服务器
|
{futu_stock_mcp_server-0.1.1 → futu_stock_mcp_server-0.1.2}/src/futu_stock_mcp_server/server.py
RENAMED
|
@@ -42,13 +42,20 @@ logger.add(
|
|
|
42
42
|
format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {message}"
|
|
43
43
|
)
|
|
44
44
|
|
|
45
|
-
# Add console handler
|
|
45
|
+
# Add console handler - output to stderr to avoid polluting MCP JSON communication
|
|
46
46
|
logger.add(
|
|
47
|
-
|
|
47
|
+
sys.stderr,
|
|
48
48
|
level="INFO",
|
|
49
|
-
format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {message}"
|
|
49
|
+
format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {message}",
|
|
50
|
+
colorize=False # Disable colors to avoid ANSI escape sequences
|
|
50
51
|
)
|
|
51
52
|
|
|
53
|
+
# Suppress other library logs that might interfere with MCP communication
|
|
54
|
+
import logging
|
|
55
|
+
logging.getLogger().setLevel(logging.WARNING) # Suppress INFO logs from other libraries
|
|
56
|
+
logging.getLogger("mcp").setLevel(logging.WARNING) # Suppress MCP internal logs
|
|
57
|
+
logging.getLogger("futu").setLevel(logging.WARNING) # Suppress Futu API logs
|
|
58
|
+
|
|
52
59
|
logger.info(f"Starting server with log directory: {log_dir}")
|
|
53
60
|
|
|
54
61
|
# PID file path
|
|
@@ -1450,6 +1457,10 @@ async def get_current_time() -> Dict[str, Any]:
|
|
|
1450
1457
|
def main():
|
|
1451
1458
|
"""Main entry point for the futu-mcp-server command."""
|
|
1452
1459
|
try:
|
|
1460
|
+
# Ensure no color output in MCP mode
|
|
1461
|
+
os.environ['NO_COLOR'] = '1'
|
|
1462
|
+
os.environ['TERM'] = 'dumb'
|
|
1463
|
+
|
|
1453
1464
|
# 清理旧的进程和文件
|
|
1454
1465
|
cleanup_stale_processes()
|
|
1455
1466
|
|
|
File without changes
|
|
File without changes
|
{futu_stock_mcp_server-0.1.1 → futu_stock_mcp_server-0.1.2}/src/futu_stock_mcp_server/__init__.py
RENAMED
|
File without changes
|