XL2TIMES MCP服务器
模型上下文协议(MCP)服务器,使LLM代理能够通过xl2times工具与VEDA-TIMES能源系统模型进行交互。
关于
VEDA-TIMES是一个使用Excel进行模型规范的能源系统建模框架。此MCP服务器允许LLM将这些Excel模型转换为GAMS格式以进行优化求解,并针对AI代理的使用进行了详细的日志记录和文件跟踪优化。
先决条件
- uv包管理器
- xl2times(需要时通过自动安装
uvx xl2times)
Claude桌面配置
增添 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"xl2times": {
"command": "uvx",
"args": ["--from", "xl2times-mcp-server @ git+https://github.com/dlg0/xl2times-mcp-server", "xl2times-mcp-server"]
}
}
}可用工具
xl2times_run
将VEDA-TIMES Excel模型转换为GAMS格式,并记录详细信息。
LLM的JSON模式:
{
input: string; // Required: Path to VEDA model directory or Excel files
output_dir?: string; // Output directory for generated files (default: current dir)
dd_files?: string[]; // List of DD files to process
regions?: string[]; // List of regions to include
verbose?: number; // Verbosity level (forced to minimum 2 for LLM optimization)
no_cache?: boolean; // Disable caching
timestamps?: boolean; // Create output folder with timestamp
use_gams_date_time?: boolean; // Use GAMS date/time functions
threads?: number; // Number of threads to use
debug?: boolean; // Enable debug mode
}退货:
{
"success": true,
"return_code": 0,
"log_file": "/tmp/xl2times-mcp/xl2times_run_1234567890.log",
"output_files": [
"/path/to/output/COM_output.csv",
"/path/to/output/DEMAND_output.csv"
],
"files_processed": [
"model.xlsx",
"settings.xlsx"
],
"warnings": ["Warning messages if any"],
"execution_time": 2.45,
"message": "Successfully processed 4 Excel files, generated 41 output files. Check log file for details."
}xl2times_info
返回有关xl2times安装和服务器功能的信息。
LLM的JSON模式:
{
// No parameters required
}退货:
{
"version": "0.1.0",
"xl2times_available": true,
"xl2times_command": "uvx xl2times",
"capabilities": ["convert", "validate", "process"]
}LLM的主要功能
- 强迫的冗长:始终与
-vv详细输出标志 - 持久日志:在中创建带时间戳的日志文件
/tmp/xl2times-mcp/ - 完整路径返回:所有文件路径都是绝对的,便于访问
- 结构化错误:用可操作的信息清除错误消息
- 文件跟踪:已处理和生成文件的完整清单
许可证
MIT许可证-请参阅 许可证 了解详情。
