← Back to overview
Open-source · pip-installable · MCP server

Setu

A Model Context Protocol server that exposes Sarvam AI's entire API surface as typed tools — so any MCP agent (Claude Desktop, Cursor, Claude Code, LangGraph) can use Sarvam speech, translation, chat and document tools in minutes.

Python 3.11+ 8 typed tools stdio + streamable-HTTP MIT license CI · mypy --strict · 87% cov
$ pip install setu-mcp
sarvam_transcribesarvam_speaksarvam_translatesarvam_transliteratesarvam_identify_languagesarvam_chatsarvam_parse_documentsetu_ping sarvam_transcribesarvam_speaksarvam_translatesarvam_transliteratesarvam_identify_languagesarvam_chatsarvam_parse_documentsetu_ping
What you get

Sarvam's Indic AI stack, as agent tools

Install one package and any MCP agent can transcribe Hindi calls, speak replies, translate & transliterate, detect language, chat with tool-calling, and digitise KYC documents — every call typed, retried, and priced.

Quickstart

Install & run in 3 steps

Defaults to mock mode — deterministic fixtures, no API key, no credits burned.

bash — install
# from PyPI
pip install setu-mcp

# or run without installing
uvx setu-mcp

# or from source
pip install git+https://github.com/manasasb2000/setu-mcp.git
bash — configure (optional)
# mock is the default — nothing to set
export SETU_MODE=mock

# for real Sarvam calls, switch to live:
# export SETU_MODE=live
# export SARVAM_API_KEY=sk_...   (dashboard.sarvam.ai)
bash — run
# stdio — for Claude Desktop / Cursor / local agents
setu

# or an HTTP endpoint at http://127.0.0.1:8000/mcp
setu --transport streamable-http

Connect to Claude Desktop

1
Install the package

pip install setu-mcp into a Python 3.11+ environment.

2
Add it to the config

Claude Desktop → Settings → Developer → Edit Config, then add the block below.

3
Restart & use it

Reopen Claude Desktop, click the 🔌 tools icon, and ask: "Use sarvam_transcribe on this Hindi audio."

claude_desktop_config.json
{
  "mcpServers": {
    "setu": {
      "command": "setu",
      "env": { "SETU_MODE": "mock" }
    }
  }
}
Try it live

Interactive tool explorer

Pick a tool, tweak the inputs, and run it — right here in your browser (mock fixtures, no key needed).

setu-mcp · tool explorer SETU_MODE=mock · no credits burned

Mock responses mirror the real tool schemas. In live mode these hit Saaras / Bulbul / Mayura / Sarvam-105B / Parse.

The tool surface

8 typed tools, one install

ToolModelWhat it does
setu_pingHealth check — confirms the server is wired up and reports mode.
sarvam_transcribeSaaras v3Speech → text, including code-mixed (Hinglish) audio.
sarvam_speakBulbul v3Text → natural speech (base64 WAV), 11 languages, 30+ voices.
sarvam_translateMayura v1Translate between English and 22 Indian languages.
sarvam_transliterateMayuraConvert script while keeping pronunciation (नमस्ते ↔ namaste).
sarvam_identify_languagetext-lidDetect the language + script of a piece of text.
sarvam_chatSarvam-105B / 30BChat / reasoning with OpenAI-compatible tool-calling.
sarvam_parse_documentParsePDF / image → structured JSON fields (KYC-ready).

Every result also carries cost_inr, latency_ms, and a request_id.

How it works

Every call: validated, retried, priced

MCP client (Claude Desktop / Cursor / LangGraph) │ stdio OR streamable-HTTP / SSE ▼ ┌──────────────────── SETU MCP SERVER ────────────────────┐ │ FastMCP router → typed tool layer (Pydantic in/out) │ │ validate → rate-limit → retry/backoff → │ │ call Sarvam → normalize errors → telemetry │ │ │ │ │ │ ┌───────┴──────┐ ┌──────┴──────┐ │ │ │ MODE: live │ │ OTel spans │ │ │ │ / mock │ │ cost+latency│ │ │ └───────┬──────┘ └─────────────┘ │ └──────────────────┼──────────────────────────────────────┘ ▼ Sarvam APIs — Saaras · Bulbul · Mayura · Sarvam-30B/105B · Parse

Reliability

  • Exponential backoff + jitter on 5xx / network errors; never retries 4xx except 429.
  • Client-side token-bucket rate limiter; respects Retry-After on 429.
  • Typed errors surfaced to the agent on final failure.

Observability

  • Every call wrapped in an OpenTelemetry span.
  • Attributes: model, endpoint, latency_ms, input units, computed cost_inr.
  • Maintained INR pricing table per model / endpoint.

Two transports

  • stdio for local IDE / desktop agents.
  • streamable-http / SSE for hosted, remote use.
  • Both served from one FastMCP server object.

Mock vs live

  • SETU_MODE=mock|live switch.
  • Mock serves deterministic fixtures — CI & contributors never burn credits.
  • Demos work fully offline.
Deploy anywhere

Run it as a container

A multi-stage, non-root image serves the HTTP transport out of the box.

bash — docker
# build and run the HTTP server on :8000/mcp
docker build -t setu-mcp .
docker run --rm -p 8000:8000 setu-mcp

# or one command with compose
docker compose up --build

# live mode
docker run --rm -p 8000:8000 -e SETU_MODE=live -e SARVAM_API_KEY=sk_... setu-mcp