A Model Context Protocol (MCP) server that exposes Autotask ticket search functionality to LLMs like Claude.
This MCP server provides LLMs with the ability to search and retrieve Autotask tickets using advanced semantic search, keyword matching, and AI-powered reranking. It integrates seamlessly with Claude Desktop, Cursor, and other MCP-compatible clients.
- Advanced Search: Multi-method search combining BM25, semantic vectors, and fuzzy matching
- AI Reranking: Results are reranked using cross-encoder models for optimal relevance
- Related Tickets: Find semantically similar tickets using vector similarity and AI re-ranking
- Detailed Ticket Info: Retrieve complete ticket details including all notes
- Bulk Operations: Fetch notes for multiple tickets efficiently
- LLM-Optimized: Results formatted for easy LLM comprehension
- Robust Error Handling: Clear error messages with unique grep codes for debugging
- Easy Setup: Shell wrapper handles venv creation and dependencies
- Python 3.10 or higher
- Running Autotask Django API server (default: http://localhost:8000)
- Valid API key for the Autotask API
cd /path/to/autotask-data-warehouse/mcp-autotask-searchcp .env.example .env
# Edit .env and add your API keyThe run.sh script will automatically create a venv and install dependencies:
./run.shAdd to your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"autotask-search": {
"command": "/absolute/path/to/autotask-data-warehouse/mcp-autotask-search/run.sh",
"env": {
"AUTOTASK_API_KEY": "your-api-key-here",
"AUTOTASK_API_BASE_URL": "http://localhost:8000"
}
}
}
}Important: Use the absolute path to run.sh, not a relative path.
Add to your Cursor settings (.cursor/mcp.json in your project or global settings):
{
"mcpServers": {
"autotask-search": {
"command": "/absolute/path/to/autotask-data-warehouse/mcp-autotask-search/run.sh",
"env": {
"AUTOTASK_API_KEY": "your-api-key-here",
"AUTOTASK_API_BASE_URL": "http://localhost:8000"
}
}
}
}AUTOTASK_API_KEY(required): Your API key for authenticationAUTOTASK_API_BASE_URL(optional): Base URL for the API (default:http://localhost:8000)
Search Autotask tickets using advanced semantic and keyword search.
Parameters:
query(string, required): Search query (supports partial names, keywords, typos)limit(integer, optional): Maximum results to return (default: 10, max: 100)
Example Usage:
Search for tickets about "password reset issues"
Search for "outlook email problems for ABC Company"
Search for "slow computer" with limit 5
Search Capabilities:
- Works with imperfect queries (typos, partial company names)
- Semantic understanding (finds relevant tickets even without exact keyword matches)
- Combines multiple search methods for comprehensive results
- Returns results ranked by relevance
Get complete details for a specific ticket including all notes.
Parameters:
task_id(integer, required): The numeric task ID from search results
Example Usage:
Get full details for ticket 12345
Show me all notes for task_id 67890
Returns:
- Complete ticket information
- All human-created notes with timestamps
- Status and priority information
Find tickets semantically related to a given ticket using vector similarity and AI re-ranking.
Parameters:
task_id(integer, required): The numeric task ID to find related tickets forlimit(integer, optional): Maximum results to return (default: 10, max: 30)
Example Usage:
Find tickets related to task 12345
Show me similar tickets to ticket 67890
Get 20 related tickets for task_id 54321
How It Works:
- Uses vector embeddings to find semantically similar tickets
- Re-ranks results with AI model for optimal relevance
- Returns tickets with similar issues, topics, or root causes
Returns:
- List of related tickets with task numbers and titles
- Relevance scores for each related ticket
- Results ranked by relevance
Get notes for multiple tickets in bulk. More efficient than calling get_ticket_details multiple times when you only need notes.
Parameters:
task_ids(list of integers, optional): List of task IDs. Example:[12345, 67890]task_numbers(list of strings, optional): List of ticket numbers. Example:["T20240101.0001", "T20240102.0005"]
Notes:
- At least one parameter must be provided
- Maximum of 50 tickets per request
- Only returns human-created notes (system notes excluded)
- Results grouped by ticket and sorted chronologically
Example Usage:
Get notes for tickets 12345 and 67890
Show me notes for tickets T20240101.0001 and T20240102.0005
Get all notes for task_ids [100, 101, 102]
Returns:
- All notes for each ticket
- Note timestamps and titles
- Notes grouped by ticket
Once configured, you can ask Claude:
"Search for tickets about email configuration issues"
"Find tickets related to password resets at ABC Company"
"Show me recent tickets about network problems"
"Get the full details for ticket 12345"
"Find tickets similar to ticket 12345"
"Show me related tickets for task 67890"
"Get all notes for tickets 12345, 67890, and 11111"
"Show me notes for tickets T20240101.0001 and T20240102.0005"
Claude will use the MCP tools to search the Autotask database and return formatted results.
Install the MCP Inspector:
npm install -g @modelcontextprotocol/inspectorRun the inspector:
cd mcp-autotask-search
npx @modelcontextprotocol/inspector ./run.shThis opens a web UI where you can test the tools interactively.
Before testing, ensure your Autotask Django server is running:
cd /path/to/autotask-data-warehouse
python manage.py runserverVerify the API is accessible:
curl -H "Authorization: Bearer YOUR_API_KEY" \
"http://localhost:8000/api/search/double-reranked/?q=test&limit=5"Symptom: Server fails to start with error code [MCPS-NOKEY]
Solution:
- Ensure
AUTOTASK_API_KEYis set in your Claude Desktop/Cursor config - Check that the environment variable is being passed correctly
- Verify the API key is valid
Symptom: Error code [MCPS-CONN]
Solution:
- Check that the Django server is running:
python manage.py runserver - Verify
AUTOTASK_API_BASE_URLis correct (default:http://localhost:8000) - Test API directly with curl
Symptom: Error code [MCPS-AUTH]
Solution:
- Verify API key is valid and not expired
- Check API key has proper permissions in Django admin
- Ensure key is correctly formatted in config
Symptom: Error code [MCPS-404]
Solution:
- Verify Django server is running and accessible
- Check that search endpoints are properly configured
- Ensure you're using the correct base URL
Possible Causes:
- No tickets match the query
- Database is empty or not indexed
- Search index needs rebuilding
Solution:
cd /path/to/autotask-data-warehouse
python manage.py index_ticketsmcp-autotask-search/
├── src/
│ └── autotask_search_mcp/
│ ├── __init__.py
│ └── server.py # Main MCP server implementation
├── run.sh # Shell wrapper (creates venv, runs server)
├── pyproject.toml # Python project config
├── README.md # This file
└── .env.example # Example environment file
cd mcp-autotask-search
./run.shAll errors include unique grep codes (prefix: MCPS-) for easy log searching:
# Search logs for specific errors
grep "MCPS-CONN" logs.txt
grep "MCPS-AUTH" logs.txtCommon Grep Codes:
MCPS-INIT- Server initializationMCPS-START- Server startingMCPS-SEARCH- Search requestMCPS-DETAIL- Detail requestMCPS-RELATED- Related tickets requestMCPS-NOTES-REQ- Bulk notes requestMCPS-NOTES-POST- Bulk notes POST requestMCPS-NOTES-OK- Bulk notes successMCPS-NOTES-NOPARAM- No parameters providedMCPS-NOTES-EMPTY- Empty parametersMCPS-NOTES-LIMIT- Too many tickets requestedMCPS-NOTES-AUTH- Authentication failedMCPS-NOTES-BADREQ- Bad requestMCPS-NOTES-404- Endpoint not foundMCPS-NOTES-SVR- Server errorMCPS-NOTES-CONN- Connection errorMCPS-NOTES-TIMEOUT- Request timeoutMCPS-NOTES-ERR- Unexpected errorMCPS-NOKEY- API key missingMCPS-AUTH- Authentication failedMCPS-CONN- Connection errorMCPS-404- Endpoint not foundMCPS-NOTFOUND- Ticket not foundMCPS-SVR- Server errorMCPS-TIMEOUT- Request timeoutMCPS-REQ- Making API requestMCPS-OK- Request successfulMCPS-NORES- No results foundMCPS-ERR- Unexpected error
The server uses the /api/search/double-reranked/ endpoint which combines:
- BM25 - Full-text search on titles, descriptions, and notes
- Vector Search - Semantic search using embeddings
- Fuzzy Matching - Handles typos and misspellings
- AI Reranking - Cross-encoder model reranks for optimal relevance
Results are formatted for LLM readability:
Task #T20240216.0023 (ID: 12345) - Relevance: 0.95
Title: Password reset issue
Description: User cannot reset password...
Created: 2024-02-16 14:30
---
The server uses Bearer token authentication:
Authorization: Bearer <your-api-key>
This is a POC/internal tool. See parent project for license information.
For issues or questions:
- Check the Troubleshooting section above
- Review logs for grep codes
- Verify Django server is running and accessible
- Test API directly with curl
Current version: 0.1.0 (POC)