Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
FROM python:3.11-slim

WORKDIR /app

# Copy all project files
COPY . .

# Install system dependencies if needed
RUN apt-get update && apt-get install -y build-essential && rm -rf /var/lib/apt/lists/*

# Install uv and project dependencies
RUN pip install --no-cache-dir uv && \
pip install --no-cache-dir .

EXPOSE 8000

# Run the server using main.py instead of module execution
CMD ["python", "main.py"]
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ xtquantai 是一个基于 Model Context Protocol (MCP) 的服务器,它将迅

[![Python Version](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![smithery badge](https://smithery.ai/badge/@dfkai/xtquantai)](https://smithery.ai/server/@dfkai/xtquantai)

## 功能特点

Expand All @@ -29,6 +30,17 @@ XTQuantAI 提供以下核心功能(陆续更新中,欢迎大家提交新创意
1. QMT 生态系统目前仅支持 Windows,因此以下均在 Windows 环境实现
2. Windows 环境目前在实现 MCP 过程中有不少细节,需要注意

### 安装 Smithery

通过 [Smithery](https://smithery.ai/server/@dfkai/xtquantai) 安装 XTQuantAI,并在 Claude Desktop 中使用 MCP:

```bash
npx -y @smithery/cli install @dfkai/xtquantai --client [client_name]
```

确保将 `[client_name]` 替换为适合您的使用场景的相应客户端名称。
如果在 Claude Desktop 中使用,请指定 `claude` 作为客户端名称。

### 前提条件
- Python 3.11 或更高版本
- 迅投 QMT 或投研终端
Expand Down Expand Up @@ -176,4 +188,4 @@ xtquantai/
## 致谢

- [迅投科技](https://www.thinktrader.net/) 提供的量化交易平台
- [Model Context Protocol](https://modelcontextprotocol.io/) 提供的 AI 集成框架
- [Model Context Protocol](https://modelcontextprotocol.io/) 提供的 AI 集成框架
23 changes: 23 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml

startCommand:
type: stdio
configSchema:
# JSON Schema defining the configuration options for the MCP.
type: object
properties:
mode:
type: string
default: direct
description: Launch mode, usually one of 'direct' or 'inspector'.
port:
type: number
default: 8000
description: Port for the xtquantai server (direct mode).
commandFunction:
# A JS function that produces the CLI command based on the given config to start the MCP on stdio.
|-
(config) => { return { command: 'python', args: ['main.py', '--mode', config.mode, '--port', '' + config.port] } }
exampleConfig:
mode: direct
port: 8000