# MCP Server Setup
This document outlines the steps necessary to run this MCP server and connect to an MCP host application, such as Claude Desktop or Cursor.
## Quick Setup
The easiest way to use this MCP server is with npx:
```bash
npx @doist/todoist-ai
```
You'll need to set your Todoist API key as an environment variable `TODOIST_API_KEY`.
## Local Development Setup
Start by cloning this repository and setting it up locally, if you haven't done so yet.
```sh
git clone https://github.com/Doist/todoist-ai
npm run setup
```
To test the server locally before connecting it to an MCP client, you can use:
```sh
npm start
```
This will build the project and run the MCP inspector for manual testing.
### Creating a Custom MCP Server
For convenience, we also include a function that initializes an MCP Server with all the tools available:
```js
import { getMcpServer } from "@doist/todoist-ai";
async function main() {
const server = getMcpServer({ todoistApiKey: process.env.TODOIST_API_KEY });
const transport = new StdioServerTransport();
await server.connect(transport);
}
```
Then, proceed depending on the MCP protocol transport you'll use.
## Using Standard I/O Transport
### Quick Setup with npx
Add this section to your `mcp.json` config in Claude, Cursor, etc.:
```json
{
"mcpServers": {
"todoist-ai": {
"type": "stdio",
"command": "npx",
"args": ["@doist/todoist-ai"],
"env": {
"TODOIST_API_KEY": "your-todoist-token-here"
}
}
}
}
```
### Using local installation
Add this `todoist-ai-tools` section to your `mcp.json` config in Cursor, Claude, Raycast, etc.
```json
{
"mcpServers": {
"todoist-ai-tools": {
"type": "stdio",
"command": "node",
"args": ["/Users/