极限飞盘队MCP服务器
一种模型上下文协议(MCP)服务器,用于管理极限飞盘队球员、锦标赛和支付。此服务器允许您在SQLite数据库中添加、列出和管理玩家和锦标赛,以及跟踪锦标赛注册和付款。现在使用FastMCP来提高性能和可用性!
特性
玩家管理
- 添加玩家的姓名、电话号码和可选电子邮件
- 列出数据库中的所有玩家
- 从数据库中删除玩家
- 从CSV文件导入玩家
锦标赛管理
- 创建包含名称、地点、日期、表面类型(草地/海滩)和注册截止日期的锦标赛
- 列出、更新和删除锦标赛
- 为锦标赛注册/注销玩家
- 跟踪每位玩家的锦标赛付款状态
- 使用模糊名称匹配搜索为锦标赛付费的玩家
联盟付款跟踪
- 记录球员支付的联盟款项
- 跟踪付款金额和日期
- 列出玩家的付款历史记录
- 如果需要,删除最近的付款
系统功能
- 将数据库备份到文件
- 可通过CLI或MCP界面访问
- 现在使用FastMCP来改善AI交互!
设置
环境设置
- 使用uv创建虚拟环境:
uv venv- 激活虚拟环境:
source .venv/bin/activate- 在开发模式下安装带有开发依赖项的软件包:
uv pip install -e ".[dev]"- 设置环境变量(可选,适用于SQLiteCloud):
将.env模板文件复制到.env并填写相应的值:
cp .env-template .env
# Edit .env with your SQLiteCloud credentials- 运行测试:
pytest tests/用法
CLI使用情况
玩家管理
# Add a player
ultimate-team-mcp-server add-player "John Smith" --phone "+1234567890" --email "john@example.com"
# List all players
ultimate-team-mcp-server list-players
# Remove a player
ultimate-team-mcp-server remove-player --name "John Smith"
# Import players from a CSV file, updating existing ones
ultimate-team-mcp-server import-players /path/to/players.csv锦标赛管理
# Add a tournament
ultimate-team-mcp-server add-tournament --name "Summer Championship" --location "City Beach" \
--date "2025-07-15" --surface "beach" --registration-deadline "2025-06-30"
# List all tournaments
ultimate-team-mcp-server list-tournaments
# Update a tournament
ultimate-team-mcp-server update-tournament --id 1 --name "Summer Beach Championship" --location "North Beach"
# Remove a tournament
ultimate-team-mcp-server remove-tournament --id 1
# Register a player for a tournament
ultimate-team-mcp-server register-player --tournament-id 1 --player-name "John Smith"
# Unregister a player from a tournament
ultimate-team-mcp-server unregister-player --tournament-id 1 --player-name "John Smith"
# List all players registered for a tournament
ultimate-team-mcp-server list-tournament-players --tournament-id 1
# List all tournaments a player is registered for
ultimate-team-mcp-server list-player-tournaments --player-name "John Smith"
# Mark a player as having paid for a tournament
ultimate-team-mcp-server mark-payment --tournament-id 1 --player-name "John Smith"
# Clear a player's payment status for a tournament
ultimate-team-mcp-server clear-payment --tournament-id 1 --player-name "John Smith"
# Search for players who have paid for a tournament (with fuzzy matching)
ultimate-team-mcp-server search-paid-players --tournament-id 1 --name "John"联盟付款跟踪
# Add a federation payment for a player
ultimate-team-mcp-server add-federation-payment --player-name "John Smith" \
--amount 50.0 --payment-date "2025-01-15" --notes "Annual fee"
# List all federation payments for a player
ultimate-team-mcp-server list-federation-payments --player-name "John Smith"
# Remove the most recent federation payment for a player
ultimate-team-mcp-server remove-last-federation-payment --player-name "John Smith"系统命令
# Backup the database
ultimate-team-mcp-server backup /path/to/backup.db
# Using with a specific database URI
ultimate-team-mcp-server list-players --db-uri "sqlitecloud://host:port/database?apikey=key"
ultimate-team-mcp-server add-player "John" --phone "+1234567890" --db-uri "file:///path/to/custom.db"使用Claude Desktop
要将MCP服务器与Claude Desktop一起使用,您需要将其添加到您的 claude_desktop_config.json 文件:
{
"mcpServers": {
"ultimate_mcp_server": {
"command": "ultimate-team-mcp-server",
"environment": {
"SQLITE_URI": "sqlitecloud://host:port/database?apikey=key"
}
}
}
}使用Claude代码
- 启动MCP服务器:
ultimate-team-mcp-server- 安装克劳德代码。
- 将Ultimate Team MCP服务器直接添加到Claude:
# Set up with the new FastMCP-based server
# This works with both Claude Desktop and Claude CLI
claude mcp add ultimate -- ultimate-team-mcp-server
# List existing MCP servers - Validate that the server is running
claude mcp list使用以下命令运行Claude代码:
claude与自定义数据库URI一起使用
您可以在启动服务器时指定数据库URI:
# Using environment variable
SQLITE_URI="sqlitecloud://host:port/database?apikey=key" ultimate-team-mcp-server
# Or using command-line option
ultimate-team-mcp-server --db-uri "sqlitecloud://host:port/database?apikey=key"数据库结构
服务器使用SQLite或SQLiteCloud存储玩家数据、锦标赛、注册、付款和相关信息。数据库现在包括以下表:
- 球员(姓名、联系方式)
- 锦标赛(名称、地点、日期、场地类型、报名截止日期)
- 锦标赛球员注册(带付款跟踪)
- 联邦付款(包括金额和付款历史)
完整的架构定义位于 src/ultimate_mcp_server/modules/init_db.py 文件。
数据库配置
服务器可以使用单个数据库URI参数连接到本地SQLite数据库或SQLiteCloud,以获得基于云的解决方案。要配置数据库连接,请执行以下操作:
- 创建一个
.env基于提供的文件.env-template - 设置
SQLITE_URI或DB_URI将环境变量转换为以下格式之一:
- 对于SQLiteCloud: SQLITE_URI=sqlitecloud://hostname:port/database?apikey=your_api_key - 对于本地SQLite: SQLITE_URI=file:///path/to/database.db
如果两个环境变量都没有设置,服务器将默认在以下位置使用本地SQLite数据库 ~/.ultimate.db.
CSV导入格式
CSV导入功能(包括导入CSV和导入播放器)接受以下格式的文件:
Nombre,Telefono,Email
John Smith,+1234567890,john@example.com
Jane Doe,+0987654321,jane@example.com列名不区分大小写,可以是英语或西班牙语(Nombre/Name、Telefono/Phone、Email)。
导入csv和导入播放器之间的区别
- 导入csv:原始导入工具。它会添加新玩家,但如果同名玩家已经存在,则会失败。
- 导入玩家:增强的导入工具。如果发现同名玩家,它会添加新玩家并更新现有玩家。
使用导入玩家更新玩家的示例:
- 如果您的数据库中有一个玩家“John Smith”,电话为“+1234567890”
- 您的CSV有“John Smith”,电话为“+9999999999”
- 导入玩家后,“John Smith”将拥有更新的电话号码“+9999999999”
