Targetprocess MCP Server
This package provides an an open-source MCP (Model Context Protocol) server designed to act as a crucial bridge, allowing AI assistants to seamlessly integrate with and manage the Targetprocess project management platform. It exposes a comprehensive set of structured tools that empower AI assistants to query, create, and manage Targetprocess entities such as user stories, bugs, tasks, and features through natural language workflows. The current stable version is 2.0.0, indicating a mature state for handling LLM-driven interactions. Release cadence is not explicitly stated in the provided documentation, but the package appears actively maintained given its recent major version. Its key differentiator is its explicit focus on providing an LLM-friendly, tool-based interface, specifically designed for agents like Claude MCP AI, by abstracting the complexities of the Targetprocess API into a more accessible paradigm. This server is valuable for managing large-scale Targetprocess implementations and integrating with other systems. It requires Node.js version 20 or higher for operation.
Common errors
-
ERROR: Environment variables TP_TOKEN, TP_BASE_URL, and TP_OWNER_ID must be set.
cause The server failed to start because one or more required environment variables for Targetprocess API connection were missing.fixSet `TP_TOKEN`, `TP_BASE_URL`, and `TP_OWNER_ID` in your environment or in the script that launches the server. Example: `export TP_TOKEN="your_token" && export TP_BASE_URL="https://your-instance.tpondemand.com" && node build/index.js`. -
Failed to connect to Targetprocess API: Unauthorized (401)
cause The provided `TP_TOKEN` is invalid, expired, or lacks the necessary permissions to access the Targetprocess API.fixVerify your `TP_TOKEN` in Targetprocess settings. Generate a new Access Token if necessary and ensure it has the appropriate read/write permissions for the entities the server intends to manage. Also, check the `TP_BASE_URL` format. -
MCP error -32600: Search failed: Failed to search UserStorys after 3 attempts: search UserStorys failed: 400 - Error during parameters parsing.
cause An AI agent issued a tool command with a query that the Targetprocess API could not parse, often due to overly complex `WHERE` clauses or unsupported filter patterns.fixAdjust the AI agent's prompt or the tool's implementation to generate simpler and more direct Targetprocess API queries. Avoid highly complex `WHERE` clauses, especially with multiple `IN` operators. -
Connection refused errors. Server disconnected messages. Command not found errors.
cause The MCP host client (e.g., AI agent) cannot connect to the running MCP server, or the server failed to start properly.fixVerify the server process is running and listening on the expected port. Check firewall rules. Ensure the `command` and `args` in your MCP client configuration correctly point to the server's executable script. Review server logs for startup errors.
Warnings
- breaking The server explicitly requires Node.js version 20 or higher. Running with older Node.js versions will likely lead to startup failures or unexpected behavior.
- gotcha Correct configuration of `TP_TOKEN`, `TP_BASE_URL`, and `TP_OWNER_ID` environment variables is critical for server operation. Incorrect values will prevent connection to Targetprocess or result in unauthorized errors.
- gotcha The server is designed for the Model Context Protocol (MCP). Attempting to interact with it via a standard REST API client or without an MCP-compatible agent will not work as intended, as it expects specific JSON-RPC 2.0 formatted messages.
- gotcha Complex Targetprocess API queries using `WHERE` clauses with `IN` operators or `Count`-based filtering might not be fully supported by the underlying Targetprocess API via the server, leading to parsing errors.
Install
-
npm install targetprocess-mcp-server -
yarn add targetprocess-mcp-server -
pnpm add targetprocess-mcp-server
Imports
- startServer
// This package is a server, not a library for direct import. Run it as a process.
- TargetprocessClient
// This package's internal components are not exposed for direct import by external applications.
- ToolRegistry
// Access to tools is via the running MCP server's API, not direct JS/TS import.
Quickstart
import { exec } from 'node:child_process';
import path from 'node:path';
// IMPORTANT: Replace with your actual values or set as environment variables
// Generate an Access Token in Targetprocess: Settings -> Authentication and Security -> New Access Token
const TP_TOKEN = process.env.TP_TOKEN ?? 'YOUR_TP_TOKEN';
// Your Targetprocess API endpoint, e.g., 'https://your-instance.tpondemand.com'
const TP_BASE_URL = process.env.TP_BASE_URL ?? 'https://your-instance.tpondemand.com';
// Your Targetprocess User ID, typically found in your Targetprocess profile
const TP_OWNER_ID = process.env.TP_OWNER_ID ?? 'YOUR_TP_OWNER_ID';
if (!TP_TOKEN || !TP_BASE_URL || !TP_OWNER_ID) {
console.error('ERROR: Environment variables TP_TOKEN, TP_BASE_URL, and TP_OWNER_ID must be set.');
console.error('Please configure these either directly in this script or as system environment variables.');
process.exit(1);
}
// Determine the path to the server's executable script.
// In a typical npm install, this might be in node_modules/targetprocess-mcp-server/build/index.js (after a build step)
// For local development from a repository, it's often the main script in the root.
// This example assumes it's within a local node_modules structure or a directly cloned repo.
const serverScriptPath = path.resolve(process.cwd(), './node_modules/targetprocess-mcp-server/build/index.js'); // Common for installed packages
// Alternatively, if running directly from a cloned repo for development:
// const serverScriptPath = path.resolve(process.cwd(), './index.js'); // Adjust based on actual project structure
const command = `node ${serverScriptPath}`;
const options = {
env: {
...process.env,
TP_TOKEN,
TP_BASE_URL,
TP_OWNER_ID
}
};
console.log(`Attempting to start Targetprocess MCP Server with command: ${command}`);
const serverProcess = exec(command, options, (error, stdout, stderr) => {
if (error) {
console.error(`Server failed to start: ${error.message}`);
return;
}
if (stderr) {
console.error(`Server stderr: ${stderr}`);
}
console.log(`Server stdout: ${stdout}`);
});
serverProcess.stdout.on('data', (data) => {
console.log(`[MCP Server] stdout: ${data}`);
});
serverProcess.stderr.on('data', (data) => {
console.error(`[MCP Server] stderr: ${data}`);
});
serverProcess.on('close', (code) => {
console.log(`Targetprocess MCP Server process exited with code ${code}`);
});
console.log('Targetprocess MCP Server initiated. Check console for startup logs.');
console.log('You will need an MCP client (e.g., LobeHub, Claude) to interact with the running server.');