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. 179 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.2.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.2.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stablebaseline-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 7c7cfd0b2109bb2f19c5bde5a11aaf1e3be39a4fff0bc0649b8f8e2f42c61cfe
MD5 dd90e808af2f59b56ff8e716d37a4f8f
BLAKE2b-256 ce31beef2cc058745c63e2a87a79df48fd32162f6f061844258eefe3e8f28743

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: stablebaseline-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb78ac68e0e431ea9952bef959f09404bc9a4b1e7585122acec6e329c83f836b
MD5 302ca9c5364f475639f13f31b8979673
BLAKE2b-256 7b032ea4ddda01c21763b261b6397115c22253af99bf6fbebffba01e792bd84d

See more details on using hashes here.

Provenance

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