Skip to main content

Getting Started

About SaasKit

SaasKit is a Python framework for building and orchestrating multi-agent systems, providing code interpreter, MCP tool protocol, and server capabilities accessible via scripts or HTTP.

See OpenAPI documentation at /api page.

Getting Started

1. Installation

Install using pip (recommended):

pip install saaskit

Local development installation:

pip install -e .
# plotly requires additional Chrome kernel download for chart rendering
plotly_get_chrome

2. Create .env File

Copy .env.example to .env and fill in required environment variables for accessing o3 and other models and services.

To convert hexin-style API to OpenAI style, start the proxy:

pip install hexin-server --upgrade
python3 -m hexin_server --host 0.0.0.0 --port 8777 --reload

In .env (or Agent configuration), set:

OPENAI_API_KEY=sk-fastapi-proxy-key-12345
OPENAI_BASE_URL="http://localhost:8777/v1"

You can also write api_key and base_url into Agent configuration file:

  • ./assets/wencai/main.md
  • ./assets/aime/main.md

3. Start Code Interpreter Server

saaskit code-interpreter-server --port 8889 --debug

Note: Ensure the port is not occupied and configure Jupyter parameters correctly if needed.

4. Start MCP Servers

Start MCP services for different tools or Agents. Each port must be unique:

# Example: Assign different ports for wencai and aime
saaskit mcp-server --name wencai --port 7778 --path /mcp --debug
saaskit mcp-server --name aime --port 7777 --path /mcp --debug

If you have a fixed port plan, follow your local environment setup, but avoid port conflicts.

5. Maintain Agent Configuration

  • wencai: ./assets/wencai/main.md
  • aime: ./assets/aime/main.md

Common parameters include model access configuration, tool switches, and custom role settings.

6. Start Agent Server

saaskit agent-server --port 9999 --debug

7. Access Agent Server

Use the provided example scripts for interaction (connects to local port 9999 by default):

python aime.py
python wencai.py

If you modified the service port, synchronize the access address in example scripts or environment variables.

Tips and Notes

  • Port Planning: Ensure MCP and service ports are unique to avoid conflicts.
  • Environment Variables: .env and each Agent's main.md can coexist; priority depends on actual loading order.
  • Chart Rendering: If you need to use Plotly to export charts, run plotly_get_chrome first to install the rendering kernel.