thrd

v0.1.5
io.github.SergioRico1/thrd Checked 20 hours ago Published 9 months ago

Thrd MCP: agent email tools for events/threads, safe send/reply, usage, trust and security.

Expose Thrd (Agent Email) as an MCP server so AI clients can: - Poll inbound email events - Read threads and messages - Reply and send outbound (policy-gated) - Check usage, trust score, and security analysis This lives in the monorepo under apps/mcp. Required: - THRD_API_KEY: your Thrd agent API key

Summary extracted from the README.

Thrd MCP Server

Expose Thrd (Agent Email) as an MCP server so AI clients can:

  • Poll inbound email events
  • Read threads and messages
  • Reply and send outbound (policy-gated)
  • Check usage, trust score, and security analysis

This lives in the monorepo under apps/mcp.

Environment Variables

Required:

  • THRD_API_KEY: your Thrd agent API key

Optional:

  • THRD_API_BASE_URL: defaults to https://api.thrd.email

Transport:

  • MCP_TRANSPORT: stdio (default) or http

HTTP mode (if MCP_TRANSPORT=http):

  • MCP_HTTP_PORT: default 8080
  • MCP_HTTP_PATH: default /mcp
  • MCP_STATELESS: 1 for stateless mode (no session ids). Default is stateful.
  • MCP_AUTH_TOKEN: if set, requires Authorization: Bearer <token> on every request

Instant onboarding tool gate:

  • ALLOW_THRD_INSTANT_ONBOARDING: set to 1 to enable thrd.instant_onboarding

Run (stdio)

From repo root:

export THRD_API_KEY="thrd_xxx"
pnpm -C apps/mcp dev

Install (npm)

If published to npm as thrd-mcp:

export THRD_API_KEY="thrd_xxx"
npx -y thrd-mcp

Run (HTTP)

export THRD_API_KEY="thrd_xxx"
export MCP_TRANSPORT="http"
export MCP_HTTP_PORT="8080"
export MCP_AUTH_TOKEN="change-me" # recommended
pnpm -C apps/mcp dev

Health check:

curl http://localhost:8080/healthz

Claude Desktop (example)

Add a server entry to your Claude Desktop config and point it at the stdio command.

Example (adjust paths and shell as needed):

{
  "mcpServers": {
    "thrd": {
      "command": "pnpm",
      "args": ["-C", "apps/mcp", "start"],
      "env": {
        "THRD_API_KEY": "thrd_xxx",
        "THRD_API_BASE_URL": "https://api.thrd.email"
      }
    }
  }
}

Tools

Highlights:

  • thrd.poll_events, thrd.ack_events
  • thrd.list_threads, thrd.get_thread_messages
  • thrd.reply, thrd.send, thrd.outbound_status
  • thrd.usage, thrd.trust_score
  • thrd.message_security, thrd.create_security_ack
  • thrd.billing_checkout_self
  • thrd.claim_x_start, thrd.claim_x_status

Publishing To The MCP Registry

The GitHub MCP Registry indexes servers from the official MCP Registry.

High level steps:

  1. Publish thrd-mcp to npm.
  2. Ensure apps/mcp/server.json is valid and the npm package contains mcpName matching server.json name.
  3. Use mcp-publisher to publish server.json to the registry.

Resources / Prompts

Resources:

  • thrd://docs/quickstart
  • thrd://docs/api

Prompts:

  • thrd.triage_inbox
  • thrd.draft_reply