minimalai-mcp 0.0.1__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,40 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: minimalai-mcp
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: MCP server for MINIMALAI: AI agents get Cocoon (Telegram/TON) inference and signed oracle verdicts through one key.
|
|
5
|
+
Project-URL: Homepage, https://github.com/miinimal/cocoon-explorer
|
|
6
|
+
Project-URL: Explorer, https://miinimal.github.io/cocoon-explorer/
|
|
7
|
+
Author: Aleksandr Shcherbakov (@miinimal)
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
Keywords: ai-agents,cocoon,mcp,oracle,telegram,ton
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Requires-Dist: httpx>=0.27
|
|
12
|
+
Requires-Dist: mcp<2,>=1.2
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# minimalai-mcp
|
|
16
|
+
|
|
17
|
+
MCP server for **MINIMALAI** — a gateway to [Cocoon](https://github.com/TelegramMessenger), the confidential AI compute network of Telegram and TON.
|
|
18
|
+
|
|
19
|
+
Tools for AI agents:
|
|
20
|
+
- `ask` — run a prompt on a model inside Cocoon (TEE)
|
|
21
|
+
- `oracle` — signed yes/no verdict for TON smart contracts
|
|
22
|
+
- `balance`, `models`
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
pip install minimalai-mcp
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Claude Desktop / any MCP client:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{"mcpServers": {"minimalai": {"command": "minimalai-mcp",
|
|
34
|
+
"env": {"MINIMALAI_URL": "<gateway url>", "MINIMALAI_KEY": "<your key>"}}}}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Key and top-up (TON / Telegram Stars): Telegram bot [@miinimalai](https://t.me/miinimalai).
|
|
38
|
+
Open map of the Cocoon network: https://miinimal.github.io/cocoon-explorer/
|
|
39
|
+
|
|
40
|
+
Status: early access, gateway is being launched.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# minimalai-mcp
|
|
2
|
+
|
|
3
|
+
MCP server for **MINIMALAI** — a gateway to [Cocoon](https://github.com/TelegramMessenger), the confidential AI compute network of Telegram and TON.
|
|
4
|
+
|
|
5
|
+
Tools for AI agents:
|
|
6
|
+
- `ask` — run a prompt on a model inside Cocoon (TEE)
|
|
7
|
+
- `oracle` — signed yes/no verdict for TON smart contracts
|
|
8
|
+
- `balance`, `models`
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
pip install minimalai-mcp
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Claude Desktop / any MCP client:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{"mcpServers": {"minimalai": {"command": "minimalai-mcp",
|
|
20
|
+
"env": {"MINIMALAI_URL": "<gateway url>", "MINIMALAI_KEY": "<your key>"}}}}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Key and top-up (TON / Telegram Stars): Telegram bot [@miinimalai](https://t.me/miinimalai).
|
|
24
|
+
Open map of the Cocoon network: https://miinimal.github.io/cocoon-explorer/
|
|
25
|
+
|
|
26
|
+
Status: early access, gateway is being launched.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "minimalai-mcp"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
description = "MCP server for MINIMALAI: AI agents get Cocoon (Telegram/TON) inference and signed oracle verdicts through one key."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [{ name = "Aleksandr Shcherbakov (@miinimal)" }]
|
|
13
|
+
keywords = ["mcp", "cocoon", "ton", "telegram", "ai-agents", "oracle"]
|
|
14
|
+
dependencies = ["mcp>=1.2,<2", "httpx>=0.27"]
|
|
15
|
+
|
|
16
|
+
[project.urls]
|
|
17
|
+
Homepage = "https://github.com/miinimal/cocoon-explorer"
|
|
18
|
+
Explorer = "https://miinimal.github.io/cocoon-explorer/"
|
|
19
|
+
|
|
20
|
+
[project.scripts]
|
|
21
|
+
minimalai-mcp = "minimalai_mcp.server:main"
|
|
22
|
+
|
|
23
|
+
[tool.hatch.build.targets.wheel]
|
|
24
|
+
packages = ["src/minimalai_mcp"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.1"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""MINIMALAI MCP server: Cocoon inference and signed oracle verdicts for AI agents.
|
|
2
|
+
Author: Aleksandr Shcherbakov (@miinimal) - MINIMALCULT.
|
|
3
|
+
Env: MINIMALAI_URL (gateway base URL), MINIMALAI_KEY (access key from Telegram bot @miinimalai)."""
|
|
4
|
+
import os
|
|
5
|
+
import httpx
|
|
6
|
+
from mcp.server.fastmcp import FastMCP
|
|
7
|
+
|
|
8
|
+
mcp = FastMCP("minimalai")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _cfg():
|
|
12
|
+
url = os.environ.get("MINIMALAI_URL", "").rstrip("/")
|
|
13
|
+
key = os.environ.get("MINIMALAI_KEY", "")
|
|
14
|
+
if not url or not key:
|
|
15
|
+
raise RuntimeError("Set MINIMALAI_URL and MINIMALAI_KEY (get a key in Telegram: @miinimalai)")
|
|
16
|
+
return url, {"Authorization": f"Bearer {key}"}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _call(method: str, path: str, payload=None) -> dict:
|
|
20
|
+
url, headers = _cfg()
|
|
21
|
+
with httpx.Client(timeout=120) as c:
|
|
22
|
+
r = c.request(method, url + path, headers=headers, json=payload)
|
|
23
|
+
if r.status_code == 402:
|
|
24
|
+
return {"error": "balance is empty", "top_up": "https://t.me/miinimalai"}
|
|
25
|
+
r.raise_for_status()
|
|
26
|
+
return r.json()
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@mcp.tool()
|
|
30
|
+
def ask(prompt: str, model: str = "Qwen/Qwen3-32B", max_tokens: int = 800) -> str:
|
|
31
|
+
"""Ask a model running in the Cocoon confidential-compute network (Telegram/TON). Returns the answer text."""
|
|
32
|
+
d = _call("POST", "/v1/chat/completions",
|
|
33
|
+
{"model": model, "messages": [{"role": "user", "content": prompt}], "max_tokens": max_tokens})
|
|
34
|
+
return d["choices"][0]["message"]["content"] if "choices" in d else str(d)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@mcp.tool()
|
|
38
|
+
def oracle(question: str) -> dict:
|
|
39
|
+
"""Get a signed yes/no verdict (majority of several confidential runs) usable by TON smart contracts."""
|
|
40
|
+
return _call("POST", "/v1/oracle/ask", {"question": question})
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@mcp.tool()
|
|
44
|
+
def balance() -> dict:
|
|
45
|
+
"""Show the balance and free requests left on the current key."""
|
|
46
|
+
return _call("GET", "/v1/balance")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@mcp.tool()
|
|
50
|
+
def models() -> dict:
|
|
51
|
+
"""List models available through the gateway."""
|
|
52
|
+
return _call("GET", "/v1/models")
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def main():
|
|
56
|
+
mcp.run()
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
if __name__ == "__main__":
|
|
60
|
+
main()
|