futu-stock-mcp-server 0.1.1__py3-none-any.whl → 0.1.2__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.

Potentially problematic release.


This version of futu-stock-mcp-server might be problematic. Click here for more details.

@@ -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
- lambda msg: print(msg),
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: futu-stock-mcp-server
3
- Version: 0.1.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
+ [![MseeP.ai Security Assessment Badge](https://mseep.net/pr/shuizhengqi1-futu-stocp-mcp-server-badge.png)](https://mseep.ai/app/shuizhengqi1-futu-stocp-mcp-server)
44
+
43
45
  # Futu Stock MCP Server
44
46
 
45
47
  [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org)
@@ -101,16 +103,25 @@ Description-Content-Type: text/markdown
101
103
 
102
104
  ## 🚀 快速开始
103
105
 
104
- ### 方式一:通过 PyPI 安装(推荐)
106
+ ### 方式一:通过 pipx 安装(推荐)
105
107
 
106
108
  ```bash
109
+ # 安装 pipx(如果还没有安装)
110
+ brew install pipx # macOS
111
+ # 或者 pip install --user pipx # 其他系统
112
+
107
113
  # 安装包
108
- pip install futu-stock-mcp-server
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": "/path/to/your/venv/bin/futu-mcp-server",
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
- 或者使用 Python 模块方式:
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
- pip install futu-stock-mcp-server
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 无法退出服务器
@@ -0,0 +1,7 @@
1
+ futu_stock_mcp_server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ futu_stock_mcp_server/server.py,sha256=xFtYbURXhj0DOkbCFgwHDKHCAATWlSxdBZudrWsodVc,52810
3
+ futu_stock_mcp_server-0.1.2.dist-info/METADATA,sha256=CmSaX6UUSExUdbci62zSZER2udDlV6Fqfqd3SSYHSlg,20453
4
+ futu_stock_mcp_server-0.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
5
+ futu_stock_mcp_server-0.1.2.dist-info/entry_points.txt,sha256=GAdKqPJD9dJ_fRA3e3m0NRia0elN5OcjEeAI30vOcIM,70
6
+ futu_stock_mcp_server-0.1.2.dist-info/licenses/LICENSE,sha256=XQBSQkjjpkymu_uLdyis4oNynV60VH1X7nS16uwM6g0,1069
7
+ futu_stock_mcp_server-0.1.2.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- futu_stock_mcp_server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- futu_stock_mcp_server/server.py,sha256=41rXd58tq0RQDfM34BRgDt9cMLY7YZHKxP-6CtecnaM,52235
3
- futu_stock_mcp_server-0.1.1.dist-info/METADATA,sha256=J0mHYGus5Mm4Np4QgTzQsfNEqBHjnVqItlJ2H_i2Mac,20087
4
- futu_stock_mcp_server-0.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
5
- futu_stock_mcp_server-0.1.1.dist-info/entry_points.txt,sha256=GAdKqPJD9dJ_fRA3e3m0NRia0elN5OcjEeAI30vOcIM,70
6
- futu_stock_mcp_server-0.1.1.dist-info/licenses/LICENSE,sha256=XQBSQkjjpkymu_uLdyis4oNynV60VH1X7nS16uwM6g0,1069
7
- futu_stock_mcp_server-0.1.1.dist-info/RECORD,,