feat: 添加MCP服务器初始实现及相关文件

添加MCP服务器的初始实现,包括:
- 主程序文件mcp_server.py
- 配置文件config.toml
- 依赖文件requirements.txt
- 安装指南INSTALL.md
- 使用说明README.md

服务器功能包括:
- 接收客户端请求
- 调用OpenAI API进行分析
- 提供健康检查接口
- 支持与disk_inspection.py脚本对接
This commit is contained in:
cnphpbb
2025-09-10 22:15:10 +08:00
parent 107b20a410
commit 79cdb45e20
5 changed files with 0 additions and 0 deletions

27
mcp_server-py/config.toml Normal file
View File

@@ -0,0 +1,27 @@
[server]
# MCP服务器配置
host = "0.0.0.0" # 监听地址
port = 8080 # 监听端口
debug = false # 是否开启调试模式
[openai]
# OpenAI API配置
api_key = "your-api-key-here" # OpenAI API密钥
model = "gpt-3.5-turbo" # 使用的模型
base_url = "https://api.openai.com/v1" # API基础URL
max_tokens = 2048 # 最大token数
temperature = 0.7 # 温度参数
auto_approve = true # 是否自动批准工具调用请求
[logging]
# 日志配置
level = "info" # 日志级别debug, info, warn, error
format = "text" # 日志格式text, json
file_path = "/var/log/mcp_server.log" # 日志文件路径
[security]
# 安全配置
enable_auth = false # 是否启用认证
# 如果启用认证,需配置以下参数
# auth_token = "your-auth-token" # 认证令牌