Articles on: Integrations & Advanced Features

MCP Server - Connect with you LLM

Overview


How do I connect to the MCP server in CxPlanner?


The MCP server provides a structured way to call tools, test endpoints, and integrate with CxPlanner’s APIs. It follows the same authentication and workflow as the existing REST API, making it simple to reuse your existing credentials.


Only users with the company role Admin can configure or test MCP connections.



When and why to use this


Use the MCP server when you need to:


  • Integrate with external systems using a structured tool-based approach.
  • Run automated checks or tests such as ping or get_users_on_platform.
  • Maintain a single authentication flow across REST API and MCP calls.


Key facts:


  • Authentication is the same as for the REST API - include your token and projectID.
  • Rate limits are identical to REST.
  • MCP supports streamable HTTP by default.
  • A Mcp-Session-Id is issued on initialize and must be echoed by the client.
  • Tools are project-aware and may require a projectID parameter.



How to - step by step


  1. Set your base endpoint:


   https://mcp.cxplanner.com


  1. Authenticate using the same Bearer token and projectID as the REST API.


  1. Initialize the MCP session:


  • Call the initialize tool.
  • Capture the Mcp-Session-Id returned.


  1. List available tools:


  • Use tools/list to confirm the available actions.


  1. Call a tool:


  • Global API → get_users_on_platform (no parameters).
  • Project API → get_users (requires projectID as query param).


  1. Test a safe tool (example: ping):


  • Run with arguments { "message": "hello" }.



Behavior and results


MCP supports the following tool calls:


Tool

Purpose

initialize

Starts a session and returns session ID

tools/list

Lists available tools

tools/call

Executes a specific tool

ping

Test connectivity with a message response


Authentication


  • Bearer token and projectID are required.
  • Same developer permission levels apply (READ, READ-WRITE, GLOBAL).



Troubleshooting


Problem

Cause

Solution

401 Unauthorized

Missing or invalid bearer token

Check token and include projectID if needed

Tool not found

Incorrect tool name in request

Use tools/list to confirm available tools

Request exceeds Y req/min

Rate limit from REST API also applies

Slow down calls or batch requests

No session ID returned

initialize call not completed

Run initialize before calling other tools



Quick facts


  • Requires: Company role Admin
  • Location: API → MCP Server
  • Affects: Tool calls, authentication, rate limits
  • Tools included: initialize, tools/list, tools/call, ping



Example code


const endpoint = 'https://mcp.cxplanner.com';

async function mcp(method, params = {}, id = String(Date.now())) {
const res = await fetch(endpoint, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
method,
params,
id,
}),
});

if (!res.ok) {
const text = await res.text().catch(() => '');
throw new Error(`HTTP ${res.status} ${res.statusText}: ${text}`);
}

return res.json();
}

// Example: initialize
(async () => {
try {
const resp = await mcp('initialize');
console.log('initialize →', resp);
} catch (err) {
console.error(err);
}
})();

// Example: list tools
(async () => {
try {
const resp = await mcp('tools/list');
console.log('tools/list →', resp);
} catch (err) {
console.error(err);
}
})();

// Example: call tool
(async () => {
try {
const resp = await mcp('tools/call', { name: 'get_users_on_platform', arguments: { bearerToken: 'xxxxx' } });
console.log('tools/call →', resp);
} catch (err) {
console.error(err);
}
})();


Updated on: 09/19/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!