An MCP server implementation that integrates with Freshdesk, enabling AI models to interact with Freshdesk modules and perform various support operations.
- Freshdesk Integration: Seamless interaction with Freshdesk API endpoints
- AI Model Support: Enables AI models to perform support operations through Freshdesk
- Automated Ticket Management: Handle ticket creation, updates, and responses
- Advanced Search Capabilities: Comprehensive ticket search with helper functions for complex queries
This repository also ships a small CLI named fd that wraps the same underlying Freshdesk calls.
Option A (recommended): install with pipx
- Install pipx (one-time):
- macOS (Homebrew):
brew install pipx && pipx ensurepath
- macOS (Homebrew):
- Install
fdfrom the repository:pipx install "git+https://github.com/ivangrynenko/freshdesk_mcp.git"
Option B: install with Python user site
python3.11 -m pip install --user "git+https://github.com/ivangrynenko/freshdesk_mcp.git"- Ensure your PATH includes:
~/Library/Python/3.11/bin
To verify:
fd --helpfd validate-env(will exit non-zero until env vars are set)
fd reads credentials from environment variables:
FRESHDESK_DOMAIN(example:your-domain.freshdesk.com)FRESHDESK_API_KEY
Recommendations for setting env vars:
- In your shell profile (
~/.zshrc): export the variables. - For per-project scoping: use
direnvand a.envrcfile. - For keeping secrets out of dotfiles: use 1Password CLI (
op) or your macOS Keychain workflow to inject them at runtime.
fd validate-envfd tickets get 123 --jsonfd tickets search "status:2 AND priority:3" --jsonfd tickets reply 123 --body "Hello" --jsonfd companies list --json
Option A (pipx):
brew install pipx && pipx ensurepathpipx install "git+https://github.com/ivangrynenko/freshdesk_mcp.git"
Option B (Python user site):
python3.11 -m pip install --user "git+https://github.com/ivangrynenko/freshdesk_mcp.git"- Add
~/Library/Python/3.11/binto PATH
The server offers several tools for Freshdesk operations:
create_ticket: Create new tickets in Freshdeskget_ticket: Retrieve detailed information about a specific ticketupdate_ticket: Update ticket properties and fieldsget_ticket_conversation: Retrieve the conversation thread for a ticketupdate_ticket_conversation: Add notes or replies to ticket conversationssearch_tickets: Search for tickets using Freshdesk's query syntax
The ticket search functionality allows searching for Freshdesk tickets using specific query syntax:
Freshdesk requires a specific format for search queries:
- Format:
"field_name:value AND/OR field_name:'value'" - String values must be enclosed in single quotes
- Numeric values should not have quotes
- Boolean values should be
trueorfalsewithout quotes - Logical operators (
AND,OR) must be uppercase - Parentheses can be used to group conditions
- Spaces are required between different conditions and operators
Common fields that can be used in searches:
| Field | Type | Description |
|---|---|---|
| status | integer | Status of the ticket (2=Open, 3=Pending, etc.) |
| priority | integer | Priority of the ticket (1=Low to 4=Urgent) |
| type | string | Type of the ticket ('Question', 'Problem', etc.) |
| tag | string | Tag associated with the ticket |
| agent_id | integer | ID of the agent assigned to the ticket |
| group_id | integer | ID of the group assigned to the ticket |
| created_at | date | Creation date (YYYY-MM-DD) |
| updated_at | date | Last updated date (YYYY-MM-DD) |
| due_by | date | Due date (YYYY-MM-DD) |
| description | string | Text in the ticket description |
| subject | string | Text in the ticket subject |
| cf_* | varies | Custom fields (prefix with cf_) |
For convenient search query construction, the following helper functions are provided:
build_search_query(field, value, operator): Creates a properly formatted search query partbuild_complex_search_query(*parts, operator): Combines multiple query parts into a complex querysearch_tickets_help(): Provides detailed documentation on Freshdesk's search query syntax
# Simple search for open tickets
search_tickets("status:2")
# Search for high priority open tickets
search_tickets("priority:3 AND status:2")
# Search for tickets with a specific tag
search_tickets("tag:'urgent'")
# Free text search (will automatically search in subject and description)
search_tickets("payment issue")
# Using the helper function to build query parts
status_part = build_search_query("status", 2) # Returns: status:2
priority_part = build_search_query("priority", 3) # Returns: priority:3
type_part = build_search_query("type", "Question") # Returns: type:'Question'
date_part = build_search_query("created_at", "2023-01-01", ">") # Returns: created_at:>'2023-01-01'
# Combine parts into a complex query
complex_query = build_complex_search_query(status_part, priority_part, operator="AND")
# Returns: (status:2 AND priority:3)
# Search with the complex query
search_result = await search_tickets(complex_query)To use this server, you'll need:
- A Freshdesk account
- Freshdesk API key
- Freshdesk domain
Set the following environment variables:
FRESHDESK_API_KEY: Your Freshdesk API keyFRESHDESK_DOMAIN: Your Freshdesk domain (e.g.,company.freshdesk.com)
- Clone the repository
- Install dependencies
- Set up environment variables for Freshdesk
Run the test suite:
python3.11 -m pip install -e '.[test]'
pytestTo install freshdesk_mcp for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @effytech/freshdesk_mcp --client claude- A Freshdesk account (sign up at freshdesk.com)
- Freshdesk API key
uvxinstalled (pip install uvorbrew install uv)
- Generate your Freshdesk API key from the Freshdesk admin panel
- Set up your domain and authentication details
- Install Claude Desktop if you haven't already
- Add the following configuration to your
claude_desktop_config.json:
"mcpServers": {
"freshdesk-mcp": {
"command": "uvx",
"args": [
"freshdesk-mcp"
],
"env": {
"FRESHDESK_API_KEY": "<YOUR_FRESHDESK_API_KEY>",
"FRESHDESK_DOMAIN": "<YOUR_FRESHDESK_DOMAIN>"
}
}
}Important Notes:
- Replace
YOUR_FRESHDESK_API_KEYwith your actual Freshdesk API key - Replace
YOUR_FRESHDESK_DOMAINwith your Freshdesk domain (e.g.,yourcompany.freshdesk.com)
Once configured, you can ask Claude to perform operations like:
- "Create a new ticket with subject 'Payment Issue for customer A101' and description as 'Reaching out for a payment issue in the last month for customer A101', where customer email is a101@acme.com and set priority to high"
- "Update the status of ticket #12345 to 'Resolved'"
- "List all high-priority tickets assigned to the agent John Doe"
- "List previous tickets of customer A101 in last 30 days"
-
"Find all open tickets with high or urgent priority created after January 1st"
search_tickets("status:2 AND priority:>2 AND created_at:>'2023-01-01'")
-
"Find tickets with tag 'billing' that are in pending status"
search_tickets("tag:'billing' AND status:3")
-
"Find tickets with 'payment' mentioned in their subject or description"
search_tickets("payment") # Free text search in subject and description
-
"Find tickets created in the last month that have not been resolved"
# Using helper functions to build a more complex query unresolved = build_complex_search_query( build_search_query("status", 2), # Open build_search_query("status", 3), # Pending build_search_query("status", 6), # Waiting on Customer operator="OR" ) last_month = build_search_query("created_at", "2023-05-01", ">") # Adjust date as needed # Combine the parts query = build_complex_search_query(unresolved, last_month, operator="AND") search_tickets(query)
For testing purposes, you can start the server manually:
uvx freshdesk-mcp --env FRESHDESK_API_KEY=<your_api_key> --env FRESHDESK_DOMAIN=<your_domain>- Verify your Freshdesk API key and domain are correct
- Ensure proper network connectivity to Freshdesk servers
- Check API rate limits and quotas
- Verify the
uvxcommand is available in your PATH - For search query issues, use the helper functions or refer to the search syntax examples
This MCP server is licensed under the MIT License. See the LICENSE file in the project repository for full details.