This skill should be used when the user asks to "set up project", "configure segmentstream", "which project", "connect to segmentstream", "initialize", "first time setup", "refresh configuration", "reconfigure", or when no `.claude/segmentstream.local.md` settings file exists. Use this skill proactively at the start of a session if no settings file exists. Provides project discovery, configuration caching, and settings management.
Discover SegmentStream projects accessible to the current API key and cache their configuration locally. The cached settings file eliminates repeated API calls for project metadata and gives every subsequent skill instant access to project IDs, conversion definitions, attribution models, and data source inventories.
Activate this skill in any of the following situations:
.claude/segmentstream.local.md does not exist in the workspace./segmentstream:setup or /segmentstream:refresh.Before anything else, confirm the SegmentStream MCP tools are reachable. Use ToolSearch with query "segmentstream" to check whether any mcp__segmentstream__* tools appear.
If tools are found: proceed to Step 1.
If no tools are found: the MCP server is not connected — the user likely hasn't completed OAuth authentication. Do the following:
mcp__mcp-registry__search_mcp_registry(keywords: ["segmentstream"]) to discover the connector's directoryUuid.mcp__mcp-registry__suggest_connectors(uuids: [<directoryUuid>]) to present the Connect button.Read .claude/segmentstream.local.md in the workspace root. If the file exists and contains valid YAML frontmatter with an activeProjectId and projects array, one or more projects are already configured. Proceed to Step 2. If the file does not exist, proceed to Step 3 (discovery).
Check whether the requested project is already cached:
projects array for a case-insensitive match on name or id. If found, set activeProjectId to that project's id and stop -- no API calls needed, just switch. If not found, proceed to Step 3 to discover and add it.activeProjectId and stop.mcp__segmentstream__list_active_projects()
This returns all projects the API key has access to. Handle three cases:
| Result | Action |
|---|---|
| Zero projects | Stop. Guide the user: check that SEGMENTSTREAM_MCP_URL is set, the API key is valid, and the account has at least one active project. Suggest running /mcp to verify the MCP connection. |
| One project | Present the project name and ID. Ask the user to confirm this is the intended project before proceeding. |
| Multiple projects | Present a numbered list of projects (name + ID). Ask the user to choose one. If the user ran /segmentstream:setup <name>, attempt a case-insensitive match on the project name or ID and confirm. |
Once a project is selected, fetch its full configuration in parallel:
mcp__segmentstream__get_project(projectId)
mcp__segmentstream__list_conversions(projectId)
mcp__segmentstream__list_attribution_models(projectId)
mcp__segmentstream__list_data_sources(projectId)
Extract the following from responses:
id, name, defaultCurrency, timezoneid, name, type for each conversionid, name, isDefault for each modelid, name, type for each connected sourceBuild the project entry and update the projects array. If the selected project ID already exists in the array, replace that entry with the fresh data (this acts as an implicit refresh). If it is a new project, append it to the existing array -- do not replace other cached projects. Set activeProjectId to the newly added or updated project. Preserve any markdown content below the YAML frontmatter (user notes).
---
activeProjectId: "abc123"