Cloudbet MCP Server Single File Sports Data Demo
Explore Cloudbet's single-file MCP server demo for sports data and
npx -y @cloudbet/sports-mcp-serverOverview
This repository contains a single-file, minimal implementation of a Model Context Protocol (MCP) server that exposes sports data and simple betting-related tools using Cloudbet’s public API. The project is intended as an educational demo showing how an MCP Server can describe and expose external tools (APIs) to LLMs or other MCP-aware clients via JSON-RPC. It implements the MCP Server specification so tools can be discovered and invoked programmatically.
Because the implementation is intentionally compact and focused on demonstration, it’s suitable for learning, prototyping, or as a starting point for building a more feature-complete MCP integration. It is not intended to be used as a production betting backend; use responsibly and review the code before any real usage.
Repository: https://github.com/cloudbet/sports-mcp-server
MCP Spec: https://modelcontextprotocol.io/specification/2025-03-26/server
Features
- Single-file Go implementation — easy to read and adapt
- MCP Server-compatible JSON-RPC endpoint for tool discovery and invocation
- Example tools that query Cloudbet’s public sports and markets APIs
- Minimal dependencies for quick local testing and learning
- Example curl commands for listing tools and calling a tool
Installation / Configuration
Prerequisites:
- Go (1.18+ recommended)
- network access to Cloudbet public API (no special credentials required for this demo)
Run the server locally:
The server listens on http://localhost:8080 by default. To change the port, edit the source file (it’s a single-file demo) and modify the listen address, then re-run go run ..
JSON-RPC requests must use Content-Type: application/json and conform to the request shapes shown in the examples below.
Available Resources
The demo implements the minimal MCP server methods to describe available tools and to call a specific tool. The core JSON-RPC methods are:
| JSON-RPC method | Purpose |
|---|---|
| tools/list | Return descriptions of available tools (MCP “describe” equivalent) |
| tools/call | Invoke a named tool with arguments (MCP “call” equivalent) |
Example tools included in the demo (subject to change in the repo):
- findEventsAndMarketsByCompetition — search events and markets by competition name
Note: For the authoritative, up-to-date list of tools and descriptions, call tools/list against your running instance.
Examples / Use Cases
- List available tools (describe) This request asks the server to list the tools it exposes and their metadata. Use jq or another JSON formatter to inspect the response.
|
Expected output (abbreviated):
- Call a tool (search for competition markets) Invoke a specific tool exposed by the server. The arguments shape depends on the tool; the tools/list response includes parameter details.
|
Expected behaviour:
- The server queries Cloudbet’s public sports API for events matching “Premier League”
- It returns structured results (events and markets) in the JSON-RPC response
- Integrating with LLMs or MCP-aware clients
- Use tools/list to populate a model’s tool registry before generating a plan
- Use tools/call to execute steps that require up-to-date sports or market data
- Combine results into prompts or downstream processing
Notes and Caveats
- This server is a demo: it focuses on clarity and MCP conformance rather than production robustness (no rate-limiting, authentication, or full error handling).
- Review and adapt the single-file source before exposing it on public networks.
- The Cloudbet public API endpoints used by the demo may change; verify API availability and terms before extended use.
For more details and the complete source, see the project on GitHub: https://github.com/cloudbet/sports-mcp-server