No project description provided
Project description
Mech Server
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
pip install mech-server
mech setup -c <chain>
mech run -c <chain>
Supported Chains
| Chain | Native | OLAS Token | USDC Token | Nevermined |
|---|---|---|---|---|
| Gnosis | ✅ | ✅ | ❌ | ✅ |
| Base | ✅ | ✅ | ❌ | ✅ |
| Polygon | ✅ | ✅ | ✅ | ✅ |
| Optimism | ✅ | ✅ | ❌ | ✅ |
Requirements
- Python
>=3.10, <3.12 - Docker Engine + Docker Compose
Commands
| Command | Description |
|---|---|
mech setup -c <chain> |
Full first-time setup: workspace, agent build, mech deployment, env config, key setup |
mech add-tool <author> <name> |
Scaffold a new mech tool |
mech prepare-metadata -c <chain> |
Recompute package fingerprints, push packages and metadata to IPFS, and write METADATA_HASH and TOOLS_TO_PACKAGE_HASH to .env |
mech prepare-metadata -c <chain> --offchain-url <url> |
Same as above, also sets the offchain URL in metadata and .env |
mech update-metadata -c <chain> |
Update the metadata hash on-chain via Safe transaction |
mech run -c <chain> |
Run the mech AI agent via Docker |
mech stop -c <chain> |
Stop a running mech AI agent |
Developing a new tool
New service (no existing mech)
-
Set up the workspace and deploy the mech on-chain:
mech setup -c <chain>
-
Scaffold a tool:
mech add-tool <author> <tool_name> -d "Tool description"
-
Implement the tool logic in
~/.operate-mech/packages/<author>/customs/<tool_name>/<tool_name>.py. The scaffold generates a working stub with the correct structure:ALLOWED_TOOLS = ["tool_name"] def run(**kwargs: Any) -> MechResponse: prompt = kwargs.get("prompt") if prompt is None: return error_response("No prompt has been given.") result = do_work(prompt) context = None artifact = None callback = None return result, prompt, context, artifact, callback
-
If your tool requires API keys or other secrets, add them to
~/.operate-mech/.env. -
(Optional) If your mech should serve off-chain requests over HTTP, provide a URL that routes to the mech's HTTP server (
localhost:8000). This URL is included in the mech's on-chain metadata so that clients can discover it:mech prepare-metadata -c <chain> --offchain-url <url>
Alternatively, set
MECH_OFFCHAIN_URLin~/.operate-mech/.env.<chain>and runprepare-metadatawithout the flag. -
Generate and publish metadata (to IPFS), then update the on-chain registry:
mech prepare-metadata -c <chain> mech update-metadata -c <chain>
-
Run:
mech run -c <chain>
Existing service (mech already running)
-
Stop the service:
mech stop -c <chain>
-
Scaffold, implement, and set any required API keys (same as steps 2–4 above).
-
Generate and publish metadata (to IPFS), then update:
mech prepare-metadata -c <chain> mech update-metadata -c <chain>
-
Restart:
mech run -c <chain>
Documentation
Find the full tutorial (tool development, publishing, sending requests) at stack.olas.network.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mech_server-0.8.2.tar.gz.
File metadata
- Download URL: mech_server-0.8.2.tar.gz
- Upload date:
- Size: 839.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec8c495febacd8fd3dd4c04e47575971fbddd96d2f518641f0c128e4846e4121
|
|
| MD5 |
c8598f2e1e887a47e507964ed4e6c935
|
|
| BLAKE2b-256 |
e08ba3e70dd15544c06080cd11270d7bdcd289d730263da888c16a28ac908a6c
|
File details
Details for the file mech_server-0.8.2-py3-none-any.whl.
File metadata
- Download URL: mech_server-0.8.2-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20f12df6e6b09b39e08370e475fd0a340b9a04b69147e099453e7d8bbaff03c6
|
|
| MD5 |
012254a69a5b2517a30c35a1ef08d677
|
|
| BLAKE2b-256 |
8c592648dbb592265014a0dcfd79d0c10459b463060e2d3bd4ee8e68a5801f9b
|