Skip to main content
All connectors
qbash Connectors / Segment

Segment MCP serverand Python AI tasks

qbash hosts a Segment MCP server you can use in Claude, ChatGPT, Codex, Cursor, Grok Bot and Muse. Developers use qbash Tasks to write cloud-hosted Python functions that pair Segment with models such as Claude and GPT.

Add the qbash MCP

Use Segment from Claude Code, Codex, Cursor and other MCP clients. Connect Segment in qbash, and your agent can work with its data and build Tasks that call it.

claude mcp add --transport http qbash https://mcp.qbash.com/mcp

Then run /mcp in Claude Code and sign in with qbash.

  • List sources, destinations, warehouses and Reverse ETL models
  • Read a source's settings, labels and enabled state
  • Read destination subscriptions and Functions
  • Browse the catalog of source, destination and warehouse types
  • Create and update sources and replace a source's labels
  • Create and update destinations and destination subscriptions
Read the docs

Write a Segment task in Python

A qbash Task is a Python function hosted in the cloud. Python is the runtime and defines the process, and built-in inline prompts run on leading models such as Claude, GPT, Gemini and Grok.

Run a Task on a schedule, from an HTTP request or when a connected app sends an event. Your agents and chat tools call it over MCP.

Each run is logged with its inputs and results, and you can turn data logging off for any Task. Every Task has version control, and each run is locked to the version it ran.

Find disabled and unlabeled Segment sources

list_sources reads up to 100 sources with their enabled flag and labels. An inline prompt names the disabled ones and the ones with no labels.

main.py
report = qbash.integrations.segment.list_sources(count=100)
sources = report.get("sources", [])
if sources:
audit = qbash.ai.run_prompt(
slug="segment-source-audit",
variables={"sources": json.dumps(sources)},
)
qbash.output({"audit": audit, "more_available": bool(report.get("next_cursor"))})
else:
qbash.output("This workspace has no sources.")
Sample list_sources response
{
"sources": [
{
"id": "9btKuCR4Wq674VajpuLDNV",
"slug": "marketing-site",
"name": "Marketing site",
"workspaceId": "9aQ1Lj62S4bomZKLF4DPqW",
"enabled": true,
"metadata": {
"id": "IqDTy1TpoU",
"slug": "javascript",
"name": "Javascript"
},
"settings": {},
"labels": [
{
"key": "environment",
"value": "prod"
}
]
},
{
"id": "qQEHquLrjRDN9j1ByrChyn",
"slug": "ios-app",
"name": "iOS app",
"workspaceId": "9aQ1Lj62S4bomZKLF4DPqW",
"enabled": false,
"metadata": {
"id": "dZeHygTSD4",
"slug": "swift",
"name": "Apple"
},
"settings": {},
"labels": []
}
],
"next_cursor": null
}

Custom MCP server

Build a custom MCP server with Segment

Create a hosted MCP server that combines Segment tools with your other connectors, Tasks and memory folders. You choose each tool it exposes, so a server can share Segment reads with write tools left off.

Share the server with your team, and each person adds it to the client they already use.

How to set it up

  1. Connect Segment on the qbash Connectors page.
  2. Create an MCP server and add the Segment tools you want to share.
  3. Paste the server URL into your client. It connects with OAuth or an access token.

Segment MCP questions

Which Segment credential does the connector need?

A Public API token that a Workspace Owner creates under Settings, Workspace settings, Access Management, Tokens, plus the region of your workspace, US or EU. Choose Workspace Member access when you create it. A Config API token or a tracking write key will not work. The Public API is available on Team and Business plans, not Free.

Can the Segment MCP server delete sources or send events?

No. No method deletes a source, destination or warehouse, and none sends track or identify calls. Source write keys are removed from every response. The connector also leaves out tokens, users, roles and billing.

Build a Segment task

Write it in Python with AI steps, or describe it to your coding agent through the qbash MCP.