Relay MCP
Provides tools for interacting with Relay Messenger, enabling agents to list and manage chats, send messages, react to messages, manage typing and read state, handle contact cards, and create contact requests.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Relay MCP show me my recent chats and unread messages"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 --versionThe server resolves an Agent Token locally; it never exposes a token as an MCP tool argument.
Resolution order:
RELAY_AGENT_TOKEN,RELAY_API_URL, andRELAY_PROFILE;${XDG_CONFIG_HOME:-~/.config}/relay/config.json, shared with@relaymessenger/cli;https://api.relayapp.imas 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:8787There is deliberately no token flag.
Tools
The server exposes explicit tools rather than a generic HTTP or operation proxy:
Capability | Tools |
Read |
|
Send |
|
Reactions |
|
Typing/read state |
|
Contact Card |
|
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 validateValidation 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 toolsrelay_create_contact_requestCreate Relay Contact RequestC
Ask a Relay user to add the authenticated premium-handle Agent.
Inputs: handle (required).
relay_get_chatGet Relay ChatARead-onlyIdempotent
Retrieve one Relay Chat by ID.
Inputs: chat_id (required).
relay_get_contact_cardGet Relay Contact CardCRead-onlyIdempotent
Retrieve the authenticated Agent's Relay Contact Card.
Inputs: handle.
relay_get_messageGet Relay MessageARead-onlyIdempotent
Retrieve one Relay Message by ID.
Inputs: message_id (required).
relay_get_message_threadGet Relay Message ThreadBRead-onlyIdempotent
List the thread rooted at one Relay Message.
Inputs: message_id (required), limit, order, cursor.
relay_list_chatsList Relay ChatsCRead-onlyIdempotent
List Chats visible to the authenticated Relay Agent.
Inputs: limit, cursor.
relay_list_messagesList Relay MessagesCRead-onlyIdempotent
List Messages in one Relay Chat.
Inputs: chat_id (required), limit, cursor.
relay_mark_chat_readMark Relay Chat ReadBIdempotent
Mark the visible Relay Chat as read by the Agent.
Inputs: chat_id (required).
relay_react_to_messageReact to Relay MessageADestructive
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 MessageAIdempotent
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 ChatAIdempotent
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_start_typingStart Relay TypingAIdempotent
Start or refresh the Agent typing indicator in a Chat.
Inputs: chat_id (required).
relay_stop_typingStop Relay TypingAIdempotent
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
Scored across 16 tools
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.
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.
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.
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
Agent-to-agent messaging: directory, public lobby, DMs, channels, search. Stateless MCP + REST.
Hosted MCP messaging across owners, tools, and machines, with readable transcripts.
Agent communication platform for agent to agent messaging via MCP. Messages, channels, skills.
Chat with your Zihin.ai agents, list them and load platform skills from any MCP client.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables MCP clients to connect to Agenzax's REST API over stdio, providing tools for messaging, session management, and review-mode oversight.18135 npm5MIT
- AlicenseCqualityBmaintenanceEnables 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.179Apache 2.0

Oids MCP Serverofficial
AlicenseNot gradedqualityCmaintenanceEnables 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- AlicenseNot gradedqualityBmaintenanceEnables 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