Skip to main content
Glama
DIVYAN2211

PayVoice Collections MCP Server

by DIVYAN2211
README.md
# PayVoice Collections MCP Server

This project provides a small HTTP service that exposes a `save_collection` tool and stores collection data in the Supabase `public.collections` table.

## 1. Local setup

```bash
python -m venv .venv
# Windows:
.venv\Scripts\activate
# macOS/Linux:
# source .venv/bin/activate

pip install -r requirements.txt
```

Set environment variables:

```text
SUPABASE_URL=https://YOUR_PROJECT.supabase.co
SUPABASE_KEY=YOUR_SUPABASE_PUBLISHABLE_KEY
```

Run:

```bash
uvicorn server:app --reload --port 8000
```

Health check:

```text
http://localhost:8000/health
```

## 2. Deploy

You can deploy the included `render.yaml` to Render or deploy the same FastAPI app to another HTTPS host.

Set these environment variables on the host:

- `SUPABASE_URL`
- `SUPABASE_KEY`

Your deployed URL will look like:

```text
https://YOUR-SERVICE.onrender.com
```

The endpoint included for the simple JSON MCP-style test is:

```text
https://YOUR-SERVICE.onrender.com/mcp
```

## 3. Important Inya note

Before entering `/mcp` into Inya, verify which MCP transport/protocol version your Inya workspace requires. A generic HTTP JSON endpoint is not automatically equivalent to an official MCP Streamable HTTP/SSE endpoint.

If Inya rejects this URL as an invalid MCP server, the server needs to be adapted to the exact MCP transport supported by your Inya workspace.

## Tool

### save_collection

Arguments:

- `disposition`: string
- `payment_commitment_date`: string or null
- `payment_commitment_amount`: integer or null
- `callback_required`: boolean
- `callback_date`: string or null
- `escalation_reason`: string or null
- `language`: string

Example tool arguments:

```json
{
  "disposition": "PROMISE_TO_PAY",
  "payment_commitment_date": "2026-08-20",
  "payment_commitment_amount": 5000,
  "callback_required": false,
  "callback_date": null,
  "escalation_reason": null,
  "language": "Tamil"
}
```

## Security

Do not commit `.env` files or publish secret keys. For production, use a server-side secret with the minimum required database permissions.