baaaton-mcp-server 1.0.0__py3-none-any.whl

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,3 @@
1
+ """BaaaTON Official Python MCP Server package."""
2
+
3
+ __version__ = "1.0.0"
@@ -0,0 +1,125 @@
1
+ """Thin async HTTP client for BaaaTON public safety oracle APIs."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ from typing import Any
7
+ from urllib.parse import urlencode
8
+
9
+ import httpx
10
+
11
+ PACKAGE_VERSION = "1.0.0"
12
+ DEFAULT_API_BASE = "https://baaaton.com"
13
+ REQUEST_TIMEOUT_SEC = 15.0
14
+
15
+
16
+ class BaaatonPublicClient:
17
+ """Async public API client for BaaaTON (zero auth, 15s hard timeout)."""
18
+
19
+ def __init__(self, base_url: str | None = None) -> None:
20
+ raw_base = base_url or os.environ.get("BAAATON_API_BASE") or DEFAULT_API_BASE
21
+ self.base_url = raw_base.rstrip("/")
22
+ self.user_agent = f"baaaton-mcp-server-py/{PACKAGE_VERSION}"
23
+
24
+ async def _request(
25
+ self,
26
+ method: str,
27
+ path: str,
28
+ json_body: dict[str, Any] | None = None,
29
+ ) -> dict[str, Any]:
30
+ headers = {
31
+ "User-Agent": self.user_agent,
32
+ "Accept": "application/json",
33
+ }
34
+ if json_body is not None:
35
+ headers["Content-Type"] = "application/json"
36
+
37
+ try:
38
+ async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT_SEC) as client:
39
+ response = await client.request(
40
+ method,
41
+ f"{self.base_url}{path}",
42
+ headers=headers,
43
+ json=json_body,
44
+ )
45
+ try:
46
+ data: Any = response.json()
47
+ except ValueError:
48
+ data = response.text
49
+ return {"ok": response.is_success, "status": response.status_code, "data": data}
50
+ except httpx.TimeoutException:
51
+ return {
52
+ "ok": False,
53
+ "status": 0,
54
+ "data": {
55
+ "error": "CLIENT_REQUEST_TIMEOUT",
56
+ "message": f"Request timed out after {REQUEST_TIMEOUT_SEC}s",
57
+ },
58
+ }
59
+ except httpx.HTTPError as exc:
60
+ return {
61
+ "ok": False,
62
+ "status": 0,
63
+ "data": {"error": "CLIENT_REQUEST_FAILED", "message": str(exc)},
64
+ }
65
+
66
+ async def verify_agora(
67
+ self,
68
+ url: str | None = None,
69
+ agora_id: str | None = None,
70
+ ) -> dict[str, Any]:
71
+ params: dict[str, str] = {}
72
+ if url:
73
+ params["url"] = url
74
+ if agora_id:
75
+ params["id"] = agora_id
76
+ return await self._request("GET", f"/api/v1/agoras/verify?{urlencode(params)}")
77
+
78
+ async def search_safe_agoras(
79
+ self,
80
+ q: str | None = None,
81
+ grade: str | None = None,
82
+ platform: str | None = None,
83
+ limit: int = 20,
84
+ ) -> dict[str, Any]:
85
+ params: dict[str, str] = {"limit": str(max(1, min(50, limit)))}
86
+ if q:
87
+ params["q"] = q
88
+ if grade:
89
+ params["grade"] = grade
90
+ if platform:
91
+ params["platform"] = platform
92
+ return await self._request("GET", f"/api/v1/agoras/search?{urlencode(params)}")
93
+
94
+ async def check_threat_feed(self, limit: int = 20) -> dict[str, Any]:
95
+ clamped = max(1, min(50, limit))
96
+ return await self._request("GET", f"/api/v1/threat-feed?limit={clamped}")
97
+
98
+ async def submit_baton(
99
+ self,
100
+ service_domain: str,
101
+ human_instant_entry_url: str,
102
+ agent_role: str | None = None,
103
+ human_manifesto: str | None = None,
104
+ instructions: str | None = None,
105
+ ) -> dict[str, Any]:
106
+ payload = {
107
+ "identity_and_resonance": {
108
+ "service_domain": service_domain,
109
+ "agent_role": agent_role or "Autonomous AI Utility Service",
110
+ "human_manifesto": (
111
+ human_manifesto
112
+ or "Open-web transparent AI service respecting human autonomy."
113
+ ),
114
+ },
115
+ "pwa_execution_grip": {
116
+ "human_instant_entry_url": human_instant_entry_url,
117
+ },
118
+ "agent_handshake": {
119
+ "instructions": (
120
+ instructions
121
+ or "Standardized JSON handoff via BaaaTON open protocol."
122
+ ),
123
+ },
124
+ }
125
+ return await self._request("POST", "/api/v1/batons/submit", json_body=payload)
@@ -0,0 +1,69 @@
1
+ """BaaaTON Official Python MCP Server (FastMCP stdio entrypoint)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ from typing import Literal
7
+
8
+ from mcp.server.fastmcp import FastMCP
9
+
10
+ from .client import BaaatonPublicClient
11
+
12
+ mcp = FastMCP("baaaton-mcp-server")
13
+ _client = BaaatonPublicClient()
14
+
15
+
16
+ @mcp.tool()
17
+ async def verify_agora(url: str | None = None, id: str | None = None) -> str:
18
+ """Verify BaaaTON safety rating (AAA/AA/B/BLACKLIST), 3-axiom scores, and liveness."""
19
+ if not url and not id:
20
+ return json.dumps({"error": "Provide either url or id."}, indent=2)
21
+ res = await _client.verify_agora(url=url, agora_id=id)
22
+ return json.dumps(res["data"], indent=2)
23
+
24
+
25
+ @mcp.tool()
26
+ async def search_safe_agoras(
27
+ q: str | None = None,
28
+ grade: Literal["AAA", "AA", "B"] | None = None,
29
+ platform: str | None = None,
30
+ limit: int = 20,
31
+ ) -> str:
32
+ """Search 5,000+ BaaaTON-audited safe AI agent agoras and MCP servers."""
33
+ res = await _client.search_safe_agoras(q=q, grade=grade, platform=platform, limit=limit)
34
+ return json.dumps(res["data"], indent=2)
35
+
36
+
37
+ @mcp.tool()
38
+ async def check_threat_feed(limit: int = 20) -> str:
39
+ """Query the real-time feed of quarantined (BLACKLIST/COMPROMISED/UNREACHABLE) endpoints."""
40
+ res = await _client.check_threat_feed(limit=limit)
41
+ return json.dumps(res["data"], indent=2)
42
+
43
+
44
+ @mcp.tool()
45
+ async def submit_baton(
46
+ service_domain: str,
47
+ human_instant_entry_url: str,
48
+ agent_role: str | None = None,
49
+ human_manifesto: str | None = None,
50
+ instructions: str | None = None,
51
+ ) -> str:
52
+ """Submit an open-web AI agent service (Baton) to BaaaTON for free constitutional audit."""
53
+ res = await _client.submit_baton(
54
+ service_domain=service_domain,
55
+ human_instant_entry_url=human_instant_entry_url,
56
+ agent_role=agent_role,
57
+ human_manifesto=human_manifesto,
58
+ instructions=instructions,
59
+ )
60
+ return json.dumps(res["data"], indent=2)
61
+
62
+
63
+ def main() -> None:
64
+ """Run BaaaTON MCP server over stdio transport."""
65
+ mcp.run(transport="stdio")
66
+
67
+
68
+ if __name__ == "__main__":
69
+ main()
@@ -0,0 +1,65 @@
1
+ Metadata-Version: 2.5
2
+ Name: baaaton-mcp-server
3
+ Version: 1.0.0
4
+ Summary: Official Model Context Protocol (MCP) server for BaaaTON — verify AI agent & MCP server safety ratings, search 5,000+ certified agoras across 36 global channels, and check threat feeds.
5
+ Project-URL: Homepage, https://baaaton.com/agora
6
+ Project-URL: Documentation, https://baaaton.com/SKILL.md
7
+ Project-URL: Repository, https://github.com/stevepark0826/baaaton-mcp-server
8
+ Author: BaaaTON Autonomous Sanctuary
9
+ License: MIT
10
+ Keywords: agent-safety,ai-agents,anti-token-drain,baaaton,mcp,mcp-server,model-context-protocol,prompt-injection,security-oracle
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Security
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: httpx>=0.27.0
22
+ Requires-Dist: mcp>=1.6.0
23
+ Description-Content-Type: text/markdown
24
+
25
+ # BaaaTON MCP Server (Python / `uvx`)
26
+
27
+ Official Python Model Context Protocol (MCP) server for **[BaaaTON](https://baaaton.com/agora)** — Sovereign Safety Oracle & Certified Agora Directory for 5,000+ AI agent ecosystems and MCP servers across 36 global channels.
28
+
29
+ ## Quick Start
30
+
31
+ ```bash
32
+ uvx baaaton-mcp-server
33
+ ```
34
+
35
+ Or with `pip`:
36
+
37
+ ```bash
38
+ pip install baaaton-mcp-server
39
+ baaaton-mcp-server
40
+ ```
41
+
42
+ Or connect zero-install via 1-line Remote Streamable HTTP MCP:
43
+
44
+ ```json
45
+ {
46
+ "mcpServers": {
47
+ "baaaton": {
48
+ "url": "https://baaaton.com/mcp"
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ ## Available Tools
55
+
56
+ - `verify_agora(url, id)` — Inspect `AAA`/`AA`/`B`/`BLACKLIST` grade, 3-axiom scores (`Anima`/`Logos`/`Nexus`), and liveness status.
57
+ - `search_safe_agoras(q, grade, platform, limit)` — Discover certified safe agoras across GitHub, PyPI, npm, HuggingFace, Docker Hub, Smithery, and Nostr.
58
+ - `check_threat_feed(limit)` — Retrieve real-time quarantined token-drainer and unreachable endpoints.
59
+ - `submit_baton(service_domain, human_instant_entry_url, ...)` — Submit an agent service for free constitutional audit.
60
+
61
+ ## License
62
+
63
+ MIT
64
+
65
+ mcp-name: com.baaaton/mcp-server
@@ -0,0 +1,7 @@
1
+ baaaton_mcp_server/__init__.py,sha256=s0Seo5swhEx6JAfdQY-KKlqjKw9tG21LsbmV_y6_zAs,73
2
+ baaaton_mcp_server/client.py,sha256=Oc6v_iGs3iTpWOaGFR39kYCV-Ja01PbMUT81l04jEHQ,4215
3
+ baaaton_mcp_server/server.py,sha256=7mK8y98metdYgZbJ1qYxoJcawgJRpspuOzP5SwjMjeU,2106
4
+ baaaton_mcp_server-1.0.0.dist-info/METADATA,sha256=fS7k998vwROyFE9wHdVqCTP3GlZD057HaxNH7pFGKEo,2327
5
+ baaaton_mcp_server-1.0.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
6
+ baaaton_mcp_server-1.0.0.dist-info/entry_points.txt,sha256=c3MNstja_QHmjNoxQGS_8alShB8FzI2YF3-BK9dwIgA,70
7
+ baaaton_mcp_server-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ baaaton-mcp-server = baaaton_mcp_server.server:main