Twist AI MCP Server
Enables AI agents to access and interact with a Twist workspace, managing threads, conversations, inbox, and more through natural language.
README
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
- Open Command Palette → MCP: Add Server
- 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
- Visit https://twist.com/app_console
- Create a new integration or use an existing one
- Copy your API key
- 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
displayInInboxboolean (defaultfalse). Whentrue, 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
- MCP server using the official @modelcontextprotocol/sdk
- Twist TypeScript SDK @doist/twist-sdk
Local Development Setup
Prerequisites
- Node.js 18 or higher
- npm
- A Twist account with API access
Setup
- Clone the repository:
git clone https://github.com/doist/twist-ai.git
cd twist-ai
- Install dependencies:
npm install
- Create a
.envfile with your Twist API key:
TWIST_API_KEY=your-twist-api-key-here
- Build the project:
npm run build
Development Commands
npm start- Build and run the MCP inspector for testingnpm run dev- Development mode with auto-rebuild and restartnpm test- Run all testsnpm run type-check- Run TypeScript type checkingnpm run format:check- Run linting and formatting checksnpm run format:fix- Auto-fix linting and formatting issues
Contributing
Contributions are welcome! Please ensure:
- All tests pass (
npm test) - Code is properly typed (
npm run type-check) - Code passes linting and formatting checks (
npm run format:check)
Use Conventional Commits for commit messages:
feat:for new featuresfix:for bug fixesdocs:for documentation changestest:for test changeschore:for maintenance tasks
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。