diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a7215a0 --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/README.md b/README.md index c38fc71..f940b98 100644 --- a/README.md +++ b/README.md @@ -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) ## 功能特点 @@ -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 或投研终端 @@ -176,4 +188,4 @@ xtquantai/ ## 致谢 - [迅投科技](https://www.thinktrader.net/) 提供的量化交易平台 -- [Model Context Protocol](https://modelcontextprotocol.io/) 提供的 AI 集成框架 \ No newline at end of file +- [Model Context Protocol](https://modelcontextprotocol.io/) 提供的 AI 集成框架 diff --git a/smithery.yaml b/smithery.yaml new file mode 100644 index 0000000..607cb2c --- /dev/null +++ b/smithery.yaml @@ -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