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.

8 functions 4 read 4 write API token auth

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.

Machine-Readable Metadata
integration_slug
segment
route_slug
segment
package
segment
auth_strategy
api_token API token
cli_setup_supported
true
cli_runtime_supported
true
mcp_gateway_supported
true
lua_supported
true
supports_multi_account
true

Quick Links

Segment MCP Client Matrix

Use these pages when a specific agent client or framework needs copy-pasteable MCP setup for Segment.

Segment CLI Matrix

Use these pages for direct Segment CLI workflows in scripts, CI, cron, and agent wrappers.

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.