Skip to main content
Glama

segment-mcp

A small, read-only MCP server for the Twilio Segment Public API. It only sends GET requests. It can list and inspect a workspace's Segment config but can never change it.

It lets Claude (or any MCP client) answer questions like "how is the Intercom destination configured?" or "which destinations hang off this source?" straight from Segment, without clicking through the dashboard.

Tools

Tool

What it does

list_sources

All sources in the workspace

get_source

One source by id (incl. settings)

list_destinations

All destinations; optional name substring filter (e.g. intercom) and/or sourceId

get_destination

One destination by id, incl. full settings/config

list_tracking_plans

All tracking plans

get_tracking_plan

One tracking plan by id

list_functions

All functions; optional resourceType filter (SOURCE, DESTINATION, INSERT_DESTINATION, ...)

get_function

One function by id

api_get

Read-only escape hatch: GET any other Public API path (e.g. /warehouses)

List tools follow cursor pagination, so they return every page.

Related MCP server: segment-mcp

Setup

Requires Node.js 18 or later.

  1. Install:

    git clone https://github.com/pedromfs/segment-mcp.git
    cd segment-mcp
    npm install
  2. Create a Segment API token - in Segment: Settings -> Access Management -> Tokens -> Create Token. Give it a read-only role; this server never writes. .env.example has the step-by-step and a fix for 403 Forbidden.

  3. Provide the token. Either option works (the server reads the .env next to index.mjs first, then falls back to the ambient environment):

    • A local .env (gitignored, so the token never lands in the repo):

      cp .env.example .env   # then set SEGMENT_PUBLIC_API_TOKEN=sgp_...
    • Or a shell export:

      export SEGMENT_PUBLIC_API_TOKEN="sgp_..."

      A real shell value takes precedence over the .env.

  4. Register it with your MCP client. For Claude Code, add it to a project's .mcp.json:

    {
      "mcpServers": {
        "segment": {
          "type": "stdio",
          "command": "node",
          "args": ["/absolute/path/to/segment-mcp/index.mjs"]
        }
      }
    }

    or run claude mcp add segment -- node /absolute/path/to/segment-mcp/index.mjs. Restart the client so it picks up the server and the token.

Local smoke test

SEGMENT_PUBLIC_API_TOKEN=sgp_... node index.mjs   # then speak MCP JSON-RPC over stdin

Notes

  • The base URL defaults to https://api.segmentapis.com; override it with SEGMENT_PUBLIC_API_URL if needed.

  • Every request goes to that base URL. api_get takes a path, not a full URL, so the token is never sent to another host.

  • If the token is missing, tools return an error rather than crashing the server.

License

MIT

Available Tools

9 tools
api_getA

Read-only escape hatch: issue an arbitrary GET against any Segment Public API path (e.g. '/labels', '/warehouses'). Only GET is supported; this server can never write.

Inputs: path (required), query.

get_destinationA

Get a single Segment destination by id, including its full settings/config (e.g. the Intercom regional endpoint and app id).

Inputs: destinationId (required).

get_functionC

Get a single function by id.

Inputs: functionId (required).

get_sourceC

Get a single Segment source by id, including its settings.

Inputs: sourceId (required).

get_tracking_planC

Get a single tracking plan by id.

Inputs: trackingPlanId (required).

list_destinationsB

List Segment destinations. Optionally filter by a case-insensitive name/slug substring (e.g. 'intercom') and/or by sourceId.

Inputs: name, sourceId.

list_functionsA

List functions in the workspace. Optionally filter by resourceType; omit it to list every type.

Inputs: resourceType.

list_sourcesA

List all Segment sources in the workspace (id, name, slug, enabled, write key settings).

Inputs: no named parameters.

list_tracking_plansB

List all tracking plans in the workspace.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

    TDQS

    A3.6/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a distinct resource+action: list/get pairs for sources, destinations, functions, and tracking plans are cleanly separated, and api_get is clearly scoped as a read-only escape hatch. There is no meaningful overlap between any tools.

    Naming Consistency4/5

    The verb_noun pattern (list_sources, get_function, list_tracking_plans) is applied consistently across eight tools. The only deviation is api_get, which inverts the convention, but it is a distinct escape-hatch concept and remains readable.

    Tool Count5/5

    Nine tools is well within the sweet spot and each earns its place with a clear resource-verb pairing. Nothing feels redundant or padded.

    Completeness4/5

    The server is explicitly read-only, and for that scope it offers list+get coverage for the four main resource families plus a generic GET escape hatch for unmodeled paths. No write operations exist, but that is by design rather than an oversight.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables read-only inspection of Google Ads accounts through MCP, including account inventory, reporting, metadata, change history, and safe GAQL queries.
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables read-only querying of Twilio Segment workspaces to audit which destinations receive which events, trace event routing and governance, identify stale or ungoverned sources, and check destination delivery health, with permanent safeguards against data deletion.
      MIT