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. 184 tools across 19 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 184 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.3.tar.gz (6.1 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.3-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stablebaseline-0.4.3.tar.gz
  • Upload date:
  • Size: 6.1 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.3.tar.gz
Algorithm Hash digest
SHA256 3a3c979e9dbbdaf3beec31eb143f9d20785a1837128851593888149aed8c92a8
MD5 dec4c8af2964e2fda2d76cfe31c043c6
BLAKE2b-256 f235a081a664e3631f9477d3fac313dec1dfdcc5e123c33e7d9651aed99cb892

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: stablebaseline-0.4.3-py3-none-any.whl
  • Upload date:
  • Size: 6.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 01d67bbfb077bdf55d4877a601d2d2f1e317e6ce2f3f0cb432a94ca4cdb6a45e
MD5 5dd291becc345a200b827bf5a041135a
BLAKE2b-256 a9589a6315590af820e6f72fa648380c977806cb67872b7b9becd128ce1506ea

See more details on using hashes here.

Provenance

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