使用说明
mcp赔率api
一个与OddsAPI交互的最小列表模型上下文协议MCP服务器。
特性
- 使用环境变量将查询限制在某些地区和单个运动中。
它支持SSE和STDIO传输。
工具
服务器实现了以下工具来与OddsAPI交互:
-
get_events:- 参加比赛和即将到来的活动(比赛)。
-
get_odds:- 获取选定博彩市场所有即将举行的活动(比赛)的赔率。
-
get_event_odds:- 获取选定博彩市场特定事件(比赛)的赔率。
配置
-
创建或编辑位于以下位置的Claude Desktop配置文件:
- 在 macOS 上:
~/Library/Application Support/Claude/claude_desktop_config.json - 在Windows上:
%APPDATA%/Claude/claude_desktop_config.json
- 在 macOS 上:
-
添加以下内容:
{
"mcpServers": {
"mcp-bauplan": {
"command": "/path/to/uvx",
"args": ["mcp-odds-api"],
"env": {
"ODDS_API_KEY": "<your-api-odds-key>",
"ODDS_API_REGIONS": "<region1>", "<region2>",
"ODDS_API_SPORT": "<selected-sport-key>",
}
}
}
}
-
替换
/path/to/uvx通过绝对路径uvx可执行。找到路径which uvx在终端中执行命令。这确保了正确的版本uvx启动服务器时使用。 -
重新启动Claude Desktop以应用更改。
运行独立的SSE服务器
从.env.example创建.env文件,然后执行以下命令:
$ uvx --env-file /path/to/.env mcp-odds-api --transport sse --port 9090
注意使用
nvx而不是uvx将取回mcp-bauplan从默认注册表https://pypi.org.
发展
设置
git clone https://github.com/marcoeg/mcp-odds-api
cd mcp-nvd
-
设置环境变量:
- 创建一个
.env项目根目录中的文件:
ODDS_API_KEY=“" ODDS_API_REGIONS=“", "" ODDS_API_SPORT=“"
- 创建一个
-
再进行:
uv sync
uv pip install -e .
使用SSE传输启动服务器
$ uv run mcp-odds-api --transport sse --port 9090
python-dotenv could not parse statement starting at line 2
2025-04-30 19:35:34 - dotenv.main - WARNING - python-dotenv could not parse statement starting at line 2
INFO: Started server process [68314]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:9090 (Press CTRL+C to quit)
运行检查器:
$ CLIENT_PORT=8077 TARGET_PORT=9090 \
npx @modelcontextprotocol/inspector run
Starting MCP inspector...
⚙️ Proxy server listening on port 6277
🔍 MCP Inspector is up and running at http://127.0.0.1:8077 🚀
然后打开浏览器到MCP检查器指示的URL。选择SSE传输类型。