Integrations
HaloPSA MCP Tools
Model Context Protocol (MCP) server for interacting with the HaloPSA API.
Overview
This package provides a Model Context Protocol server implementation that allows AI assistants (like Claude) to interact with the HaloPSA API. It can be used in various configurations:
- As a standalone server
- Integrated with Claude Desktop
- As a library in Node.js applications
Features
- MCP server with support for multiple transport types (stdio, http, tcp)
- Tools for interacting with tickets, users, assets, and more
- Seamless integration with Claude Desktop
- Configurable logging and error handling
- Robust security checks
- Cross-version compatibility with MCP SDK
Installation
NPM Global Installation
Local Installation
Configuration
Create a .env
file in your project root with the following environment variables:
Alternatively, you can use Claude Desktop's configuration if the tool is running as a Claude Desktop integration.
Usage
Using as a Standalone Server
Using with Claude Desktop
To use with Claude Desktop:
- Install the package globally:
- Configure Claude Desktop to use this MCP server in the Claude Desktop settings (Settings > Extensions > Add MCP Server):
- Name: HaloPSA
- Command: haloapi-desktop-mcp
- Environment Variables (optional):
- HALO_API_URL: Your HaloPSA API URL
- HALO_CLIENT_ID: Your client ID
- HALO_CLIENT_SECRET: Your client secret
- Start using the HaloPSA tools in your Claude conversations!
Alternatively, if you've cloned this repository, you can run:
The MCP server will automatically detect and use the configuration from your Claude Desktop settings.
Using as a Library
Structure
The codebase is organized with the following structure:
src/core/
- Core MCP server implementationsrc/tools/
- Tool definitions for HaloPSA API operationssrc/utils/
- Utility functions for logging, validation, etc.src/services/
- Service layer for HaloPSA API operationssrc/api/
- API clients for HaloPSAbin/
- Executable entry pointsscripts/
- Utility scripts for development and maintenance
MCP Tools
This package provides several tools for interacting with HaloPSA and implements standard MCP protocol methods required by Claude Desktop:
Ticket Tools
get-tickets
: Get a list of tickets with optional filteringget-ticket
: Get detailed information about a specific ticketcreate-ticket
: Create a new ticketupdate-ticket
: Update an existing ticketdelete-ticket
: Delete a ticketget-ticket-comments
: Get comments for a specific ticketadd-comment
: Add a comment to a ticket
User Tools
get-users
: Get a list of users with optional filteringget-user
: Get detailed information about a specific usercreate-user
: Create a new userupdate-user
: Update an existing userdelete-user
: Delete a userget-agents
: Get a list of agents
Asset Tools
get-assets
: Get a list of assets with optional filteringget-asset
: Get detailed information about a specific assetcreate-asset
: Create a new assetupdate-asset
: Update an existing assetdelete-asset
: Delete an assetget-asset-types
: Get a list of all asset types
Standard MCP Methods
resources/list
: List all available resources in the MCP serverprompts/list
: List all available prompts for Claude Desktop integrationtools/list
: List all available tools in the MCP server
Claude Desktop Integration
The package includes a unified implementation for Claude Desktop integration that works across different MCP SDK versions.
Key features of the unified implementation:
- Cross-version compatibility through the SDK compatibility layer
- Automatic configuration detection from Claude Desktop settings
- Robust error handling and fallback mechanisms
- Comprehensive logging and debugging support
Troubleshooting
Common Issues
Module Imports
If you encounter errors related to imports or module systems:
Solution: Check that you're using the correct import syntax for your project configuration. This package primarily uses CommonJS, so use require()
statements.
Authentication Errors
If you see errors related to HaloPSA authentication:
Solution: Verify your client ID and client secret in the environment variables or configuration.
Transport Issues
If the server fails to start with a specific transport type:
Solution: Ensure you're using one of the supported transport types: 'stdio', 'http', or 'tcp'.
Claude Desktop Integration Issues
If Claude Desktop is unable to connect to your MCP server or shows errors about unsupported methods:
Solution: Make sure you're using the latest version of this package which includes the unified MCP implementation with robust support for the MCP protocol.
JSON Parsing Errors
If you're seeing JSON parsing errors in the MCP server logs like:
Solution: The latest version includes enhanced JSON handling that automatically fixes common issues with malformed messages. If you're still experiencing problems, enable debug mode to see more details:
Debugging
To enable detailed debugging information, set the DEBUG environment variable:
You can also increase the log level for even more detailed information:
For Claude Desktop integration, you can find logs in the following locations:
- macOS:
~/Library/Logs/Claude/mcp-server-halopsa.log
- Windows:
%APPDATA%\Claude\Logs\mcp-server-halopsa.log
- Linux:
~/.local/share/claude/logs/mcp-server-halopsa.log
Testing
You can test the MCP server using the included test script:
The interactive test script allows you to test individual tools and inspect their responses, which is useful for debugging and development.
Development and Extension
The codebase follows several design patterns and practices that should be followed when adding new features or making changes:
Design Patterns
- Compatibility Layer Pattern: Used in
src/sdk-compat.js
to provide a consistent interface across different SDK versions. - Dependency Injection: Used throughout the codebase to provide dependencies to modules, making them easier to test and more modular.
- Module Pattern: Each component is organized into modules with clear responsibilities and interfaces.
- Facade Pattern: The main entry points (
desktop-mcp-unified.js
,standalone-mcp.js
) provide simplified interfaces to the underlying functionality.
Adding New Features
When adding new features to the codebase, follow these steps:
- Add new tool definitions to the appropriate module in
src/tools/
- Register the new tools in
src/tools/index.js
- Add any new utility functions to the appropriate module in
src/utils/
- Write tests for the new functionality in the
tests/
directory - Update the documentation to reflect the new features
License
MIT License Copyright (c) 2025 sulemanji.com MCP Team
Contributors
- Suleman Manji (@ssmanji89)
This server cannot be installed
Model Context Protocol server for interacting with the HaloPSA API, enabling AI assistants like Claude to manage tickets, users, and assets in HaloPSA through natural language.