Skip to main content

No project description provided

Project description

Mech Server

PyPI PyPI - Python Version PyPI - Wheel License Downloads

Sanity checks and tests Coverage flake8 mypy Black bandit

A CLI to create, deploy and manage Mechs — AI agents that execute tasks on-chain for payment — on the Olas Marketplace.

Note: The codebase uses the term service (from the underlying Open Autonomy framework) interchangeably with AI agent.

Quick Start

poetry install
poetry run mech setup -c <chain>      # first-time setup; prompts for RPC URL and wallet funding
# edit ~/.operate-mech/.env and set your API keys
poetry run mech run -c <chain>        # run via Docker
poetry run mech stop -c <chain>       # stop when done

Supported Chains

Chain Native OLAS Token USDC Token Nevermined
Gnosis
Base
Polygon
Optimism

The mech payment type is selected at deployment time via the MECH_TYPE env variable.

Requirements

Commands

Command Description
mech setup -c <chain> Full first-time setup: agent build, mech deployment, env config, key setup, metadata generation, IPFS publish, and on-chain update
mech run -c <chain> Run the mech AI agent via Docker
mech run -c <chain> --dev Dev mode: push local packages to IPFS, then run on host (no Docker)
mech stop -c <chain> Stop a running mech AI agent
mech deploy-mech -c <chain> Deploy a mech on the marketplace (runs automatically during setup)
mech push-metadata Generate metadata.json from packages and publish to IPFS
mech update-metadata Update the metadata hash on-chain via Safe transaction
mech add-tool <author> <name> Scaffold a new mech tool

What mech setup does

mech setup runs the following steps in order:

  1. Agent build — creates the AI agent via olas-operate-middleware (skipped if already set up)
  2. Mech deployment — deploys a mech on the marketplace (skipped if already deployed)
  3. Env configuration — writes ~/.operate-mech/.env with required variables
  4. Private key setup — configures operator and agent keys
  5. Metadata generation — generates metadata.json from package definitions
  6. IPFS publish — pushes metadata to IPFS
  7. On-chain update — updates the metadata hash on-chain via Safe transaction

Adding a tool

poetry run mech add-tool <author> <tool_name> -d "My tool description"

Implement the tool in ~/.operate-mech/packages/<author>/customs/<tool_name>/<tool_name>.py, then publish and register on-chain:

poetry run mech push-metadata
poetry run mech update-metadata

See the documentation for the full tool creation, publishing, and on-chain registration workflow.

Documentation

Find the full tutorial (Hello World, creating and publishing tools, sending requests) at stack.olas.network.

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

mech_server-0.5.0.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

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

mech_server-0.5.0-py3-none-any.whl (64.6 kB view details)

Uploaded Python 3

File details

Details for the file mech_server-0.5.0.tar.gz.

File metadata

  • Download URL: mech_server-0.5.0.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mech_server-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a4cab68488344f17659370e22f117eb2ce01e4a268e20c5428ff094b407e8643
MD5 c443a02452b6f4018c5b7ac9ad4053e5
BLAKE2b-256 5f15354ef62b5743b58d11a9bfb81fe76552cee25632454f625e3dbd1485f9bc

See more details on using hashes here.

File details

Details for the file mech_server-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: mech_server-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 64.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mech_server-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da28d2695c5586dc2eefb53d0436a51e4faaa0e0ae387d9f1846c4a21937cc30
MD5 2f258bd43b6e67b200e342d1703fbeb3
BLAKE2b-256 4cdb0f8833aa5c45580b3fff6f46f80e0545ac768a3d497de996a281d5e3d857

See more details on using hashes here.

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