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. 184 tools across 19 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.4.0.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.4.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stablebaseline-0.4.0.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.4.0.tar.gz
Algorithm Hash digest
SHA256 9f5aae226a2debd2abccde55f9271bf7a06a81dbba2bf4e20072dc2751548bb0
MD5 757162d4fa571d937755671751ada1ec
BLAKE2b-256 c54c2d94cee8d0d9137fc9f6cc1f6b81b835cf3686014c4bfe439836f7dad210

See more details on using hashes here.

Provenance

The following attestation bundles were made for stablebaseline-0.4.0.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: stablebaseline-0.4.0-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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f39e37deefd49dd1ca4779872c91643d599eae39156d915710b23fce14ba77b
MD5 164e72d6a4e0a4aab81fd648fed8404d
BLAKE2b-256 6d1d7750229caff7983564891b34b31fe56adb320db66023172ee684af97fd8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for stablebaseline-0.4.0-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