Python SDK for Docker operations with automatic authentication through BlackAnt platform
Project description
BlackAnt SDK
Python SDK for Docker operations with automatic authentication through the BlackAnt platform.
Features
- Automatic authentication with BlackAnt platform
- Build Docker images on remote daemon
- Push images to private registry
- Service management (list, status, delete)
- Both Python API and CLI interface
Installation
pip install blackant-sdk
Quick Start
Python API
from blackant import BlackAntClient
# Initialize client
client = BlackAntClient(
user="your-username",
password="your-password",
base_url="https://your-blackant-instance.com"
)
# Authenticate
if client.authenticate():
print("Connected to BlackAnt!")
# Build and push a service
result = client.build_service(
service_name="my-calculation",
impl_path="./src/calculation/impl",
tag="v1.0.0",
push=True
)
print(f"Image: {result['full_image']}")
# List services
services = client.list_services()
for svc in services:
print(f" - {svc['name']}: {svc['status']}")
Command Line Interface (CLI)
# Set credentials via environment variables
export BLACKANT_USER=your-username
export BLACKANT_PASSWORD=your-password
export BLACKANT_URL=https://your-blackant-instance.com
# Test connection
blackant login
# Build and push
blackant build --name my-calculation --path ./src/calculation/impl --tag v1.0.0
# List services
blackant list
# Get service status
blackant status my-calculation
# Delete service
blackant delete my-calculation
Environment Variables
| Variable | Description | Default |
|---|---|---|
BLACKANT_USER |
Username for authentication | - |
BLACKANT_PASSWORD |
Password for authentication | - |
BLACKANT_URL |
BlackAnt platform base URL | https://dev.blackant.app |
API Reference
BlackAntClient
The main client class providing all SDK functionality.
Methods
| Method | Description |
|---|---|
authenticate() |
Authenticate with BlackAnt platform |
test_connection() |
Test if connection is working |
build_service(...) |
Build Docker image and optionally push |
list_services() |
List all registered services |
get_service(name) |
Get service details |
get_service_status(name) |
Get service status |
delete_service(name) |
Delete a service |
CLI Commands
| Command | Description |
|---|---|
blackant login |
Test connection and authenticate |
blackant build |
Build Docker image and push to registry |
blackant list |
List all registered services |
blackant status <name> |
Get status of a service |
blackant info <name> |
Get detailed service information |
blackant delete <name> |
Delete a service |
Use blackant <command> --help for detailed options.
MCP Interface
The SDK includes a Model Context Protocol (MCP) server that allows AI agents (Claude Desktop, etc.) to interact with the BlackAnt platform through standardized tool calls.
Installation
pip install blackant-sdk[mcp]
Configuration
Set the following environment variables:
| Variable | Required | Description | Default |
|---|---|---|---|
BLACKANT_USER |
Yes | Username for auto-authentication at startup | - |
BLACKANT_PASSWORD |
Yes | Password for auto-authentication at startup | - |
BLACKANT_BASE_URL |
No | BlackAnt platform URL | https://dev.blackant.app |
BLACKANT_LOG_LEVEL |
No | Logging level | INFO |
Running the MCP Server
Local (stdio) — for Claude Desktop, Cursor, VS Code:
blackant-mcp --transport stdio
Remote (SSE) — for Perplexity Computer, hosted deployment:
blackant-mcp --transport sse --port 8000
| Variable | Description | Default |
|---|---|---|
BLACKANT_MCP_HOST |
SSE bind host | 0.0.0.0 |
BLACKANT_MCP_PORT |
SSE bind port | 8000 |
BLACKANT_MCP_AUTH |
Enable Keycloak token verification | true |
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"blackant": {
"command": "blackant-mcp",
"args": ["--transport", "stdio"],
"env": {
"BLACKANT_USER": "your-username",
"BLACKANT_PASSWORD": "your-password",
"BLACKANT_BASE_URL": "https://dev.blackant.app"
}
}
}
}
Perplexity Computer Configuration
In Perplexity: Settings > Connectors > + Custom connector > Remote:
| Field | Value |
|---|---|
| Name | BlackAnt Computing Platform |
| MCP Server URL | https://dev.blackant.app/api/mcp/sse |
| Transport | SSE |
| Auth | API Key (Keycloak Bearer token) |
Docker Deployment
docker build -f src/blackant/mcp/Dockerfile -t blackant-mcp .
docker run -p 8000:8000 \
-e BLACKANT_USER=your-username \
-e BLACKANT_PASSWORD=your-password \
-e BLACKANT_BASE_URL=https://dev.blackant.app \
blackant-mcp
Available MCP Tools
Authentication:
| Tool | Description |
|---|---|
blackant_authenticate |
Manual (re-)authentication with username/password |
blackant_token_status |
Check current authentication status |
blackant_test_connection |
Test connectivity to BlackAnt platform |
Service Management:
| Tool | Description |
|---|---|
blackant_build_service |
Build and deploy a Docker service |
blackant_list_services |
List all registered services |
blackant_get_service |
Get detailed service information |
blackant_service_status |
Get runtime status of a service |
Scheduler (Computation):
| Tool | Description |
|---|---|
blackant_create_schedule |
Create a computation schedule with parameters |
blackant_schedule_status |
Check schedule state (waiting/running/done/failed) |
blackant_get_task_result |
Get computation results and logs |
blackant_list_schedules |
List all schedules with states |
blackant_delete_schedule |
Delete a schedule (cleanup) |
Example Agent Workflow
A researcher asks: "Run my-calc with numbers [1,2,3,4,5] and show me the result"
The agent calls the following tools in sequence:
blackant_test_connection— verify platform is reachableblackant_create_schedule(calculation_name="my-calc", cmd_args='{"numbers": [1,2,3,4,5]}')— start computationblackant_schedule_status(schedule_uuid="...")— poll until doneblackant_get_task_result(schedule_uuid="...")— retrieve resultsblackant_delete_schedule(schedule_uuid="...")— cleanup
Any MCP-compatible agent (Claude Desktop, custom agents using the MCP SDK) can use these tools.
Requirements
- Python 3.11+
- Access to a BlackAnt platform instance
- Valid BlackAnt credentials
License
Proprietary - Obuda University, John von Neumann Faculty of Informatics
About
This SDK is developed and maintained by the BlackAnt Development Team at:
Obuda University - John von Neumann Faculty of Informatics (Óbudai Egyetem - Neumann János Informatikai Kar)
| Address | 1034 Budapest, Bécsi út 96/B, Hungary |
| Phone | +36 1 666 5520 |
| titkarsag@nik.uni-obuda.hu | |
| Web | nik.uni-obuda.hu |
Support
For SDK issues and questions, contact the BlackAnt Development Team at dev@blackant.app
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blackant_sdk-1.1.95.tar.gz.
File metadata
- Download URL: blackant_sdk-1.1.95.tar.gz
- Upload date:
- Size: 166.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e44566d00ce85a90c9f04a5a5070ede59114bf24db895371449c313d0da4fe62
|
|
| MD5 |
5227a7502101c0ef0c0581ad322e45b0
|
|
| BLAKE2b-256 |
9df77293f1f0192d68cbfa437c20256a65c9f7882336599037a99096400fb094
|
File details
Details for the file blackant_sdk-1.1.95-py3-none-any.whl.
File metadata
- Download URL: blackant_sdk-1.1.95-py3-none-any.whl
- Upload date:
- Size: 111.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
535ff59bb2d5e6df03e7b801f851dd3c37507e602e85fcd5a2e19b54d33a4262
|
|
| MD5 |
af738826aac4b2647a932449dc54cd9b
|
|
| BLAKE2b-256 |
00bd1b5c41fd8f790021da32f2d54ae32094bf8ed91a58d11ca39b3a116ba496
|