KosmoKrator

analytics

Segment MCP, CLI, and Lua Integration for AI Agents

Segment integration docs for AI agents: MCP gateway setup, Segment CLI commands, Lua API reference, credentials, and function schemas.

Segment for agents

Credentials can be configured manually in web or CLI hosts.

Use this integration from Lua code mode, the headless integrations CLI, or the KosmoKrator MCP gateway. The same package metadata powers all three surfaces.

Agent Surfaces

Machine-Readable Metadata

Function Catalog

FunctionTypeParametersDescription
segment.segment_identify Write write 2 Identify a user in Segment with their traits. Links metadata about a user (name, email, plan, etc.) to a known userId so all their events can be attributed correctly.
segment.segment_track Write write 3 Track a custom event for a user in Segment. Records actions your users perform along with optional properties describing the action.
segment.segment_page Write write 3 Record a page view in Segment. Tracks when a user views a page, along with optional properties about the page.
segment.segment_group Write write 3 Associate a user with a group (organization, company, account) in Segment. Lets you record group membership along with optional group traits.
segment.segment_get_workspace Read read 1 Get details of a Segment workspace by its slug. Requires an API token to be configured.
segment.segment_list_sources Read read 1 List all sources in a Segment workspace. Requires an API token to be configured.
segment.segment_get_source Read read 2 Get details of a specific Segment source by ID. Requires an API token to be configured.
segment.segment_get_current_user Read read 0 Get the currently authenticated Segment user. Useful for verifying API token credentials are correct.