Skip to main content
Glama

Relay MCP

@relaymessenger/mcp is a local MCP v2 stdio server for current Relay v1 Agent tools. It uses @modelcontextprotocol/server@2 and delegates every Relay request and response type to @relaymessenger/sdk.

Transport and security status

Implemented: local process-spawned stdio, including MCP v2 modern-era negotiation and legacy client compatibility.

Not implemented: remote HTTP transport and remote OAuth. The package does not open a port, advertise a remote endpoint, or claim remote authentication. Those stay out until Relay has a secure authorization, audience, scope, session, origin, revocation, and deployment design with hosted tests.

The stdio host is the security boundary. Only configure this server in a trusted local MCP client.

Related MCP server: xmatters-mcp

Install and configure

npm install --global @relaymessenger/mcp
relay-mcp --version

The server resolves an Agent Token locally; it never exposes a token as an MCP tool argument.

Resolution order:

  1. RELAY_AGENT_TOKEN, RELAY_API_URL, and RELAY_PROFILE;

  2. ${XDG_CONFIG_HOME:-~/.config}/relay/config.json, shared with @relaymessenger/cli;

  3. https://api.relayapp.im as the default API URL.

Example client configuration:

{
  "mcpServers": {
    "relay": {
      "command": "relay-mcp",
      "env": {
        "RELAY_PROFILE": "default"
      }
    }
  }
}

For automation, inject RELAY_AGENT_TOKEN from the host's secret manager. Do not put the token in MCP config checked into source control.

Optional non-secret process flags:

relay-mcp --profile staging
relay-mcp --profile local --api-url http://127.0.0.1:8787

There is deliberately no token flag.

Tools

The server exposes explicit tools rather than a generic HTTP or operation proxy:

Capability

Tools

Read

relay_list_chats, relay_get_chat, relay_list_messages, relay_get_message, relay_get_message_thread

Send

relay_send_message, relay_send_message_to_chat

Reactions

relay_react_to_message

Typing/read state

relay_start_typing, relay_stop_typing, relay_mark_chat_read

Contact Card

relay_get_contact_card, relay_set_contact_card, relay_update_contact_card, relay_share_contact_card

Contact request

relay_create_contact_request

Message-send tools require a caller-supplied idempotency key. Tool schemas do not contain Agent Tokens, raw authorization headers, URLs for arbitrary Relay routes, or copied OpenAPI response definitions.

Errors and secrets

Tool failures return MCP error results with sanitized text. Environment and locally configured Agent Tokens are redacted from tool errors and stderr. Successful SDK objects are returned as both JSON text and structured content.

Development

All Linux execution happens in a fresh Daytona sandbox:

npm ci
npm run validate

Validation includes type checking, unit and negative tests, the pinned SDK contract hash, an MCP v2 modern protocol spawn test, MCP Inspector v2 tools/list --strict, package packing, isolated tarball installation, and an installed-bin protocol test.

Available Tools

16 tools
relay_create_contact_requestCreate Relay Contact RequestC

Ask a Relay user to add the authenticated premium-handle Agent.

Inputs: handle (required).

relay_get_chatGet Relay ChatA
Read-onlyIdempotent

Retrieve one Relay Chat by ID.

Inputs: chat_id (required).

relay_get_contact_cardGet Relay Contact CardC
Read-onlyIdempotent

Retrieve the authenticated Agent's Relay Contact Card.

Inputs: handle.

relay_get_messageGet Relay MessageA
Read-onlyIdempotent

Retrieve one Relay Message by ID.

Inputs: message_id (required).

relay_get_message_threadGet Relay Message ThreadB
Read-onlyIdempotent

List the thread rooted at one Relay Message.

Inputs: message_id (required), limit, order, cursor.

relay_list_chatsList Relay ChatsC
Read-onlyIdempotent

List Chats visible to the authenticated Relay Agent.

Inputs: limit, cursor.

relay_list_messagesList Relay MessagesC
Read-onlyIdempotent

List Messages in one Relay Chat.

Inputs: chat_id (required), limit, cursor.

relay_mark_chat_readMark Relay Chat ReadB
Idempotent

Mark the visible Relay Chat as read by the Agent.

Inputs: chat_id (required).

relay_react_to_messageReact to Relay MessageA
Destructive

Add or remove a reaction on a Relay Message part.

Inputs: type (required), operation (required), message_id (required), part_index, +1 more.

relay_send_messageSend Relay MessageA
Idempotent

Resolve or create a Chat and send a text Message to Relay Handles. Reuse the same idempotency key only for the same logical send.

Inputs: text (required), recipients (required), idempotency_key (required).

relay_send_message_to_chatSend Message to Relay ChatA
Idempotent

Send a text Message to a known Relay Chat. Reuse the idempotency key only for the same logical send.

Inputs: text (required), chat_id (required), idempotency_key (required).

relay_set_contact_cardSet Relay Contact CardC

Create or replace the authenticated Agent's Contact Card.

Inputs: handle (required), first_name (required), image_url, last_name.

relay_share_contact_cardShare Relay Contact CardA

Share the authenticated Agent's configured Contact Card into a Chat.

Inputs: chat_id (required).

relay_start_typingStart Relay TypingA
Idempotent

Start or refresh the Agent typing indicator in a Chat.

Inputs: chat_id (required).

relay_stop_typingStop Relay TypingA
Idempotent

Stop the Agent typing indicator in a Chat.

Inputs: chat_id (required).

relay_update_contact_cardUpdate Relay Contact CardC

Update selected fields on the authenticated Agent's Contact Card.

Inputs: handle (required), image_url, last_name, first_name.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 16 tools

    Disambiguation4/5

    The tools are mostly organized by clear resource and action pairs, but relay_send_message and relay_send_message_to_chat overlap in purpose, and set_contact_card vs update_contact_card could cause initial confusion. The descriptions do clarify the differences, so an agent can still reliably choose the correct tool.

    Naming Consistency5/5

    All tools use the relay_ prefix and a consistent snake_case verb_noun pattern. Variations like relay_send_message_to_chat and relay_mark_chat_read are still predictable and follow the same naming logic as the rest of the set.

    Tool Count4/5

    Sixteen tools is slightly above the ideal 3-15 range, but each tool maps to a distinct messaging or contact-card function. The count feels justified for the domain rather than bloated.

    Completeness4/5

    The tool surface covers the core Relay messaging lifecycle: chats, messages, threads, reactions, typing, read state, and contact-card management. Notable absences like message editing/deletion or attachment sending appear intentional given the text-message focus, but they are still minor gaps for a broader messaging API.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables MCP clients to connect to Agenzax's REST API over stdio, providing tools for messaging, session management, and review-mode oversight.
      18
      135 npm
      5
      MIT
    • A
      license
      C
      quality
      B
      maintenance
      Enables MCP clients to interact with the current xMatters REST API over stdio, covering people, devices, groups, on-call schedules, events, incidents, workflows, services, integrations, and subscriptions. It is read-only by default and requires explicit operator opt-in plus per-call confirmation for mutations.
      179
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP-capable agents to read and post to a public timeline, send and read direct messages, access team rooms, and search an agent directory through nine stdio tools.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables an MCP client to search and read macOS Messages history from a local chat database, including conversations, unread messages, and Contacts-based names. It is read-only, runs over stdio, and cannot send, edit, or delete messages.
      MIT