Skip to main content
Glama
thisismugil

cric-mcp

by thisismugil
README.md
# Production-Ready Cricket Updates MCP Server

An enterprise-grade Model Context Protocol (MCP) Server for daily cricket updates, built with Python, FastAPI, and the official MCP Python SDK.

## Features
- **MCP Integration**: Fully compatible with Claude Remote MCP Connector.
- **FastAPI**: High-performance async API with endpoints for health, metrics, and MCP SSE transport.
- **Clean Architecture**: Strong separation of concerns with domain-driven design principles.
- **Background Sync**: Uses APScheduler with Redis distributed locking for syncing cricket data.
- **Persistence**: Async SQLAlchemy with PostgreSQL (Neon DB).
- **Caching**: Efficient caching strategies using Redis.

## Setup Instructions

1. **Clone the repository and install dependencies:**
   ```bash
   python -m venv venv
   source venv/bin/activate  # On Windows use `venv\Scripts\activate`
   pip install -r requirements.txt
   ```

2. **Configure Environment Variables:**
   Create a `.env` file based on `.env.example`:
   ```bash
   cp .env.example .env
   ```
   Add your Neon PostgreSQL URL and Redis URL.

3. **Run Database Migrations:**
   ```bash
   alembic upgrade head
   ```

4. **Run the Application:**
   ```bash
   uvicorn app.main:app --reload
   ```

## Connecting Claude

To connect this server to Claude via the MCP Remote Connector, you can provide the SSE endpoint URL (`http://localhost:8000/api/v1/mcp/sse`) in your Claude Desktop configuration or the relevant client configuration.

### Example Claude Desktop Config
```json
{
  "mcpServers": {
    "cricket": {
      "command": "node",
      "args": ["path/to/remote/mcp-client", "http://localhost:8000/api/v1/mcp/sse"]
    }
  }
}
```
*Note: Depending on the client, you may just need to point directly to the URL.*

## Deployment

The project is configured for deployment on Render.
1. Connect your GitHub repository to Render.
2. Render will automatically detect the `render.yaml` file.
3. It will provision a Redis instance and the web service.
4. Make sure to set the `DATABASE_URL` environment variable securely in the Render dashboard for your Neon Postgres connection.