Skip to main content

sema4ai-action-server

Sema4.ai Action Server is a Python framework designed to provide your Python functions to AI Agents. It works both as an MCP Server (hosting tools, resources and prompts) and also provides an OpenAPI compatible API.

A tool or action in this case is defined as a Python function (which has inputs/outputs defined), which is served by the Sema4.ai Action Server.

The Sema4.ai Action Server automatically provides a /mcp endpoint for connecting MCP clients and also generates an OpenAPI spec for your Python code, enabling different AI/LLM Agents to understand and call your Action. It also manages the Action lifecycle and provides full traceability of what happened during any tool or action call (open the /runs endpoint in a browser to see not only inputs and output, but also a full log.html with internal details, such as variables and function calls that your Python function executed).

1. Install Action Server

Action Server is available as a stand-alone fully signed executable and via pip install sema4ai-action-server.

We recommend the executable to prevent confusion in case you have multiple/crowded Python environments, etc.

For macOS

# Install Sema4.ai Action Server
brew update
brew install sema4ai/tools/action-server

For Windows

# Download Sema4.ai Action Server
curl -o action-server.exe https://cdn.sema4.ai/action-server/releases/latest/windows64/action-server.exe

# Add to PATH or move to a folder that is in PATH
setx PATH=%PATH%;%CD%

For Linux

# Download Sema4.ai Action Server
curl -o action-server https://cdn.sema4.ai/action-server/releases/latest/linux64/action-server
chmod a+x action-server

# Add to PATH or move to a folder that is in PATH
sudo mv action-server /usr/local/bin/

2. Run your first MCP tool

# Bootstrap a new project using this template.
# You'll be prompted for the name of the project (directory):
action-server new

# Start Action Server
cd my-project
action-server start

👉 You should now have an Action Server running locally at: http://localhost:8080, so open that in your browser and the web UI will guide you further.

What do you need in your Action Package

An Action Package is currently defined as a local folder that contains at least one Python file containing an action entry point (a Python function marked with @action -decorator from sema4ai.actions).

The package.yaml file is required for specifying the Python environment and dependencies for your Action (RCC will be used to automatically bootstrap it and keep it updated given the package.yaml contents).

Note: the package.yaml is optional if the action server is not being used as a standalone (i.e.: if it was pip-installed it can use the same python environment where it's installed).

Bootstrapping a new Action

Start new projects with:

action-server new

Note: the action-server executable should be automatically added to your python installation after pip install sema4ai-action-server, but if for some reason it wasn't pip-installed, it's also possible to use python -m sema4ai.action_server instead of action-server.

After creating the project, it's possible to serve the actions under the current directory with:

action-server start

For example: When running action-server start, the action server will scan for existing actions under the current directory, and it'll start serving those.

After it's started, it's possible to access the following URLs:

  • /index.html: UI for the Action Server.
  • /openapi.json: Provides the openapi spec for the action server.
  • /docs: Provides access to the APIs available in the server and a UI to test it.

Documentation

Explore our docs for extensive documentation.

Changelog

A list of releases and corresponding changes can be found in the changelog.

Metadata

Release files for sema4ai-action-server 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sema4ai-action-server 3.2.0
File Size Uploaded
sema4ai_action_server-3.2.0.tar.gz 474.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sema4ai-action-server 3.2.0
File Interpreter ABI Platform
sema4ai_action_server-3.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 711.1 kB

Release files / sema4ai_action_server-3.2.0.tar.gz

Download URL sema4ai_action_server-3.2.0.tar.gz
Size 474.2 kB
Tags Source
SHA-256 checksum
How to use checksums
894c7a4f92d777cbb158ff5685c37544b491b1fa96e9cd266672a55eac9aab75
BLAKE2b-256 checksum
How to use checksums
31c616e74abdc79f496febd57263308c9487bf30ded67781b2b48e16a8203cce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.12.13 Linux/6.8.0-1044-azure

Release files / sema4ai_action_server-3.2.0-py3-none-any.whl

Download URL sema4ai_action_server-3.2.0-py3-none-any.whl
Size 236.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a7ae5ca2ad1bbb8d97f98a69776d817736e3c62e791a6b8f2b45c8bf0d8b15c
BLAKE2b-256 checksum
How to use checksums
d85f53649fc741a66bbe69429e2de19bb78233c54cd68986a6536f37c5686a13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.12.13 Linux/6.8.0-1044-azure

Release history Release notifications | RSS feed

This release

3.2.0 This release

2 release files

3.1.1

3 release files

3.1.0

1 release file

3.0.0

7 release files

2.17.2

7 release files

2.17.0

7 release files

2.16.3

7 release files

2.16.2

7 release files

2.16.1

7 release files

2.14.2

7 release files

2.14.1

7 release files

2.14.0

7 release files

2.13.1

7 release files

2.13.0

7 release files

2.12.1

7 release files

2.12.0

7 release files

2.9.1

7 release files

2.9.0

7 release files

2.8.3

7 release files

2.8.2

7 release files

2.8.0

7 release files

2.7.0

7 release files

2.6.0

10 release files

2.5.3

10 release files

2.5.2

10 release files

2.4.0

10 release files

2.3.1

10 release files

2.3.0

10 release files

2.2.0

10 release files

2.1.0

10 release files

2.0.0

10 release files

1.1.2

10 release files

1.0.1

10 release files

1.0.0

10 release files

0.16.0

7 release files

0.12.1

9 release files

0.9.1

10 release files

0.9.0

10 release files

0.5.3

10 release files

0.5.2

10 release files

0.5.1

10 release files

0.5.0

10 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page