This MCP server implementation enables AI assistants like Claude to interact with the HaloPSA API through the Model Context Protocol. It provides a structured way to access tickets, users, assets, and other HaloPSA resources programmatically.
npm install -g haloapi-mcp-tools
npm install haloapi-mcp-tools
Create a .env
file in your project root with the following settings:
# Required HaloPSA API Configuration
HALO_API_URL=https://yourhalo.haloservicedesk.com/api
HALO_CLIENT_ID=your_client_id
HALO_CLIENT_SECRET=your_client_secret
# Optional Configuration
HALO_API_VERSION=v3
HALO_SCOPE=all
HALO_TENANT=your_tenant_id
TRANSPORT=stdio
PORT=3000
DEBUG=false
# Start with default stdio transport
haloapi-mcp-server
# Use HTTP transport
TRANSPORT=http PORT=3000 haloapi-mcp-server
# Enable debug mode
DEBUG=true haloapi-mcp-server
# Using command-line options
haloapi-mcp-server --transport http --port 3000 --debug
Install the package globally:
npm install -g haloapi-mcp-tools
Configure in Claude Desktop settings (Settings > Extensions > Add MCP Server):
If you've cloned the repository, you can run:
# Run the MCP server for Claude Desktop
npm run claude
# Run with debug logging
npm run claude:debug
# Or use the convenience script
./run-mcp.sh desktop
const { startServer } = require('haloapi-mcp-tools');
async function main() {
const server = await startServer({
transport: 'stdio', // or 'http', 'tcp'
port: 3000,
debug: true,
haloBaseUrl: 'https://yourhalo.haloservicedesk.com/api',
haloClientId: 'your_client_id',
haloClientSecret: 'your_client_secret'
});
console.log('Server started successfully');
// To shut down the server
// await server.close();
}
main().catch(console.error);
If you see errors like:
Error: Invalid client credentials
Verify your client ID and client secret in the environment variables or configuration.
If the server fails to start:
Error: Unsupported transport
Ensure you're using one of the supported transport types: 'stdio', 'http', or 'tcp'.
If Claude Desktop can't connect to your MCP server:
Error: Method not supported: tools/list
Make sure you're using the latest version of this package.
For detailed debugging information:
DEBUG=true haloapi-mcp-server
For even more detailed logs:
LOG_LEVEL=trace haloapi-mcp-server
~/Library/Logs/Claude/mcp-server-halopsa.log
%APPDATA%\Claude\Logs\mcp-server-halopsa.log
~/.local/share/claude/logs/mcp-server-halopsa.log
# Test against a running server
npm run test:mcp
# Run automated tests
npm test
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "haloapi-mcp-tools" '{"command":"haloapi-desktop-mcp","args":[]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"haloapi-mcp-tools": {
"command": "haloapi-desktop-mcp",
"args": []
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"haloapi-mcp-tools": {
"command": "haloapi-desktop-mcp",
"args": []
}
}
}
3. Restart Claude Desktop for the changes to take effect