Metadata-Version: 2.5
Name: hasab-mcp
Version: 0.1.0
Summary: MCP server for Hasab AI — translation, TTS, transcription, and chat
Author: Hasab AI
License: MIT
Requires-Python: >=3.11
Requires-Dist: fastapi>=0.115.0
Requires-Dist: httpx>=0.28.0
Requires-Dist: mcp>=2.1.0
Requires-Dist: pydantic-settings>=2.0
Requires-Dist: pydantic>=2.0
Requires-Dist: uvicorn[standard]>=0.32.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: respx>=0.22; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# Hasab MCP

[MCP](https://modelcontextprotocol.io/) server for [Hasab AI](https://hasab.ai) — translation, summarization, transcription, text-to-speech, and chat. Calls `api.hasab.ai` with your API key.

## Requirements

- Python 3.11+
- A Hasab API key (`HASAB_KEY_…` from the portal)

## Install (local dev)

```bash
git clone git@github.com:Yosinan/hasab-mcp.git
cd hasab-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
cp .env.example .env   # set HASAB_API_KEY
```

## Cursor

Add to `~/.cursor/mcp.json` (or project `.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "hasab": {
      "command": "python",
      "args": ["-m", "hasab_mcp"],
      "cwd": "/absolute/path/to/hasab-mcp",
      "env": {
        "HASAB_API_KEY": "HASAB_KEY_…"
      }
    }
  }
}
```

After publish to PyPI:

```json
{
  "mcpServers": {
    "hasab": {
      "command": "uvx",
      "args": ["hasab-mcp"],
      "env": {
        "HASAB_API_KEY": "HASAB_KEY_…"
      }
    }
  }
}
```

Restart Cursor. You should see six tools: `hasab_translate`, `hasab_summarize`, `hasab_transcribe`, `hasab_tts`, `hasab_list_tts_speakers`, `hasab_chat`.

## Claude Desktop

Edit `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`) with the same `mcpServers` block as above.

## Tools (v1)

| Tool | Hasab API |
| --- | --- |
| `hasab_translate` | `POST /api/translate` |
| `hasab_summarize` | `POST /api/summarize` |
| `hasab_transcribe` | `POST /api/upload-audio` |
| `hasab_tts` | `POST /api/tts/synthesize` |
| `hasab_list_tts_speakers` | `GET /api/tts/speakers` |
| `hasab_chat` | `POST /api/chat` |

Translation codes include `amh`, `eng`, `orm`, `tig` (and aliases `en`, `am`, `ti`, `Oromo`, `Tigrigna`).

## Environment

| Variable | Required | Default |
| --- | --- | --- |
| `HASAB_API_KEY` | Yes | — |
| `HASAB_API_BASE_URL` | No | `https://api.hasab.ai` |
| `HASAB_MCP_AUDIO_DIR` | No | `{temp}/hasab-mcp/audio` |
| `HASAB_MCP_TIMEOUT` | No | `120` |
| `HASAB_MCP_LOG_LEVEL` | No | `INFO` |

## Optional HTTP health app

```bash
uvicorn app.main:app --reload --port 8080
curl localhost:8080/health
```

Used for ops and future hosted MCP (ChatGPT connectors). The IDE integration uses **stdio** only.

## Test

```bash
pytest
```

## License

MIT
