@todoist/comms-mcp 0.0.1 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +198 -34
- package/dist/comms-tool.d.ts +14 -0
- package/dist/comms-tool.js +1 -0
- package/dist/index.d.ts +1324 -0
- package/dist/index.js +55 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +24 -0
- package/dist/mcp-helpers.d.ts +17 -0
- package/dist/mcp-helpers.js +40 -0
- package/dist/mcp-server.d.ts +10 -0
- package/dist/mcp-server.js +78 -0
- package/dist/tool-registry.d.ts +3 -0
- package/dist/tool-registry.js +49 -0
- package/dist/tools/build-link.d.ts +63 -0
- package/dist/tools/build-link.js +93 -0
- package/dist/tools/channel-output.d.ts +19 -0
- package/dist/tools/channel-output.js +47 -0
- package/dist/tools/create-channel.d.ts +55 -0
- package/dist/tools/create-channel.js +44 -0
- package/dist/tools/create-conversation.d.ts +49 -0
- package/dist/tools/create-conversation.js +75 -0
- package/dist/tools/create-thread.d.ts +67 -0
- package/dist/tools/create-thread.js +126 -0
- package/dist/tools/delete-object.d.ts +44 -0
- package/dist/tools/delete-object.js +84 -0
- package/dist/tools/fetch-inbox.d.ts +91 -0
- package/dist/tools/fetch-inbox.js +227 -0
- package/dist/tools/get-groups.d.ts +62 -0
- package/dist/tools/get-groups.js +116 -0
- package/dist/tools/get-mentions.d.ts +97 -0
- package/dist/tools/get-mentions.js +126 -0
- package/dist/tools/get-users.d.ts +58 -0
- package/dist/tools/get-users.js +107 -0
- package/dist/tools/get-workspaces.d.ts +61 -0
- package/dist/tools/get-workspaces.js +120 -0
- package/dist/tools/list-channels.d.ts +47 -0
- package/dist/tools/list-channels.js +89 -0
- package/dist/tools/list-conversations.d.ts +66 -0
- package/dist/tools/list-conversations.js +212 -0
- package/dist/tools/load-conversation.d.ts +92 -0
- package/dist/tools/load-conversation.js +128 -0
- package/dist/tools/load-thread.d.ts +127 -0
- package/dist/tools/load-thread.js +175 -0
- package/dist/tools/mark-done.d.ts +111 -0
- package/dist/tools/mark-done.js +275 -0
- package/dist/tools/mark-read.d.ts +73 -0
- package/dist/tools/mark-read.js +214 -0
- package/dist/tools/react.d.ts +59 -0
- package/dist/tools/react.js +97 -0
- package/dist/tools/reply.d.ts +69 -0
- package/dist/tools/reply.js +122 -0
- package/dist/tools/search-content.d.ts +103 -0
- package/dist/tools/search-content.js +138 -0
- package/dist/tools/update-channel.d.ts +53 -0
- package/dist/tools/update-channel.js +45 -0
- package/dist/tools/update-object.d.ts +52 -0
- package/dist/tools/update-object.js +161 -0
- package/dist/tools/update-user-info.d.ts +55 -0
- package/dist/tools/update-user-info.js +270 -0
- package/dist/tools/user-info.d.ts +32 -0
- package/dist/tools/user-info.js +16 -0
- package/dist/tools/user-output.d.ts +9 -0
- package/dist/tools/user-output.js +28 -0
- package/dist/usage-tracking.d.ts +23 -0
- package/dist/usage-tracking.js +41 -0
- package/dist/utils/attachments.d.ts +24 -0
- package/dist/utils/attachments.js +57 -0
- package/dist/utils/concurrency.d.ts +20 -0
- package/dist/utils/concurrency.js +24 -0
- package/dist/utils/constants.d.ts +5 -0
- package/dist/utils/constants.js +5 -0
- package/dist/utils/degrade.d.ts +81 -0
- package/dist/utils/degrade.js +149 -0
- package/dist/utils/output-schemas.d.ts +1283 -0
- package/dist/utils/output-schemas.js +657 -0
- package/dist/utils/read-position.d.ts +21 -0
- package/dist/utils/read-position.js +37 -0
- package/dist/utils/search-results.d.ts +36 -0
- package/dist/utils/search-results.js +82 -0
- package/dist/utils/target-types.d.ts +114 -0
- package/dist/utils/target-types.js +58 -0
- package/dist/utils/test-helpers.d.ts +95 -0
- package/dist/utils/test-helpers.js +231 -0
- package/dist/utils/tool-names.d.ts +25 -0
- package/dist/utils/tool-names.js +25 -0
- package/dist/utils/url-helpers.d.ts +3 -0
- package/dist/utils/url-helpers.js +10 -0
- package/dist/utils/user-status.d.ts +8 -0
- package/dist/utils/user-status.js +33 -0
- package/dist/utils/validate-comms-token.d.ts +13 -0
- package/dist/utils/validate-comms-token.js +22 -0
- package/package.json +85 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Doist
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,45 +1,209 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Comms MCP & AI Tools
|
|
2
|
+
|
|
3
|
+
MCP server and importable AI tools for the Todoist Comms API. Use the
|
|
4
|
+
tools through an MCP server, or import them directly to plug Comms into
|
|
5
|
+
your own AI conversational interface.
|
|
6
|
+
|
|
7
|
+
## Using the tools
|
|
8
|
+
|
|
9
|
+
### 1. Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install @todoist/comms-mcp
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This package was previously published as `@doist/comms-mcp`.
|
|
16
|
+
|
|
17
|
+
### 2. Plug them into an AI
|
|
18
|
+
|
|
19
|
+
Example with [Vercel's AI SDK](https://ai-sdk.dev/docs/ai-sdk-core/generating-text#streamtext):
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
import { fetchInbox, reply, markDone } from '@todoist/comms-mcp'
|
|
23
|
+
import { streamText } from 'ai'
|
|
24
|
+
|
|
25
|
+
const result = streamText({
|
|
26
|
+
model: yourModel,
|
|
27
|
+
system: 'You are a helpful Comms assistant',
|
|
28
|
+
tools: {
|
|
29
|
+
fetchInbox,
|
|
30
|
+
reply,
|
|
31
|
+
markDone,
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
```
|
|
2
35
|
|
|
3
|
-
##
|
|
36
|
+
## Using as an MCP server
|
|
37
|
+
|
|
38
|
+
### Quick start
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx @todoist/comms-mcp
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Setup
|
|
45
|
+
|
|
46
|
+
#### Claude Desktop
|
|
47
|
+
|
|
48
|
+
Add to `claude_desktop_config.json`:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"comms": {
|
|
54
|
+
"command": "npx",
|
|
55
|
+
"args": ["-y", "@todoist/comms-mcp"],
|
|
56
|
+
"env": {
|
|
57
|
+
"COMMS_API_KEY": "your-comms-api-key-here"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Cursor
|
|
65
|
+
|
|
66
|
+
`~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (per-project):
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"mcpServers": {
|
|
71
|
+
"comms": {
|
|
72
|
+
"command": "npx",
|
|
73
|
+
"args": ["-y", "@todoist/comms-mcp"],
|
|
74
|
+
"env": {
|
|
75
|
+
"COMMS_API_KEY": "your-comms-api-key-here"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### Claude Code (CLI)
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
claude mcp add comms npx @todoist/comms-mcp
|
|
86
|
+
export COMMS_API_KEY=your-comms-api-key-here
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### Visual Studio Code
|
|
90
|
+
|
|
91
|
+
1. Command Palette → MCP: Add Server
|
|
92
|
+
2. Configure:
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"servers": {
|
|
97
|
+
"comms": {
|
|
98
|
+
"command": "npx",
|
|
99
|
+
"args": ["-y", "@todoist/comms-mcp"],
|
|
100
|
+
"env": {
|
|
101
|
+
"COMMS_API_KEY": "your-comms-api-key-here"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Targeting a non-production deployment
|
|
109
|
+
|
|
110
|
+
By default the server talks to `https://comms.todoist.com`. To point at
|
|
111
|
+
staging or a custom deployment, also set `COMMS_BASE_URL`:
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
"env": {
|
|
115
|
+
"COMMS_API_KEY": "your-comms-api-key-here",
|
|
116
|
+
"COMMS_BASE_URL": "https://comms.staging.todoist.com"
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Getting a Comms API key
|
|
121
|
+
|
|
122
|
+
Comms accepts your Todoist API token. In Todoist, open **Settings →
|
|
123
|
+
Integrations → Developer** and copy the API token, then export it as
|
|
124
|
+
`COMMS_API_KEY` (or paste it into the MCP client config above). It has
|
|
125
|
+
full access to your account, so keep it secret.
|
|
126
|
+
|
|
127
|
+
## Features
|
|
128
|
+
|
|
129
|
+
The tools are intentionally workflow-shaped rather than 1:1 wrappers
|
|
130
|
+
around API endpoints, so an LLM can complete a useful action with a
|
|
131
|
+
small number of calls.
|
|
132
|
+
|
|
133
|
+
### Available tools
|
|
134
|
+
|
|
135
|
+
- **userInfo** — Information about the current user, including their status
|
|
136
|
+
- **updateUserInfo** — Change the user's name, timezone, language or status. The status is shared with Todoist (message, emoji, end, paused notifications or Karma). Over an OAuth connection this needs the `user:write` scope
|
|
137
|
+
- **fetchInbox** — Threads and conversations from the inbox
|
|
138
|
+
- **loadThread** — Load a thread with its comments
|
|
139
|
+
- **loadConversation** — Load a conversation with its messages
|
|
140
|
+
- **searchContent** — Search a workspace for threads, comments, and messages
|
|
141
|
+
- **getMentions** — Threads, comments, and messages mentioning the current user
|
|
142
|
+
- **create-channel** / **update-channel** — Create or update workspace channels through MCP
|
|
143
|
+
- **createThread** — Start a new channel thread. 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 [COMMS_CREATE_THREAD_DISPLAY_IN_INBOX](#environment-variables).
|
|
144
|
+
- **updateObject** / **deleteObject** — Edit or remove a thread, comment, or message
|
|
145
|
+
- **reply** — Reply to a thread or conversation
|
|
146
|
+
- **react** — Add a reaction to a thread, comment, conversation, or message
|
|
147
|
+
- **markDone** — Mark threads or conversations as read and/or archived
|
|
148
|
+
- **markRead** — Mark threads and/or conversations as read without archiving them (specific IDs, or everything unread in a workspace)
|
|
149
|
+
- **buildLink** — Build URLs to Comms resources
|
|
150
|
+
- **listChannels** / **getGroups** / **getUsers** / **getWorkspaces** — Discovery helpers
|
|
151
|
+
|
|
152
|
+
For details, see [src/tools](src/tools).
|
|
153
|
+
|
|
154
|
+
## Environment Variables
|
|
155
|
+
|
|
156
|
+
| Variable | Default | Description |
|
|
157
|
+
| -------------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
158
|
+
| `COMMS_API_KEY` | _(required)_ | Your Comms API key. |
|
|
159
|
+
| `COMMS_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. |
|
|
160
|
+
|
|
161
|
+
## Dependencies
|
|
162
|
+
|
|
163
|
+
- MCP server uses the official [@modelcontextprotocol/server](https://github.com/modelcontextprotocol/typescript-sdk)
|
|
164
|
+
- Comms TypeScript SDK [@doist/comms-sdk](https://github.com/Doist/comms-sdk-typescript)
|
|
165
|
+
|
|
166
|
+
## Local development
|
|
167
|
+
|
|
168
|
+
### Prerequisites
|
|
169
|
+
|
|
170
|
+
- Node.js 20.18.1+
|
|
171
|
+
- npm
|
|
172
|
+
- A Comms API token
|
|
173
|
+
|
|
174
|
+
### Setup
|
|
4
175
|
|
|
5
|
-
|
|
176
|
+
```bash
|
|
177
|
+
git clone https://github.com/todoist/comms-mcp.git
|
|
178
|
+
cd comms-mcp
|
|
179
|
+
npm install
|
|
180
|
+
cp .env.example .env # then add your COMMS_API_KEY
|
|
181
|
+
npm run build
|
|
182
|
+
```
|
|
6
183
|
|
|
7
|
-
|
|
184
|
+
### Commands
|
|
8
185
|
|
|
9
|
-
|
|
186
|
+
- `npm start` — Build and run the MCP inspector
|
|
187
|
+
- `npm run dev` — Watch mode with auto-restart
|
|
188
|
+
- `npm test` — Vitest
|
|
189
|
+
- `npm run type-check` — TypeScript
|
|
190
|
+
- `npm run format:check` / `npm run format:fix` — oxlint + oxfmt
|
|
10
191
|
|
|
11
|
-
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@todoist/comms-mcp`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
192
|
+
### Running a single tool directly
|
|
15
193
|
|
|
16
|
-
|
|
194
|
+
```bash
|
|
195
|
+
npx tsx scripts/run-tool.ts user-info '{}'
|
|
196
|
+
npx tsx scripts/run-tool.ts --list
|
|
197
|
+
```
|
|
17
198
|
|
|
18
|
-
|
|
199
|
+
## Contributing
|
|
19
200
|
|
|
20
|
-
|
|
201
|
+
1. Tests pass (`npm test`)
|
|
202
|
+
2. Types pass (`npm run type-check`)
|
|
203
|
+
3. Lint & format pass (`npm run format:check`)
|
|
21
204
|
|
|
22
|
-
|
|
205
|
+
Use [Conventional Commits](https://www.conventionalcommits.org/) — `feat:`, `fix:`, `docs:`, `test:`, `chore:`.
|
|
23
206
|
|
|
24
|
-
|
|
25
|
-
2. Configure the trusted publisher (e.g., GitHub Actions)
|
|
26
|
-
3. Specify the repository and workflow that should be allowed to publish
|
|
27
|
-
4. Use the configured workflow to publish your actual package
|
|
207
|
+
## License
|
|
28
208
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
This package is a placeholder for OIDC configuration only. It:
|
|
32
|
-
- Contains no executable code
|
|
33
|
-
- Provides no functionality
|
|
34
|
-
- Should not be installed as a dependency
|
|
35
|
-
- Exists only for administrative purposes
|
|
36
|
-
|
|
37
|
-
## More Information
|
|
38
|
-
|
|
39
|
-
For more details about npm's trusted publishing feature, see:
|
|
40
|
-
- [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
|
|
41
|
-
- [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
**Maintained for OIDC setup purposes only**
|
|
209
|
+
MIT
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CommsApi } from '@doist/comms-sdk';
|
|
2
|
+
import type { AnyMcpTool, McpTool } from '@todoist/mcp-core';
|
|
3
|
+
import type { z } from 'zod';
|
|
4
|
+
/**
|
|
5
|
+
* A Comms tool that can be used in an MCP server or other conversational AI interfaces: an
|
|
6
|
+
* `McpTool` from `@todoist/mcp-core` whose `execute` receives the Comms API client.
|
|
7
|
+
*
|
|
8
|
+
* `execute` returns `{ textContent, structuredContent }`; registration shapes that into the MCP
|
|
9
|
+
* result, so a tool never builds one itself.
|
|
10
|
+
*/
|
|
11
|
+
type CommsTool<Params extends z.ZodRawShape, Output extends z.ZodRawShape = Record<string, never>> = McpTool<Params, Output, CommsApi>;
|
|
12
|
+
/** A Comms tool of any parameter and output shape, for collections that hold tools of mixed shapes. */
|
|
13
|
+
type AnyCommsTool = AnyMcpTool<CommsApi>;
|
|
14
|
+
export type { AnyCommsTool, CommsTool };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|