Skip to main content

Python SDK for the Stable Baseline REST API. End-to-end agent-managed company brain — docs, diagrams, plans, and a self-learning Knowledge Graph. 180 tools across 18 categories.

Project description

stablebaseline

PyPI Tools

Python SDK for the Stable Baseline REST API — the simplest, most complete, end-to-end agent-managed company brain. Living docs, 40+ visual diagrams, plans, and a self-learning Knowledge Graph. 163 tools across 16 categories.

Install

pip install stablebaseline

Quick start

from stablebaseline import StableBaseline

# Mint a key at app.stablebaseline.io/settings/mcp-keys
with StableBaseline(api_key="sta_xxx") as sb:
    orgs = sb.tools.listOrganisations()
    print(orgs)

    doc = sb.tools.createDocument(
        folderId="folder-uuid",
        title="Q4 architecture",
        cdmd="# Architecture\n\nThis document covers...",
    )
    print(f"Created {doc['friendlyId']} ({doc['id']})")

    search = sb.tools.kg_search(query="compliance posture", mode="global")
    print(search["entities"])

Or asynchronously:

import asyncio
from stablebaseline import AsyncStableBaseline

async def main() -> None:
    async with AsyncStableBaseline(api_key="sta_xxx") as sb:
        orgs = await sb.tools.listOrganisations()
        print(orgs)

asyncio.run(main())

Auth

StableBaseline(api_key="sta_...")              # API key (mint at app.stablebaseline.io/settings/mcp-keys)
StableBaseline(access_token="...")             # OAuth 2.1 access token
StableBaseline()                               # picks up SB_API_KEY / SB_ACCESS_TOKEN from env

Tool dispatch

Each method on client.tools corresponds to one of the 163 MCP tools:

sb.tools.listOrganisations()
sb.tools.getProjectHierarchy(projectId="...")
sb.tools.createDocument(folderId="...", title="X", cdmd="# ...")
sb.tools.editDocument(documentId="...", versionTimestamp=..., patches=[...])
sb.tools.kg_search(query="...", mode="global")
sb.tools.previewSubscriptionChange(...)
sb.tools.applySubscriptionChange(...)

For dynamic / discovered names, use the callable form:

sb.tools("createDocument", {"folderId": "...", "title": "X", "cdmd": "# Hi"})

Or the lower-level call_tool:

sb.call_tool("createDocument", {"folderId": "...", "title": "X", "cdmd": "# Hi"})

Discover tools at runtime

catalogue = sb.list_tools()
print(f"{catalogue['count']} tools across categories:")
cats = {t['category'] for t in catalogue['tools']}
print(sorted(cats))

Errors

All non-2xx responses raise StableBaselineToolError with status, code, message, and optional details:

from stablebaseline import StableBaseline, StableBaselineToolError

with StableBaseline(api_key="sta_xxx") as sb:
    try:
        sb.tools.deleteDocument(documentId="missing")
    except StableBaselineToolError as e:
        if e.status == 404:
            print("not found")
        elif e.code == "permission_denied":
            print("RBAC said no")
        else:
            raise

Companion packages

Surface Package Use case
Python SDK (this) stablebaseline Python apps, data work
TypeScript SDK @stablebaseline/sdk Node, browsers, Deno, Bun
CLI @stablebaseline/cli (binary sb) Shells, scripts, CI/CD
MCP server https://api.stablebaseline.io/functions/v1/cloud-serve/mcp AI agents (Claude Code, Cursor, Windsurf, ChatGPT, Gemini, …)

All four share the same auth, same handlers, same data — see github.com/stablebaseline/mcp.

License

MIT — see LICENSE at the repo root. The Stable Baseline product itself is proprietary SaaS at stablebaseline.io.

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

stablebaseline-0.3.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stablebaseline-0.3.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file stablebaseline-0.3.1.tar.gz.

File metadata

  • Download URL: stablebaseline-0.3.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for stablebaseline-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f0053d0f1715a83a6831ace6c4a6161ded88cdf69d234fdb8e1697e9f5c70240
MD5 f1c86fa942915261ceda71a6bbd16b66
BLAKE2b-256 1da2d8763673f74f0db36964c751fee697f22b7b5f50759a90c01b9257690140

See more details on using hashes here.

Provenance

The following attestation bundles were made for stablebaseline-0.3.1.tar.gz:

Publisher: release-sdk-python.yml on stablebaseline/mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file stablebaseline-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: stablebaseline-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for stablebaseline-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a853627704d5b224df39c110b8bcf53ffe0f71b60cda4e28b5d970a9a8fc4ba9
MD5 167c50a1b7825e94733df21edbaf6be4
BLAKE2b-256 37d54567db586f10b74f5f331a2013e3bed141b0f3b94c9d2ab44a5268d60e14

See more details on using hashes here.

Provenance

The following attestation bundles were made for stablebaseline-0.3.1-py3-none-any.whl:

Publisher: release-sdk-python.yml on stablebaseline/mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page