Main Sequence Python SDK
The Main Sequence Python SDK is the client and development toolkit for the Main Sequence platform. It provides authentication, typed platform resources, CodeRepository development and release operations, Agent and A2A workflows, jobs, sharing, observability, logging, tracing, and reusable scaffold tooling.
MetaTables is now an independent domain package, installed as
mainsequence-metatable and imported as metatables. Table models, time-index
table updates, SQLAlchemy schemas, local database interfaces, and Alembic
execution are no longer implemented by this distribution.
Repository Status
- Status: actively maintained
- Open issues: GitHub Issues
- Documentation: Documentation Site
- Security policy: SECURITY.md
- Release history: CHANGELOG.md
- Major-version migrations: Migration guides
What This Repository Contains
Main package areas:
mainsequence.client: API client models for users, CodeRepositories, jobs, Agents, artifacts, constants, secrets, sharing, releases, and other platform resourcesmainsequence.cli: the completemainsequencecommand-line interface for authentication, platform resources, and local CodeRepository operationsmainsequence.instrumentationandmainsequence.logconf: SDK tracing and logging integrationmainsequence.server: optional server-side caller assertion verificationmainsequence.scaffold_skills: reusable, version-pinned skill copying for this SDK and extension libraries
Repository areas:
agent_scaffold/: version-matched SDK skills and managedAGENTS.mdcontentdocs/: knowledge guides, CLI docs, architecture decisions, and generated reference docstests/: offline tests plus explicitly marked live-backend tests
Documentation Map
Recommended entry points:
- Documentation home
- Authentication
- CLI overview
- Git source and Environment context
- Constants and Secrets
- Scheduling Jobs
- Resource releases
- Generated API reference
- MetaTables extraction guide
- ADR 0034
The beginner tutorial is maintained in the separate MainSequence SDK tutorial CodeRepository.
Quick Start
Install and authenticate:
pip install mainsequence
mainsequence login
mainsequence doctor
An already MCP-authenticated coding agent can establish the same persisted CLI
session with mainsequence login --mcp, then call the printed
auth.cli_authorize tool while the command waits. The backend supplies the
callback URI; tokens return directly to the CLI and are never exposed through
MCP.
Inspect and create CodeRepositories:
mainsequence code-repository search
mainsequence code-repository create my-first-repository
mainsequence code-repository set-up-locally <CODE_REPOSITORY_UID>
cd my-first-repository
mainsequence code-repository build-local-venv --path .
Use mainsequence --help and mainsequence code-repository --help for the
installed command surface. The CLI includes Agent and AgentSession,
CodeRepository, jobs and runs, images, resources and releases, constants,
secrets, teams, sharing, scaffold, Docker, and local-development commands.
Python Client
mainsequence.client provides AuthLoaders, MainSequenceClient, generic
request and response helpers, and typed platform adapters. The platform owns
authorization and lifecycle policy. The SDK resolves CodeRepository source
identity from the current Git checkout when an operation requires that context.
Discover deployments with ResourceRelease.filter(name=...) or resolve a known
release UID with ResourceRelease.get(pk=...). For shared deployments owned by
another repository, use the explicitly scoped filter_admin path. See
Resource releases for
supported filters and examples.
Server integrations can install mainsequence[server] for the
framework-independent caller assertion verifier.
Applications remain responsible for resource authorization and storage
operations.
Install mainsequence-metatable and import metatables for table-domain work.
See the MetaTables migration guide
for the install step, old and new imports, retired table CLI commands, and the
legacy SDK option.
Development
This repository requires Python 3.13 or newer and uses pyproject.toml with a
development dependency group.
uv sync --group dev
pytest
ruff check .
mkdocs build --strict
Live-backend tests are marked live and excluded from a normal test run. Run
them explicitly with pytest -m live when credentials and a target backend are
available.
Package metadata is defined in pyproject.toml. This repository is licensed under the MIT License; see LICENSE.
Metadata
Release files for mainsequence 8.1.26
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mainsequence-8.1.26.tar.gz | 349.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mainsequence-8.1.26-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 595.2 kB
Release files / mainsequence-8.1.26.tar.gz
| Download URL | mainsequence-8.1.26.tar.gz |
|---|---|
| Size | 349.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
678b19596e941a4d7cc7f05ed9723a3e4e10f9dd11a5a9bee36bae5082fe2515
|
|
BLAKE2b-256 checksum How to use checksums |
833e468e313bd00a4995740f21d707cd289e05aac919258e0f53cf131e7e1f53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency logRelease files / mainsequence-8.1.26-py3-none-any.whl
| Download URL | mainsequence-8.1.26-py3-none-any.whl |
|---|---|
| Size | 246.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7bc13e186a23f205108090d081133691988e54bfcdf66de714067617124f158a
|
|
BLAKE2b-256 checksum How to use checksums |
3ecd645a423cc6cc3271d61e40ce867d297111beaa5d7a2fd4adc1f1e9d2ffa7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.
Transparency log