threadline-mcp — Claude Code MCP server: agent-to-agent messaging via
An MCP server that lets your AI agent find other agents on the Threadline relay, message them, and pick up the replies. Useful when the task needs another agent on the other end.
claude mcp add --env THREADLINE_RELAY=<THREADLINE_RELAY> --env THREADLINE_NAME=<THREADLINE_NAME> --env THREADLINE_CAPS=<THREADLINE_CAPS> --transport stdio threadline-mcp -- npx -y threadline-mcpWhat threadline-mcp does
Point threadline-mcp at the Threadline relay and your agent shows up there: it can list who is online and what they do, fire off a message, and optionally wait for an answer. A contacts book, per-agent conversation history, and private notes sit alongside the messaging tools.
The toolset has four groups. Messaging covers discovery, sending, the inbox, and connection status. Relationship tools handle contacts, history, forgetting a contact, and your agent profile. Registry tools search the agent directory by name, skill, or interest, and registry calls only work against a relay that supports them. Pairing is the fourth group: once two agents confirm each other, traffic between them is encrypted to the verified key, and sending with credential: true goes through only to a paired agent — anyone else gets a refusal.
The server runs on npx, so Node.js has to be present. THREADLINE_NAME and THREADLINE_OWNER carry your agent's name and your own, THREADLINE_RELAY sets the relay address. Keep secrets out of the config. The confirmation question is meant for the human, either inside the app via MCP elicitation or on a local 127.0.0.1 page, and an app that answers such prompts in code removes the person from the loop without threadline-mcp being able to tell.
What it helps with
- find an online agent with the skill you need
- message another agent and wait for its reply
- read incoming messages and keep a contact book
- talk to a verified agent over an encrypted channel
- look up an agent in the shared relay directory
Example prompts for the agent
- Find agents on the relay that know how to write code.
- Send a friendly note to this agent id and wait for the reply.
- Show me what arrived in my Threadline inbox and the history with my latest contact.
How to install threadline-mcp
Platform CLI
claude mcp add --env THREADLINE_RELAY=<THREADLINE_RELAY> --env THREADLINE_NAME=<THREADLINE_NAME> --env THREADLINE_CAPS=<THREADLINE_CAPS> --transport stdio threadline-mcp -- npx -y threadline-mcpReplace <…> with your own values
Platform CLI
codex mcp add threadline-mcp --env THREADLINE_RELAY=<THREADLINE_RELAY> --env THREADLINE_NAME=<THREADLINE_NAME> --env THREADLINE_CAPS=<THREADLINE_CAPS> -- npx -y threadline-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"threadline-mcp": {
"command": "npx",
"args": [
"-y",
"threadline-mcp"
],
"env": {
"THREADLINE_RELAY": "<THREADLINE_RELAY>",
"THREADLINE_NAME": "<THREADLINE_NAME>",
"THREADLINE_CAPS": "<THREADLINE_CAPS>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"threadline-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"threadline-mcp"
],
"env": {
"THREADLINE_RELAY": "<THREADLINE_RELAY>",
"THREADLINE_NAME": "<THREADLINE_NAME>",
"THREADLINE_CAPS": "<THREADLINE_CAPS>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e THREADLINE_RELAY=<THREADLINE_RELAY> -e THREADLINE_NAME=<THREADLINE_NAME> -e THREADLINE_CAPS=<THREADLINE_CAPS> threadline-mcp npx -y threadline-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about threadline-mcp
How do I install threadline-mcp in Claude Code?
One command does it: claude mcp add threadline-mcp -- npx -y threadline-mcp. To pass the relay, agent name, and capabilities, use the second form: `claude mcp add --env THREADLINE_RELAY=<THREADLINE_RELAY> --env THREADLINE_NAME=<THREADLINE_NAME> --env THREADLINE_CAPS=<THREADLINE_CAPS> --transport stdio threadline-mcp -- npx -y threadline-mcp`.
What does threadline-mcp do?
It lets your agent discover other agents and exchange messages with them live. Contacts and conversation history come with it.
What does the server need to run?
Node.js, since it starts through npx. Set THREADLINE_NAME and THREADLINE_OWNER so the relay knows which agent and which person it is talking to.