The ConnectWise API Gateway MCP server provides a comprehensive interface for interacting with the ConnectWise Manage API, simplifying API discovery, execution, and management for both developers and AI assistants through an intuitive Model Context Protocol (MCP) implementation.
manage.json
) - included in the repositoryInstall the package directly from GitHub:
npm install -g jasondsmith72/CWM-API-Gateway-MCP
This method automatically handles all dependencies and provides a simpler configuration for Claude Desktop.
git clone https://github.com/jasondsmith72/CWM-API-Gateway-MCP.git
cd CWM-API-Gateway-MCP
pip install -e .
# Using Homebrew
brew install python@3.10
# Clone the repository
git clone https://github.com/jasondsmith72/CWM-API-Gateway-MCP.git
cd CWM-API-Gateway-MCP
# Set up a virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate
# Install the package
pip install -e .
# Install Python 3.10+
sudo apt update
sudo apt install python3.10 python3.10-venv python3.10-dev python3-pip
# Clone the repository
git clone https://github.com/jasondsmith72/CWM-API-Gateway-MCP.git
cd CWM-API-Gateway-MCP
# Set up a virtual environment
python3.10 -m venv venv
source venv/bin/activate
# Install the package
pip install -e .
This repository already includes a pre-built database, so this step is optional:
# On Windows
python build_database.py path/to/manage.json
# On macOS/Linux
python3 build_database.py path/to/manage.json
Set the following environment variables with your ConnectWise credentials:
CONNECTWISE_API_URL=https://na.myconnectwise.net/v4_6_release/apis/3.0
CONNECTWISE_COMPANY_ID=your_company_id
CONNECTWISE_PUBLIC_KEY=your_public_key
CONNECTWISE_PRIVATE_KEY=your_private_key
CONNECTWISE_AUTH_PREFIX=yourprefix+ # Prefix required by ConnectWise for API authentication
Install the package using NPM and then configure Claude Desktop (claude_desktop_config.json
):
{
"mcpServers": {
"CWM-API-Gateway-MCP": {
"command": "npx",
"args": [
"-y",
"@jasondsmith72/CWM-API-Gateway-MCP"
],
"env": {
"CONNECTWISE_API_URL": "https://na.myconnectwise.net/v4_6_release/apis/3.0",
"CONNECTWISE_COMPANY_ID": "your_company_id",
"CONNECTWISE_PUBLIC_KEY": "your_public_key",
"CONNECTWISE_PRIVATE_KEY": "your_private_key",
"CONNECTWISE_AUTH_PREFIX": "yourprefix+"
}
}
}
}
{
"mcpServers": {
"CWM-API-Gateway-MCP": {
"command": "node",
"args": ["C:/path/to/CWM-API-Gateway-MCP/bin/server.js"],
"env": {
"CONNECTWISE_API_URL": "https://na.myconnectwise.net/v4_6_release/apis/3.0",
"CONNECTWISE_COMPANY_ID": "your_company_id",
"CONNECTWISE_PUBLIC_KEY": "your_public_key",
"CONNECTWISE_PRIVATE_KEY": "your_private_key",
"CONNECTWISE_AUTH_PREFIX": "yourprefix+"
}
}
}
}
# If installed via NPM
cwm-api-gateway-mcp
# If using the Node.js script
node bin/server.js
# Or using the Python script directly
python api_gateway_server.py # Windows
python3 api_gateway_server.py # macOS/Linux
Tool | Description |
---|---|
search_api_endpoints |
Search for API endpoints by query string |
natural_language_api_search |
Find endpoints using natural language descriptions |
list_api_categories |
List all available API categories |
get_category_endpoints |
List all endpoints in a specific category |
get_api_endpoint_details |
Get detailed information about a specific endpoint |
Tool | Description |
---|---|
execute_api_call |
Execute an API call with path, method, parameters, and data |
send_raw_api_request |
Send a raw API request in the format "METHOD /path [JSON body]" |
Tool | Description |
---|---|
save_to_fast_memory |
Manually save an API query to Fast Memory |
list_fast_memory |
List all queries saved in Fast Memory |
delete_from_fast_memory |
Delete a specific query from Fast Memory |
clear_fast_memory |
Clear all queries from Fast Memory |
search_api_endpoints("tickets")
natural_language_api_search("find all open service tickets that are high priority")
execute_api_call(
"/service/tickets",
"GET",
{"conditions": "status/name='Open' and priority/name='High'"}
)
execute_api_call(
"/service/tickets",
"POST",
None, # No query parameters
{
"summary": "Server is down",
"board": {"id": 1},
"company": {"id": 2},
"status": {"id": 1},
"priority": {"id": 3}
}
)
send_raw_api_request("GET /service/tickets?conditions=status/name='Open'")
list_fast_memory()
save_to_fast_memory(
"/service/tickets",
"GET",
"Get all high priority open tickets",
{"conditions": "status/name='Open' and priority/name='High'"}
)
The Fast Memory feature allows you to save and retrieve frequently used API queries, optimizing your workflow by:
list_fast_memory()
list_fast_memory("search term")
delete_from_fast_memory(query_id)
clear_fast_memory()
Error: Database file not found at [path]
Solution: Run the build_database.py
script with the path to your ConnectWise API definition file.
HTTP error 401: Unauthorized
Solution: Verify your environment variables and ensure all ConnectWise credentials are correct.
Request timed out. ConnectWise API may be slow to respond.
Solution: Check your internet connection or consider adding more specific filters to your query.
For better performance with the ConnectWise API:
Use Specific Conditions:
execute_api_call("/service/tickets", "GET", {
"conditions": "status/name='Open' AND dateEntered > [2023-01-01T00:00:00Z]"
})
Limit Field Selection:
execute_api_call("/service/tickets", "GET", {
"conditions": "status/name='Open'",
"fields": "id,summary,status,priority"
})
Paginate Large Results:
execute_api_call("/service/tickets", "GET", {
"conditions": "status/name='Open'",
"page": 1,
"pageSize": 50
})
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "CWM-API-Gateway-MCP" '{"command":"npx","args":["-y","@jasondsmith72/CWM-API-Gateway-MCP"],"env":{"CONNECTWISE_API_URL":"https://na.myconnectwise.net/v4_6_release/apis/3.0","CONNECTWISE_COMPANY_ID":"your_company_id","CONNECTWISE_PUBLIC_KEY":"your_public_key","CONNECTWISE_PRIVATE_KEY":"your_private_key","CONNECTWISE_AUTH_PREFIX":"yourprefix+"}}'
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": {
"CWM-API-Gateway-MCP": {
"command": "npx",
"args": [
"-y",
"@jasondsmith72/CWM-API-Gateway-MCP"
],
"env": {
"CONNECTWISE_API_URL": "https://na.myconnectwise.net/v4_6_release/apis/3.0",
"CONNECTWISE_COMPANY_ID": "your_company_id",
"CONNECTWISE_PUBLIC_KEY": "your_public_key",
"CONNECTWISE_PRIVATE_KEY": "your_private_key",
"CONNECTWISE_AUTH_PREFIX": "yourprefix+"
}
}
}
}
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": {
"CWM-API-Gateway-MCP": {
"command": "npx",
"args": [
"-y",
"@jasondsmith72/CWM-API-Gateway-MCP"
],
"env": {
"CONNECTWISE_API_URL": "https://na.myconnectwise.net/v4_6_release/apis/3.0",
"CONNECTWISE_COMPANY_ID": "your_company_id",
"CONNECTWISE_PUBLIC_KEY": "your_public_key",
"CONNECTWISE_PRIVATE_KEY": "your_private_key",
"CONNECTWISE_AUTH_PREFIX": "yourprefix+"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect