Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .changeset/server-hosted-proxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@taskade/mcp-server": major
---

The package now forwards to the hosted Taskade MCP server by default. It connects to `https://www.taskade.com/mcp` with `TASKADE_API_KEY` as a Bearer token, and serves the hosted tools with their names, titles, annotations, schemas, results and errors. It also passes through the instructions, resources and prompts of the hosted server, and the notifications that a list changed. It does not pass through progress notifications, log messages, resource subscriptions, or the roots, sampling and elicitation capabilities of the client. The default mode needs a paid Taskade plan, as the hosted server does. At each start, the package writes one line about `--legacy` to stderr, and adds one sentence about it after the hosted instructions.

A client config with `npx -y @taskade/mcp-server` and no version gets this version at the next start of the client. To keep the behavior of version 0.2.1 with no other change, use `@taskade/mcp-server@0.2.1`.

This is a breaking change for a prompt, skill or script that names a tool of version 0.2, for example `workspacesGet` (now `list_spaces`) or `promptAgent` (now `prompt_agent`). Start the package with `--legacy`, or set `TASKADE_MCP_LEGACY=1`, to get the 66 tools of version 0.2 with the same names and the same API calls, on any plan. Legacy mode stays for one major version.

A token that the hosted server refuses (HTTP 401) stops the package with one message. It tells how to create a token, states the plan rule and names `--legacy`. A network failure or an HTTP error at the start stops the package with one message that names `--legacy` too. In the default mode, every start failure, also a missing or short token, goes to stderr and is the error of the `initialize` request. Legacy mode writes it only to stderr, as before. The package removes the whitespace around the token, as version 0.2 did. A control character that is still in the token, for example a line break inside it, stops the package before any request. No message holds the token. `TASKADE_MCP_URL` points the package at a mock for a test. It accepts only `https://www.taskade.com`, or `127.0.0.1`, `localhost` and `[::1]`.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:24.22.1-slim

LABEL maintainer="Taskade <support@taskade.com>"
LABEL description="Taskade MCP Server — AI tools for projects, tasks, agents, and webhooks via Model Context Protocol"
LABEL description="Taskade MCP Server: AI tools for projects, tasks and agents through the Model Context Protocol"
LABEL org.opencontainers.image.source="https://github.com/taskade/mcp"
LABEL org.opencontainers.image.licenses="MIT"

Expand Down
70 changes: 60 additions & 10 deletions README.md

Large diffs are not rendered by default.

18 changes: 16 additions & 2 deletions packages/server/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Taskade MCP Server — Workspace MCP (`@taskade/mcp-server`)

The **Workspace MCP** server connects an MCP client that runs local stdio servers (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf) to your Taskade workspace. Its tools read and write your projects, tasks, AI agents, media and custom fields through the Taskade public API.
The **Workspace MCP** server connects an MCP client that runs local stdio servers (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf) to your Taskade workspace.

Most people need the hosted server instead: `https://www.taskade.com/mcp`. It needs no install, signs in with OAuth, and can edit Taskade Genesis app source. See [Hosted server or local package](https://github.com/taskade/mcp#hosted-server-or-local-package).
By default, the package connects to the hosted Taskade MCP server, `https://www.taskade.com/mcp`, with your token as a Bearer token. It serves the hosted tools with their names, and forwards each request. The hosted server works on every paid Taskade plan. It does not work on the Free plan.

With `--legacy` (or `TASKADE_MCP_LEGACY=1`), the package serves the tools of version 0.2 instead. They read and write your projects, tasks, AI agents, media and custom fields through the Taskade public API v1 and v2, on any plan. Legacy mode stays for one major version.

A client that connects to remote servers needs no install: it can use `https://www.taskade.com/mcp` directly, with OAuth. See [Hosted server or local package](https://github.com/taskade/mcp#hosted-server-or-local-package).

> 📖 **Full documentation lives in the canonical sources — this package README is intentionally a stub to avoid drift.**

Expand All @@ -18,6 +22,16 @@ TASKADE_API_KEY="your-api-key-here" npx -y @taskade/mcp-server

You need Node.js 18 or later and a Taskade personal access token. Create the token at [https://www.taskade.com/settings/api](https://www.taskade.com/settings/api).

Legacy mode:

```sh
TASKADE_API_KEY="your-api-key-here" npx -y @taskade/mcp-server --legacy
```

A client config with `npx -y @taskade/mcp-server` and no version gets version 1.0.0 at the next start of the client. To keep the behavior of version 0.2.1 with no other change, use `@taskade/mcp-server@0.2.1`.

To test the package against a local mock, set `TASKADE_MCP_URL`. It accepts only an address on `https://www.taskade.com`, `127.0.0.1`, `localhost` or `[::1]`, because the package sends your token there.

To list the tools and call them, run the package in the [MCP Inspector](https://github.com/modelcontextprotocol/inspector):

```sh
Expand Down
68 changes: 68 additions & 0 deletions packages/server/src/__snapshots__/legacy-tool-names.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[
"workspaceCreateProject",
"workspacesGet",
"workspaceFoldersGet",
"projectGet",
"projectComplete",
"projectRestore",
"projectCopy",
"projectCreate",
"projectFromTemplate",
"projectMembersGet",
"projectFieldsGet",
"projectShareLinkGet",
"projectShareLinkEnable",
"projectBlocksGet",
"projectTasksGet",
"taskGet",
"taskDelete",
"taskPut",
"taskComplete",
"taskUncomplete",
"taskCreate",
"taskMove",
"taskAssigneesGet",
"taskPutAssignees",
"taskDeleteAssignees",
"taskGetDate",
"taskDeleteDate",
"taskPutDate",
"taskNoteGet",
"taskNotePut",
"taskNoteDelete",
"taskFieldsValueGet",
"taskFieldValueGet",
"taskFieldValueDelete",
"taskFieldValuePut",
"folderProjectsGet",
"folderAgentGenerate",
"folderCreateAgent",
"folderAgentGet",
"mediasGet",
"folderProjectTemplatesGet",
"meProjectsGet",
"agentPublicAccessEnable",
"agentGet",
"deleteAgent",
"agentUpdate",
"agentPublicGet",
"agentPublicUpdate",
"agentKnowledgeProjectCreate",
"agentKnowledgeMediaCreate",
"agentKnowledgeProjectRemove",
"agentKnowledgeMediaRemove",
"agentConvosGet",
"agentConvoGet",
"mediaGet",
"mediaDelete",
"publicAgentGet",
"promptAgent",
"listConversations",
"getConversation",
"listTasks",
"renameProject",
"createTask",
"setTaskFieldValue",
"subscribeWebhook",
"unsubscribeWebhook"
]
105 changes: 90 additions & 15 deletions packages/server/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,50 +1,125 @@
import { inspect } from 'node:util';

import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { ErrorCode, isJSONRPCRequest } from '@modelcontextprotocol/sdk/types.js';

import {
createProxyServer,
hostedServerTransport,
hostedServerUrl,
isLegacyMode,
LEGACY_NOTE,
} from './proxy';
import { TaskadeMCPServer } from './server';

function validateAccessToken(token: string | undefined): string {
// Legacy mode prints the message and exits, as version 0.2 did.
function exitWith(message: string): never {
console.error(message);
process.exit(1);
}

// Removes the whitespace around the key. `fail` gets the message for a missing or short key.
function validateAccessToken(token: string | undefined, fail: (message: string) => never): string {
if (!token) {
console.error(
fail(
'ERROR: TASKADE_API_KEY environment variable is not set.\n\n' +
'To fix this:\n' +
'1. Generate a Personal Access Token at: https://www.taskade.com/settings/api\n' +
'2. Set the environment variable:\n' +
' export TASKADE_API_KEY="your_token_here"\n',
);
process.exit(1);
}

const trimmedToken = token.trim();

if (trimmedToken.length === 0) {
console.error('ERROR: TASKADE_API_KEY is empty. Please provide a valid token.');
process.exit(1);
fail('ERROR: TASKADE_API_KEY is empty. Please provide a valid token.');
}

if (trimmedToken.length < 10) {
console.error(
fail(
'ERROR: TASKADE_API_KEY appears to be invalid (too short).\n' +
'Please verify your token at: https://www.taskade.com/settings/api',
);
process.exit(1);
}

return trimmedToken;
}

// Most clients show only a failed state when the server exits, and keep stderr in a log. A
// client shows the error of its initialize request, so the message goes there too.
async function answerWithError(text: string): Promise<void> {
process.exitCode = 1;
const transport = new StdioServerTransport();
transport.onmessage = (request) => {
if (isJSONRPCRequest(request)) {
void transport
.send({
jsonrpc: '2.0',
id: request.id,
error: { code: ErrorCode.InternalError, message: text },
})
.then(() => transport.close());
}
};
await transport.start();
}

// Cuts the key out of a text, so that no unexpected error shows it.
function withoutKey(text: string): string {
const key = process.env.TASKADE_API_KEY?.trim();
return key ? text.split(key).join('<TASKADE_API_KEY>') : text;
}

function throwError(message: string): never {
throw new Error(message);
}

async function main() {
const accessToken = validateAccessToken(process.env.TASKADE_API_KEY);
// Legacy mode: the tools that the package generates from the Taskade API v1 and v2.
if (isLegacyMode(process.argv.slice(2), process.env)) {
const accessToken = validateAccessToken(process.env.TASKADE_API_KEY, exitWith);
const server = new TaskadeMCPServer({
accessToken,
});
const transport = new StdioServerTransport();
await server.connect(transport);

const server = new TaskadeMCPServer({
accessToken,
});
const transport = new StdioServerTransport();
await server.connect(transport);
console.error('Taskade MCP Server running on stdio');
return;
}

// Default mode: forward the MCP session to the hosted server. Every failure before the
// stdio connection goes to stderr and to the initialize request of the client.
console.error(LEGACY_NOTE);
let url;
let server;
try {
const accessToken = validateAccessToken(process.env.TASKADE_API_KEY, throwError);
url = hostedServerUrl(process.env.TASKADE_MCP_URL);
server = await createProxyServer(hostedServerTransport(url, accessToken));
} catch (error) {
const message =
error instanceof Error && error.message.startsWith('ERROR: ')
? error.message
: `ERROR: The local package could not start: ${withoutKey(String(error))}`;
console.error(message);
await answerWithError(message);
return;
}
// The connection to the hosted server keeps the process alive. Close it when the client
// closes stdin, so the process ends as in legacy mode.
process.stdin.on('end', () => void server.close());
await server.connect(new StdioServerTransport());

console.error('Taskade MCP Server running on stdio');
console.error(`Taskade MCP Server running on stdio, connected to ${url.origin}${url.pathname}`);
}

main().catch((error) => {
console.error('Fatal error in main():', error);
if (error instanceof Error && error.message.startsWith('ERROR: ')) {
console.error(error.message);
} else {
console.error('Fatal error in main():', withoutKey(inspect(error)));
}
process.exit(1);
});
Loading
Loading