Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables AI agents to access and interact with a Twist workspace, managing threads, conversations, inbox, and more through natural language.

README.md

Twist AI and MCP SDK

Library for connecting AI agents to Twist. Includes tools that can be integrated into LLMs, enabling them to access and interact with a Twist workspace on the user's behalf.

These tools can be used both through an MCP server, or imported directly in other projects to integrate them to your own AI conversational interfaces.

Using tools

1. Add this repository as a dependency

npm install @doist/twist-ai

2. Import the tools and plug them to an AI

Here's an example using Vercel's AI SDK.

import { fetchInbox, reply, markDone } from '@doist/twist-ai'
import { streamText } from 'ai'

const result = streamText({
    model: yourModel,
    system: 'You are a helpful Twist assistant',
    tools: {
        fetchInbox,
        reply,
        markDone,
    },
})

Using as an MCP server

Quick Start

You can run the MCP server directly with npx:

npx @doist/twist-ai

Setup Guide

Claude Desktop

Add to your Claude Desktop configuration file (claude_desktop_config.json):

{
    "mcpServers": {
        "twist": {
            "command": "npx",
            "args": ["-y", "@doist/twist-ai"],
            "env": {
                "TWIST_API_KEY": "your-twist-api-key-here"
            }
        }
    }
}

Cursor

Create a configuration file:

  • Global: ~/.cursor/mcp.json
  • Project-specific: .cursor/mcp.json
{
    "mcpServers": {
        "twist": {
            "command": "npx",
            "args": ["-y", "@doist/twist-ai"],
            "env": {
                "TWIST_API_KEY": "your-twist-api-key-here"
            }
        }
    }
}

Then enable the server in Cursor settings if prompted.

Claude Code (CLI)

claude mcp add twist npx @doist/twist-ai

Then set your API key:

export TWIST_API_KEY=your-twist-api-key-here

Visual Studio Code

  1. Open Command Palette → MCP: Add Server
  2. Configure the server:
{
    "servers": {
        "twist": {
            "command": "npx",
            "args": ["-y", "@doist/twist-ai"],
            "env": {
                "TWIST_API_KEY": "your-twist-api-key-here"
            }
        }
    }
}

Getting your Twist API Key

  1. Visit https://twist.com/app_console
  2. Create a new integration or use an existing one
  3. Copy your API key
  4. Add it to your MCP configuration as shown above

Features

A key feature of this project is that tools can be reused, and are not written specifically for use in an MCP server. They can be hooked up as tools to other conversational AI interfaces (e.g. Vercel's AI SDK).

This project is in its early stages. Expect more and/or better tools soon.

Nevertheless, our goal is to provide a small set of tools that enable complete workflows, rather than just atomic actions, striking a balance between flexibility and efficiency for LLMs.

Available Tools

  • userInfo - Get information about the current user and their workspaces
  • fetchInbox - Fetch threads and conversations from the inbox
  • loadThread - Load a specific thread with its comments
  • loadConversation - Load a specific conversation with its messages
  • searchContent - Search across a workspace for threads, comments, and messages
  • createThread - Create a new thread in a channel. Accepts an optional displayInInbox boolean (default false). When true, the thread is unarchived after creation so it appears in the author's Inbox. See also TWIST_CREATE_THREAD_DISPLAY_IN_INBOX.
  • reply - Reply to threads or conversations
  • react - Add reactions to threads, comments, conversations, or messages
  • markDone - Mark threads or conversations as done (read and/or archived)
  • buildLink - Build URLs to Twist resources

For more details on each tool, see the src/tools directory.

Environment Variables

| Variable | Default | Description | | -------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | TWIST_API_KEY | _(required)_ | Your Twist API key. | | TWIST_CREATE_THREAD_DISPLAY_IN_INBOX | false | Set to true to unarchive every newly-created thread so it appears in the author's Inbox, without needing to pass displayInInbox: true on each call. Only takes effect when running the MCP locally. The remote/hosted MCP does not have this variable set and will use the per-call displayInInbox parameter only. |

Dependencies

Local Development Setup

Prerequisites

  • Node.js 18 or higher
  • npm
  • A Twist account with API access

Setup

  1. Clone the repository:
git clone https://github.com/doist/twist-ai.git
cd twist-ai
  1. Install dependencies:
npm install
  1. Create a .env file with your Twist API key:
TWIST_API_KEY=your-twist-api-key-here
  1. Build the project:
npm run build

Development Commands

  • npm start - Build and run the MCP inspector for testing
  • npm run dev - Development mode with auto-rebuild and restart
  • npm test - Run all tests
  • npm run type-check - Run TypeScript type checking
  • npm run format:check - Run linting and formatting checks
  • npm run format:fix - Auto-fix linting and formatting issues

Contributing

Contributions are welcome! Please ensure:

  1. All tests pass (npm test)
  2. Code is properly typed (npm run type-check)
  3. Code passes linting and formatting checks (npm run format:check)

Use Conventional Commits for commit messages:

  • feat: for new features
  • fix: for bug fixes
  • docs: for documentation changes
  • test: for test changes
  • chore: for maintenance tasks

License

MIT

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use AI & ML servers.