gandr-mcp 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Gandr
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,49 @@
1
+ Metadata-Version: 2.4
2
+ Name: gandr-mcp
3
+ Version: 0.1.0
4
+ Summary: The official Gandr MCP server, text to speech inside any MCP-compatible agent
5
+ Author-email: Gandr <team@gandr.ai>
6
+ License: MIT
7
+ Project-URL: Homepage, https://gandr.ai
8
+ Project-URL: Repository, https://github.com/Gandr-AI/gandr-mcp
9
+ Keywords: mcp,tts,text-to-speech,voice-ai,agents
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: mcp>=1.0
14
+ Dynamic: license-file
15
+
16
+ # gandr-mcp
17
+
18
+ The official **Gandr MCP server**, text to speech inside any MCP-compatible agent (Claude Desktop, Cursor, and friends).
19
+
20
+ ## Tools
21
+
22
+ | Tool | What it does |
23
+ |---|---|
24
+ | `synthesize` | Render text to speech (WAV, base64). Voices, sample rate 8000-48000, pitch and pacing dials |
25
+ | `list_voices` | The six stock voices |
26
+ | `get_usage` | Characters used by the configured key |
27
+
28
+ ## Run
29
+
30
+ ```bash
31
+ pip install mcp
32
+ GANDR_API_KEY=gnd_... python server.py
33
+ ```
34
+
35
+ Claude Desktop:
36
+
37
+ ```json
38
+ {
39
+ "mcpServers": {
40
+ "gandr": {
41
+ "command": "python",
42
+ "args": ["/path/to/server.py"],
43
+ "env": { "GANDR_API_KEY": "gnd_..." }
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ Get a key at [gandr.ai](https://gandr.ai). Docs: [gandr.ai/docs](https://gandr.ai/docs).
@@ -0,0 +1,34 @@
1
+ # gandr-mcp
2
+
3
+ The official **Gandr MCP server**, text to speech inside any MCP-compatible agent (Claude Desktop, Cursor, and friends).
4
+
5
+ ## Tools
6
+
7
+ | Tool | What it does |
8
+ |---|---|
9
+ | `synthesize` | Render text to speech (WAV, base64). Voices, sample rate 8000-48000, pitch and pacing dials |
10
+ | `list_voices` | The six stock voices |
11
+ | `get_usage` | Characters used by the configured key |
12
+
13
+ ## Run
14
+
15
+ ```bash
16
+ pip install mcp
17
+ GANDR_API_KEY=gnd_... python server.py
18
+ ```
19
+
20
+ Claude Desktop:
21
+
22
+ ```json
23
+ {
24
+ "mcpServers": {
25
+ "gandr": {
26
+ "command": "python",
27
+ "args": ["/path/to/server.py"],
28
+ "env": { "GANDR_API_KEY": "gnd_..." }
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ Get a key at [gandr.ai](https://gandr.ai). Docs: [gandr.ai/docs](https://gandr.ai/docs).
@@ -0,0 +1,49 @@
1
+ Metadata-Version: 2.4
2
+ Name: gandr-mcp
3
+ Version: 0.1.0
4
+ Summary: The official Gandr MCP server, text to speech inside any MCP-compatible agent
5
+ Author-email: Gandr <team@gandr.ai>
6
+ License: MIT
7
+ Project-URL: Homepage, https://gandr.ai
8
+ Project-URL: Repository, https://github.com/Gandr-AI/gandr-mcp
9
+ Keywords: mcp,tts,text-to-speech,voice-ai,agents
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: mcp>=1.0
14
+ Dynamic: license-file
15
+
16
+ # gandr-mcp
17
+
18
+ The official **Gandr MCP server**, text to speech inside any MCP-compatible agent (Claude Desktop, Cursor, and friends).
19
+
20
+ ## Tools
21
+
22
+ | Tool | What it does |
23
+ |---|---|
24
+ | `synthesize` | Render text to speech (WAV, base64). Voices, sample rate 8000-48000, pitch and pacing dials |
25
+ | `list_voices` | The six stock voices |
26
+ | `get_usage` | Characters used by the configured key |
27
+
28
+ ## Run
29
+
30
+ ```bash
31
+ pip install mcp
32
+ GANDR_API_KEY=gnd_... python server.py
33
+ ```
34
+
35
+ Claude Desktop:
36
+
37
+ ```json
38
+ {
39
+ "mcpServers": {
40
+ "gandr": {
41
+ "command": "python",
42
+ "args": ["/path/to/server.py"],
43
+ "env": { "GANDR_API_KEY": "gnd_..." }
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ Get a key at [gandr.ai](https://gandr.ai). Docs: [gandr.ai/docs](https://gandr.ai/docs).
@@ -0,0 +1,9 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ server.py
5
+ gandr_mcp.egg-info/PKG-INFO
6
+ gandr_mcp.egg-info/SOURCES.txt
7
+ gandr_mcp.egg-info/dependency_links.txt
8
+ gandr_mcp.egg-info/requires.txt
9
+ gandr_mcp.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ mcp>=1.0
@@ -0,0 +1 @@
1
+ server
@@ -0,0 +1,18 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "gandr-mcp"
7
+ version = "0.1.0"
8
+ description = "The official Gandr MCP server, text to speech inside any MCP-compatible agent"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = {text = "MIT"}
12
+ authors = [{name = "Gandr", email = "team@gandr.ai"}]
13
+ keywords = ["mcp", "tts", "text-to-speech", "voice-ai", "agents"]
14
+ dependencies = ["mcp>=1.0"]
15
+
16
+ [project.urls]
17
+ Homepage = "https://gandr.ai"
18
+ Repository = "https://github.com/Gandr-AI/gandr-mcp"
@@ -0,0 +1,104 @@
1
+ """gandr-mcp, the Gandr TTS MCP server.
2
+
3
+ Puts text-to-speech inside any MCP-compatible agent (Claude Desktop, Cursor,
4
+ and friends) as three tools: synthesize, list_voices, get_usage.
5
+
6
+ Run it:
7
+ pip install mcp
8
+ GANDR_API_KEY=gnd_... python server.py
9
+
10
+ Claude Desktop config:
11
+ {
12
+ "mcpServers": {
13
+ "gandr": {
14
+ "command": "python",
15
+ "args": ["/path/to/server.py"],
16
+ "env": {"GANDR_API_KEY": "gnd_..."}
17
+ }
18
+ }
19
+ }
20
+ """
21
+
22
+ from __future__ import annotations
23
+
24
+ import base64
25
+ import json
26
+ import os
27
+ import urllib.request
28
+
29
+ from mcp.server.fastmcp import FastMCP
30
+
31
+ DOOR = os.environ.get("GANDR_DOOR", "https://tts.gandr.ai")
32
+ KEY = os.environ.get("GANDR_API_KEY", "")
33
+
34
+ mcp = FastMCP("gandr")
35
+
36
+ VOICES = ["gandr-ava", "gandr-dane", "gandr-jenny",
37
+ "gandr-leo", "gandr-lewis", "gandr-mia"]
38
+
39
+
40
+ def _call(path: str, body: dict | None) -> bytes:
41
+ req = urllib.request.Request(
42
+ DOOR + path,
43
+ data=json.dumps(body).encode() if body is not None else None,
44
+ method="POST" if body is not None else "GET",
45
+ headers={"x-api-key": KEY, "content-type": "application/json"},
46
+ )
47
+ with urllib.request.urlopen(req, timeout=60) as r:
48
+ return r.read()
49
+
50
+
51
+ @mcp.tool()
52
+ def synthesize(
53
+ text: str,
54
+ voice: str = "gandr-ava",
55
+ sample_rate: int = 24000,
56
+ temperature: float | None = None,
57
+ cfg_weight: float | None = None,
58
+ ) -> str:
59
+ """Render text to speech. Returns the WAV audio base64-encoded.
60
+
61
+ voice: one of gandr-ava, gandr-dane, gandr-jenny, gandr-leo, gandr-lewis,
62
+ gandr-mia. temperature: 0.1-1.2 pitch range (omit for the tuned default).
63
+ cfg_weight: 0.2-1.0 pacing. sample_rate: 8000-48000.
64
+ """
65
+ if not text.strip():
66
+ return "error: text must not be empty"
67
+ if len(text) > 2000:
68
+ return "error: 2000-character request cap, split the text"
69
+ body: dict = {
70
+ "transcript": text,
71
+ "language": "en",
72
+ "voice": {"mode": "id", "id": voice},
73
+ "output_format": {"sample_rate": sample_rate},
74
+ }
75
+ if temperature is not None:
76
+ body["temperature"] = temperature
77
+ if cfg_weight is not None:
78
+ body["cfg_weight"] = cfg_weight
79
+ try:
80
+ audio = _call("/v1/tts/bytes", body)
81
+ except Exception as e: # the door's own message is the useful part
82
+ return f"error: {e}"
83
+ return base64.b64encode(audio).decode()
84
+
85
+
86
+ @mcp.tool()
87
+ def list_voices() -> str:
88
+ """List the available Gandr voices with their ids."""
89
+ return "\n".join(VOICES)
90
+
91
+
92
+ @mcp.tool()
93
+ def get_usage() -> str:
94
+ """Characters used vs quota for the configured API key."""
95
+ try:
96
+ return _call("/v1/usage", None).decode()
97
+ except Exception as e:
98
+ return f"error: {e}"
99
+
100
+
101
+ if __name__ == "__main__":
102
+ if not KEY:
103
+ raise SystemExit("GANDR_API_KEY is not set, get a key at https://gandr.ai")
104
+ mcp.run()
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+