staff-api v1.0
PlaceOS Staff API
Service for integrating PlaceOS with the workplace.
Environment
These environment variables are required for configuring an instance of Staff API
SG_ENV=production
# Database config:
PG_DATABASE_URL=postgresql://user:password@hostname/placeos?max_pool_size=5&max_idle_pool_size=5
# Public key for decrypting and validating JWT tokens
JWT_PUBLIC=base64-public-key #same one used by PlaceOS rest-api
# Redis, signals are published here for drivers and frontends to consume
REDIS_URL=redis://redis:6379
Optional
# Default Timezone
STAFF_TIME_ZONE=Australia/Sydney #default to UTC if not provided
# Sentry monitoring
SENTRY_DSN=<sentry dsn>
# Logstash log ingest
LOGSTASH_HOST=example.com
LOGSTASH_PORT=12345
Domain isolation
Staff API uses the authenticated request domain for its calendar context, including email-domain tenant variants and delegated credentials.
Configure the authority's config.org_zone to bound spaces and zones to that tree. Without it, the API uses ownership only when the organisation has exactly one PlaceOS domain and every owned room's zone references belong to that organisation. Missing or ambiguous ownership returns HTTP 501 with an org_zone configuration message. Unowned rooms and zones are excluded from the ownership fallback.
PLACE_TENANCY_ENFORCE=true enables tenant-administration isolation after domain organisation ownership has been assigned. It defaults to false during rollout. Authority grants cover one domain; organisation and partner grants cover their respective domains. Each request requires the matching grant operation or Manage, alongside its existing JWT scope and admin requirements. Management partner staff organisations retain cluster administration; customer organisations do not.
MCP Server
The API is also available to LLM clients (Claude Code, Claude Desktop, VS Code, Cursor, ...) as an MCP server at /api/staff/v1/mcp, using the Streamable HTTP transport.
claude mcp add --transport http placeos-staff https://<your-placeos-domain>/api/staff/v1/mcp
- Signing in: the client signs the user in through PlaceOS (OAuth with PKCE and a consent screen, served by auth). Tokens are refreshed automatically. Headless agents can send an API key instead, e.g.
--header "X-API-Key: <key>". - Tools: each API resource (bookings, events, guests, calendars, ...) is a toolbox. The model opens the toolboxes it needs, which keeps its context small. Calls run as the signed in user, with their permissions.
- Exposure: the health check, user photos and the event change notifications used by drivers are not exposed (
@[AC::MCP(hide: true)]). - Tool descriptions: they come from the source code comments on the controllers and routes, so keep them accurate. The Docker build generates
mcp.ymland ships it with the binary (staff-api --mcp=mcp.yml; override the location withMCP_DESCRIPTION_PATH). The model's instructions are insrc/mcp.cr. - Cards: booking, showing and searching tools render MCP Apps cards from
cards/(@[AC::MCP(ui:)]). SetMCP_PREVIEW_PATH(i.e./api/staff/v1/mcp/preview) in development to try them in action-controller's card previewer. Release builds, such as the Docker image, leave it out: its pages are served without authentication. Browser tests: see e2e/README.md.
Contributing
See CONTRIBUTING.md.
staff-api
- 0
- 1
- 11
- 0
- 11
- about 16 hours ago
- September 15, 2020
Other
Sat, 05 Dec 2026 12:29:10 GMT