> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sunbird.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Server

> Use the Sunbird AI API as tools from Claude Code, Cursor, and other AI agents

The **Sunbird AI MCP server** exposes the Sunbird AI API to AI agents and coding assistants through the [Model Context Protocol](https://modelcontextprotocol.io) (MCP). Once connected, an agent can translate, chat, transcribe audio, and generate speech in African languages by calling typed tools — no HTTP code required.

The server is hosted, so there is nothing to install:

| | |
| :- | :- |
| **Endpoint** | `https://mcp.sunbird.ai/mcp` (Streamable HTTP) |
| **Authentication** | Your Sunbird API token, sent as `Authorization: Bearer <token>` |
| **Guide and tool reference** | [mcp.sunbird.ai](https://mcp.sunbird.ai) |
| **Source** | [SunbirdAI/sunbird-mcp](https://github.com/SunbirdAI/sunbird-mcp) |
| **MCP Registry** | `ai.sunbird/sunbird-mcp` |

> [!NOTE]
>
> There is no separate sign-up. The MCP server uses the same token as the REST API, so usage is billed and rate-limited on your Sunbird account. Tools marked **billed** below run inference; the lookup tools are free.

## Quick Start

**1. Get a token**

Sign in at [api.sunbird.ai](https://api.sunbird.ai) and create a token under [API keys](https://api.sunbird.ai/keys). See [Authentication](https://docs.sunbird.ai/authentication.md) for details. Keep it private — it is the only credential the server needs.

**2. Add the server to your client**

Pick your client under [Connecting a Client](#connecting-a-client).

**3. Make a free call first**

Ask your agent to run `sunbird_check_connection` to confirm the token, then `sunbird_list_languages` to see the language codes, before making a billed call such as a translation.

## Connecting a Client

> [tab] Claude Code
>
> ```bash theme={null}
> claude mcp add --transport http sunbird https://mcp.sunbird.ai/mcp \
>   --header "Authorization: Bearer YOUR_SUNBIRD_TOKEN"
> ```
>
> Or add it to a project's `.mcp.json`:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "sunbird": {
>       "type": "http",
>       "url": "https://mcp.sunbird.ai/mcp",
>       "headers": { "Authorization": "Bearer YOUR_SUNBIRD_TOKEN" }
>     }
>   }
> }
> ```

> [tab] Cursor
>
> Add the server to `.cursor/mcp.json`:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "sunbird": {
>       "url": "https://mcp.sunbird.ai/mcp",
>       "headers": { "Authorization": "Bearer YOUR_SUNBIRD_TOKEN" }
>     }
>   }
> }
> ```

> [tab] Python
>
> Install [FastMCP](https://gofastmcp.com) (`pip install fastmcp`) and call a tool directly:
>
> ```python theme={null}
> import asyncio
> import os
>
> from fastmcp import Client
> from fastmcp.client.transports import StreamableHttpTransport
>
> transport = StreamableHttpTransport(
>     "https://mcp.sunbird.ai/mcp",
>     auth=os.environ["SUNBIRD_API_TOKEN"],  # sent as a bearer token
> )
>
> async def main():
>     async with Client(transport, timeout=180) as client:
>         tools = await client.list_tools()
>         print([tool.name for tool in tools])
>
>         result = await client.call_tool(
>             "sunbird_translate_text",
>             {"text": "How are you?", "target_language": "lug"},
>         )
>         print(result.structured_content["translated_text"])  # Oli otya?
>
> asyncio.run(main())
> ```

> [tab] MCP Inspector
>
> [MCP Inspector](https://github.com/modelcontextprotocol/inspector) lets you browse the tools and try calls from a web UI. It needs Node.js 22.19 or newer.
>
> ```bash theme={null}
> export SUNBIRD_API_TOKEN=...
>
> npx @modelcontextprotocol/inspector \
>   --transport http --server-url https://mcp.sunbird.ai/mcp \
>   --header "Authorization: Bearer $SUNBIRD_API_TOKEN"
> ```
>
> Add `--cli` to script it, for example to list the tools:
>
> ```bash theme={null}
> npx @modelcontextprotocol/inspector --cli \
>   --transport http --server-url https://mcp.sunbird.ai/mcp \
>   --header "Authorization: Bearer $SUNBIRD_API_TOKEN" \
>   --method tools/list
> ```

Any other MCP client that supports Streamable HTTP with custom headers works the same way: point it at `https://mcp.sunbird.ai/mcp` and send the `Authorization: Bearer` header. The server authenticates with Sunbird tokens rather than OAuth, so use the header form.

> [!WARNING]
>
> Treat the token like a password. Prefer an environment variable or your client's secret storage over pasting it into a config file, and never commit a file that contains it.

## Tools

Each tool wraps an endpoint documented in the [API Reference](https://docs.sunbird.ai/api-reference/introduction.md).

| Tool | What it does | Endpoint | Billed |
| :- | :- | :- | :-: |
| `sunbird_translate_text` | Translate between English and 67 African languages. | `POST /tasks/translate` | Yes |
| `sunbird_chat_completion` | Chat and question answering in African languages (`sunflower-9b`). | `POST /tasks/chat/completions` | Yes |
| `sunbird_identify_language` | Detect which language a text is written in. | `POST /tasks/language_id` | Yes |
| `sunbird_transcribe_audio` | Speech-to-text in 51 African languages from a public URL, a local file, or inline audio. | `POST /tasks/audio/transcriptions` | Yes |
| `sunbird_generate_speech` | Text-to-speech with named voices, chosen by speaker name and language. | `POST /tasks/audio/speech` | Yes |
| `sunbird_generate_speech_batch` | Synthesize up to 16 texts in one request. | `POST /tasks/audio/speech/batch` | Yes |
| `sunbird_refresh_speech_url` | Get a fresh download link for audio generated earlier. | `GET /tasks/audio/speech/url` | No |
| `sunbird_list_voices` | Speaker names with gender, grouped by language or filtered to one. | `GET /tasks/voice/speakers` | No |
| `sunbird_list_languages` | Language codes per capability (translation, chat, transcription, speech). | Local catalog | No |
| `sunbird_list_models` | Available models and what each is for. | Local catalog | No |
| `sunbird_check_connection` | Confirm the token and show the account it belongs to. | `GET /auth/me` | No |

The full tool guide is at [mcp.sunbird.ai](https://mcp.sunbird.ai). Your client also shows each tool's parameter and output schema once the server is connected.

## Example Prompts

Once the server is connected, ask your agent in plain language — it picks the tool:

* "Check my Sunbird connection." → `sunbird_check_connection`
* "Translate 'How are you?' into Luganda." → `sunbird_translate_text`
* "Which Sunbird voices are available for Runyankole?" → `sunbird_list_voices`
* "Read this sentence aloud in Luganda with the Namuli voice." → `sunbird_generate_speech`
* "Transcribe the Acholi audio at this URL." → `sunbird_transcribe_audio`

## Limits

| Capability | Coverage | Limit per call |
| :- | :- | :- |
| Translation and chat | English and 67 African languages | 5,000 characters; 50 chat messages |
| Speech-to-text | 51 languages | 25 MB of audio |
| Text-to-speech | 19 languages (44 voices in 16 of them) | 2,000 characters |

Language codes are ISO 639-3 (for example `lug`, `ach`, `nyn`, `teo`, `swa`, `eng`). See [Supported Languages](https://docs.sunbird.ai/languages.md), or call `sunbird_list_languages` for the current list.

## Good to Know

* **Invalid tokens** are rejected with `401` before any tool runs. If your token is rejected, create a new one and run `sunbird_check_connection` again.
* **The first inference call can be slow.** After the upstream model has been idle, the first translation or chat can take a couple of minutes while it warms up; later calls take a few seconds. MCP Inspector gives up after 60 seconds by default, so raise its request timeout if you see a timeout on a first call.
* **Billed tools are not retried automatically** after an ambiguous failure such as a timeout, to avoid double charges. The call may still have completed, so check before retrying.
* **Chat is non-streaming** over MCP, and always uses `sunflower-9b`.
* **Voices are speaker names scoped by language.** Pass both `voice` and `language` to the speech tools — see [Languages and Voices](https://docs.sunbird.ai/guides/text-to-speech.md#languages-and-voices).

## Self-hosting and Discovery

The server is open source. To run it yourself over stdio or HTTP (uv, Docker, or Cloud Run), see the [repository](https://github.com/SunbirdAI/sunbird-mcp).

For automated discovery, the hosted server publishes a Server Card at [`/mcp/server-card`](https://mcp.sunbird.ai/mcp/server-card) and an AI Catalog at [`/.well-known/ai-catalog.json`](https://mcp.sunbird.ai/.well-known/ai-catalog.json). The same connection details are available in machine-readable form under `info.x-mcp-server` in the API's [OpenAPI document](https://api.sunbird.ai/openapi.json).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.