Djelia MCP Server

Djelia MCP Server

An MCP server for Djelia that brings Bambara transcription, translation, and text-to-speech to any LLM.

Category
Visit Server

README

<div align="center">

๐ŸŽ™๏ธ Djelia MCP Server

An MCP server for Djelia โ€” bring Bambara transcription, translation, and text-to-speech to any LLM.

Built with FastMCP v3 ยท Python 3.11+ ยท uv-managed

</div>


โœจ Overview

Djelia is a linguistic-AI platform focused on African languages โ€” currently Bambara (bam_Latn), with translation bridging to French (fra_Latn) and English (eng_Latn).

This server wraps the Djelia REST API behind the Model Context Protocol, so any MCP-compatible client (Claude Desktop, Cursor, Cline, your own agent) can call Djelia's models as native tools โ€” no SDK glue, no HTTP plumbing in your prompt.

What you get

# Tool Direction V1 / V2 Returns
1 list_supported_languages โ€” โ€” JSON list
2 translate text โ†’ text v1 translated text
3 transcribe audio โ†’ text v2 text + segment timing
4 text_to_speech text โ†’ audio v2 audio content block

Design note: V2 APIs are exposed for transcription and TTS because they supersede V1 (richer voices via description, format control). True /stream endpoints are omitted โ€” MCP is request/response, so we aggregate the stream inside the tool. Add raw streaming tools only if a use case needs them.


๐Ÿ—๏ธ Architecture

flowchart LR
    subgraph Client["MCP Client"]
        LLM["LLM / Agent<br/>(Claude, Cursor, โ€ฆ)"]
    end

    subgraph Server["djelia-mcp-server (this repo)"]
        MCP["FastMCP Server<br/><i>4 tools, stdio ยท sse ยท http</i>"]
        HANDLERS["Tool Handlers<br/>translate ยท transcribe ยท tts"]
        HTTP["httpx.AsyncClient<br/><i>x-api-key header</i>"]
        MCP --> HANDLERS --> HTTP
    end

    subgraph Djelia["Djelia Cloud API"]
        T1["/v1/translate"]
        T2["/v2/transcribe"]
        T3["/v2/tts"]
    end

    LLM -- "MCP JSON-RPC" --> MCP
    HTTP -- "HTTPS" --> T1
    HTTP -- "HTTPS" --> T2
    HTTP -- "HTTPS" --> T3

Key design choices

  • One shared HTTP client โ€” x-api-key header injected once per request; key read from DJELIA_API_KEY env var.
  • base64 for audio input โ€” MCP payloads are JSON; audio bytes travel as base64 so it works across any client. A magic-byte sniffer (_guess_ext) recovers the right file extension for the multipart upload.
  • Audio output as a content block โ€” FastMCP's Audio helper returns a proper MCP audio block (clients receive it base64-encoded).

๐Ÿ”ง How each tool works

1 ยท list_supported_languages

Returns the language codes you'll pass to translate.

sequenceDiagram
    participant C as Client
    participant S as MCP Server
    participant D as Djelia API
    C->>S: list_supported_languages()
    S->>D: GET /api/v1/models/translate/supported-languages
    D-->>S: [{code, name}, ...]
    S-->>C: structured list

2 ยท translate

sequenceDiagram
    participant C as Client
    participant S as MCP Server
    participant D as Djelia API
    C->>S: translate(source, target, text)
    S->>D: POST /api/v1/models/translate (JSON)
    D-->>S: { "text": "<translated>" }
    S-->>C: structured dict

Parameters

Name Type Values
source enum bam_Latn ยท fra_Latn ยท eng_Latn
target enum bam_Latn ยท fra_Latn ยท eng_Latn
text string the text to translate

3 ยท transcribe (Bambara audio โ†’ text)

The tool decodes base64 โ†’ sniffs the format โ†’ uploads as multipart to the V2 transcription endpoint.

sequenceDiagram
    participant C as Client
    participant S as MCP Server
    participant D as Djelia API
    C->>S: transcribe(audio_base64)
    S->>S: base64decode + guess_ext (mp3/wav/m4a/ogg)
    S->>D: POST /api/v2/models/transcribe (multipart)
    alt single text response
        D-->>S: { "text": "..." }
    else segmented response
        D-->>S: [{ text, start, end }, ...]
    end
    S-->>C: ToolResult (structured + text)

4 ยท text_to_speech (text โ†’ Bambara audio)

sequenceDiagram
    participant C as Client
    participant S as MCP Server
    participant D as Djelia API
    C->>S: text_to_speech(text, description, format)
    S->>D: POST /api/v2/models/tts (JSON)
    D-->>S: binary audio bytes
    S-->>C: Audio content block (base64)

Parameters

Name Type Values
text string text to synthesize
description string voice style, e.g. "calm male voice, slow pace"
format enum mp3 (default) ยท wav ยท wav_8k ยท ulaw_8k

๐Ÿš€ Quickstart

1 ยท Prerequisites

2 ยท Install dependencies

git clone <your-repo-url> djelia-mcp-server
cd djelia-mcp-server
uv sync

3 ยท Set your API key

cp .env.example .env
# edit .env:
#   DJELIA_API_KEY=your_key_here

The server reads DJELIA_API_KEY from the environment. It fails fast with a clear message if the key is missing.


๐ŸŒ Transports

FastMCP supports three transports. Pick the one your client expects.

flowchart TB
    subgraph "Transport decision"
        STDIO["stdio<br/><b>default</b><br/>Claude Desktop, CLI agents"]
        SSE["sse<br/><b>legacy</b><br/>older MCP clients"]
        HTTP["http / streamable-http<br/><b>recommended for network</b>"]
    end
    STDIO -. "stdin/stdout" .-> Srv["FastMCP Server"]
    SSE   -. "HTTP + EventSource<br/>GET /sse/" .-> Srv
    HTTP  -. "HTTP POST<br/>POST /mcp/" .-> Srv
Mode Command Endpoint
stdio (default) uv run fastmcp run server.py โ€”
sse (legacy) uv run fastmcp run server.py -t sse -p 8000 http://127.0.0.1:8000/sse/
http uv run fastmcp run server.py -t http -p 8000 http://127.0.0.1:8000/mcp/
streamable-http uv run fastmcp run server.py -t streamable-http -p 8000 http://127.0.0.1:8000/mcp/

Override host/port with --host / -p. See all options: uv run fastmcp run --help.

Direct Python (without the fastmcp CLI)

Transport is read from DJELIA_TRANSPORT (stdio | sse | http):

DJELIA_TRANSPORT=sse DJELIA_HOST=127.0.0.1 DJELIA_PORT=8000 uv run python server.py

๐Ÿค Client configuration

Claude Desktop / Cursor (stdio)

Drop this into your MCP client config:

{
  "mcpServers": {
    "djelia": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/absolute/path/to/djelia-mcp-server",
        "fastmcp",
        "run",
        "server.py"
      ],
      "env": {
        "DJELIA_API_KEY": "your_api_key"
      }
    }
  }
}

Remote / networked client (SSE or HTTP)

Run the server with -t sse or -t http, then point your client at the endpoint (e.g. http://your-host:8000/mcp/).


๐Ÿ—‚๏ธ Project layout

djelia-mcp-server/
โ”œโ”€โ”€ server.py         # all 4 tools + httpx client + transport switch
โ”œโ”€โ”€ pyproject.toml    # uv project (fastmcp + httpx)
โ”œโ”€โ”€ .env.example      # DJELIA_API_KEY template
โ”œโ”€โ”€ .gitignore
โ””โ”€โ”€ README.md

One file of code โ€” by design. Tools are co-located because they share one client and one concern (calling Djelia).


๐Ÿงช Verifying it works

Smoke-test that all tools register and the server boots on every transport:

# list registered tools
uv run python -c "import asyncio, server; \
  [print(' -', t.name) for t in asyncio.run(server.mcp.list_tools())]"

# boot a transport
uv run fastmcp run server.py -t sse -p 8000

You should see 4 tools listed, and the FastMCP banner with transport 'sse' followed by Uvicorn running.


๐Ÿ“š References


๐Ÿ“ License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured