Self-Host in 5 Minutes with stoactl
Get a local MCP Gateway running and bridge your first REST API β no cloud account needed.
What You'll Buildβ
By the end of this guide, you'll have:
- A running STOA MCP Gateway (Docker)
- An OpenAPI spec automatically converted to MCP tools
- AI-callable tools registered on your local gateway
Prerequisitesβ
- Docker (Docker Desktop or Docker Engine)
- Go 1.25+ to build stoactl from
stoa-platform/stoa/stoa-go
Install stoactlβ
Do not use go install github.com/stoa-platform/stoactl@latest (frozen standalone repository at v0.3.0), brew install stoa-platform/tap/stoactl (outdated Homebrew tap formula 0.1.1 and cask 0.3.0), or https://get.gostoa.dev (legacy bootstrap URLs). Monorepo GitHub Releases stoa-go-v0.3.9 and stoa-go-v0.3.10 publish zero binary assets; build stoactl from a verified monorepo checkout instead.
- Release tag (stoa-go-v0.3.10)
- Verified main commit (639e8b9a)
git clone https://github.com/stoa-platform/stoa.git
cd stoa
git checkout stoa-go-v0.3.10
cd stoa-go
make install # installs stoactl into GOBIN if set, otherwise $(go env GOPATH)/bin
git clone https://github.com/stoa-platform/stoa.git
cd stoa
git checkout 639e8b9a2217695cfc2f590e246ed9d4ce4d4913
cd stoa-go
go install -ldflags "-s -w -X github.com/stoa-platform/stoa-go/internal/cli/cmd.Version=0.3.10-main -X github.com/stoa-platform/stoa-go/internal/cli/cmd.Commit=639e8b9a" \
./cmd/stoactl
Ensure GOBIN (or $(go env GOPATH)/bin when GOBIN is unset) is in your PATH, then verify the installation:
stoactl version
Step 1: Initialize a Projectβ
stoactl init my-api
cd my-api
This creates a complete project scaffold:
my-api/
βββ docker-compose.yml # Gateway + echo backend
βββ stoa.yaml # Gateway configuration
βββ echo-nginx.conf # Echo backend (returns static JSON)
βββ example-api.yaml # Example OpenAPI spec
βββ tools/ # Output directory for bridge
βββ README.md # Project-specific instructions
Step 2: Start the Gatewayβ
docker compose up -d
Wait a few seconds for the gateway to start, then verify:
stoactl doctor
You should see all checks passing:
STOA Doctor
β Docker: running (v27.x)
β Gateway: healthy (http://localhost:8080/health)
β Port 8080: available
...
Step 3: Bridge an API to MCPβ
The project includes an example-api.yaml (OpenAPI 3.0 spec) with 3 operations. Convert it to MCP tools:
stoactl bridge example-api.yaml --namespace default --output ./tools/
Output:
β Parsed OpenAPI 3.0 spec: my-api API (3 operations)
β Generated 3 Tool CRDs β ./tools/
- list-items.yaml
- create-item.yaml
- get-item.yaml
Preview what was generatedβ
Each file in tools/ is a valid Tool CRD:
cat tools/list-items.yaml
apiVersion: gostoa.dev/v1alpha1
kind: Tool
metadata:
name: list-items
namespace: default
labels:
generated-by: stoactl-bridge
spec:
displayName: List all items
endpoint: http://echo:8888/items
method: GET
inputSchema:
type: object
properties:
limit:
type: integer
maximum: 100
default: 20
timeout: 30s
enabled: true
Step 4: Register Tools with the Gatewayβ
Apply each generated tool to the running gateway:
for f in tools/*.yaml; do stoactl apply -f "$f"; done
Verify tools are registered:
stoactl get tools
Step 5: Test via MCPβ
Call the gateway's MCP endpoint to list available tools:
curl -s http://localhost:8080/mcp/v1/tools | jq .
Invoke a tool:
curl -s http://localhost:8080/mcp/v1/tools/invoke \
-H "Content-Type: application/json" \
-d '{"name": "list-items", "arguments": {"limit": 5}}' | jq .
Bridge Your Own APIβ
Replace the example spec with your own OpenAPI 3.x file:
# Use your own spec
stoactl bridge your-api.yaml --namespace default --output ./tools/
# Filter specific operations by tag
stoactl bridge your-api.yaml --namespace default --include-tags payments
# Override the backend URL
stoactl bridge your-api.yaml --namespace default --server https://api.internal.com
# Preview without writing files
stoactl bridge your-api.yaml --namespace default --dry-run
Bridge flags referenceβ
| Flag | Description | Default |
|---|---|---|
--namespace | Target namespace for tools (required) | β |
--output | Output directory for YAML files | ./tools/ |
--server | Override servers[0].url from spec | From spec |
--auth-secret | K8s secret name for auth | β |
--include-tags | Only include operations with these tags | All |
--exclude-tags | Exclude operations with these tags | None |
--include-ops | Only include these operationIds | All |
--timeout | Default timeout for tools | 30s |
--dry-run | Show summary without writing files | false |
What's Next?β
- Quick Start (Local Stack) β Run the local STOA Platform Docker Compose stack
- Gateway Configuration β Customize your gateway
- Tool CRD Reference β Full Tool spec documentation
- CLI Reference β All stoactl commands
FAQβ
What is stoactl?β
stoactl is a kubectl-style CLI for managing STOA Platform resources. It provides project scaffolding (init), API-to-MCP bridging (bridge), diagnostic checks (doctor), and resource management (apply, get, delete).
Can I bridge any REST API?β
Yes. Any API with an OpenAPI 3.0 or 3.1 specification can be bridged to MCP tools. Each path+method operation becomes a separate MCP tool with its parameters mapped to the tool's input schema.
Do I need a STOA cloud account?β
No. The self-hosted setup with stoactl init + Docker is completely standalone. You can optionally connect to the hosted STOA Platform later for multi-tenant management, observability, and team features.