freshservice-mcp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +243 -0
- package/dist/index.js +21600 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Patrick Gebhardt
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# freshservice-mcp
|
|
2
|
+
|
|
3
|
+
[](LICENSE)
|
|
4
|
+
[](https://nodejs.org)
|
|
5
|
+
|
|
6
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for [Freshservice](https://freshservice.com). Manage your ITSM tickets, conversations, and agents directly from any MCP-compatible AI client (Kiro, Claude Desktop, Cursor, etc.).
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- 📋 **List tickets** — powerful filter queries or built-in presets
|
|
11
|
+
- 🔍 **Get ticket details** — full description, stats, and metadata
|
|
12
|
+
- 💬 **Read conversations** — all replies and internal notes
|
|
13
|
+
- ✏️ **Create tickets** — with full field support
|
|
14
|
+
- 🔄 **Update tickets** — status, priority, assignment, tags
|
|
15
|
+
- 📝 **Add notes or replies** — private notes or public replies
|
|
16
|
+
- 👤 **Agent lookup** — get your own profile or search by email
|
|
17
|
+
- 🔒 **Read-only mode** — disable all write operations with one env var
|
|
18
|
+
|
|
19
|
+
## Quickstart
|
|
20
|
+
|
|
21
|
+
### 1. Get your Freshservice API key
|
|
22
|
+
|
|
23
|
+
Log into Freshservice → click your avatar (top right) → **Profile Settings** → copy **Your API Key**.
|
|
24
|
+
|
|
25
|
+
> ⚠️ Each user must use their own API key. Keys are tied to individual agent accounts — actions appear under that agent's name.
|
|
26
|
+
|
|
27
|
+
### 2. Configure your MCP client
|
|
28
|
+
|
|
29
|
+
Add this block to your client's MCP configuration:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"mcpServers": {
|
|
34
|
+
"freshservice": {
|
|
35
|
+
"command": "npx",
|
|
36
|
+
"args": ["-y", "freshservice-mcp"],
|
|
37
|
+
"env": {
|
|
38
|
+
"FRESHSERVICE_DOMAIN": "yourcompany.freshservice.com",
|
|
39
|
+
"FRESHSERVICE_API_KEY": "your-api-key-here"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Configuration file locations:**
|
|
47
|
+
|
|
48
|
+
| Client | File |
|
|
49
|
+
|--------|------|
|
|
50
|
+
| Kiro (global) | `~/.kiro/settings/mcp.json` |
|
|
51
|
+
| Kiro (workspace) | `.kiro/settings/mcp.json` |
|
|
52
|
+
| KiroCrew | `~/.kiro/settings/mcp.json`, then run `kirocrew setup --agent-only` |
|
|
53
|
+
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
54
|
+
| Cursor | `.cursor/mcp.json` or Cursor Settings |
|
|
55
|
+
|
|
56
|
+
### 3. Reload your client
|
|
57
|
+
|
|
58
|
+
Reconnect MCP servers (or reload the window). You should now have access to all Freshservice tools.
|
|
59
|
+
|
|
60
|
+
## Configuration
|
|
61
|
+
|
|
62
|
+
| Variable | Required | Description |
|
|
63
|
+
|----------|----------|-------------|
|
|
64
|
+
| `FRESHSERVICE_DOMAIN` | ✅ | Your Freshservice domain, e.g. `yourcompany.freshservice.com` |
|
|
65
|
+
| `FRESHSERVICE_API_KEY` | ✅ | Your personal API key from Profile Settings |
|
|
66
|
+
| `FRESHSERVICE_READONLY` | optional | Set to `"true"` to disable all write operations |
|
|
67
|
+
|
|
68
|
+
### Read-only mode
|
|
69
|
+
|
|
70
|
+
Set `FRESHSERVICE_READONLY` to `"true"` to prevent any modifications. In this mode, `create_ticket`, `update_ticket`, and `add_ticket_note` are not registered at all. Recommended for shared environments or autonomous agent setups against production instances.
|
|
71
|
+
|
|
72
|
+
## Available Tools
|
|
73
|
+
|
|
74
|
+
| Tool | Description |
|
|
75
|
+
|------|-------------|
|
|
76
|
+
| `list_tickets` | List tickets with filter query or built-in preset |
|
|
77
|
+
| `get_ticket` | Get full details of a single ticket |
|
|
78
|
+
| `get_ticket_comments` | Get all conversations for a ticket |
|
|
79
|
+
| `create_ticket` | Create a new ticket |
|
|
80
|
+
| `update_ticket` | Update ticket fields |
|
|
81
|
+
| `add_ticket_note` | Add a private note or public reply |
|
|
82
|
+
| `get_me` | Get the authenticated agent's profile |
|
|
83
|
+
| `list_agents` | List agents, optionally filter by email |
|
|
84
|
+
|
|
85
|
+
## Usage Examples
|
|
86
|
+
|
|
87
|
+
### Check your connection
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
Call get_me to verify the connection works.
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### List your open tickets
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Get my agent ID with get_me, then list all open and pending tickets assigned to me.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The agent will call `get_me` → `list_tickets` with `query: "agent_id:<id> AND (status:2 OR status:3)"`.
|
|
100
|
+
|
|
101
|
+
### Investigate a ticket
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
Show me ticket #12345 including all comments.
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Add an internal note
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
Add a private note to ticket #12345: "Root cause identified — fix scheduled for tonight."
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Create a ticket
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
Create a high-priority incident with subject "VPN not connecting" and assign to group 1234.
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Filter Query Syntax
|
|
120
|
+
|
|
121
|
+
The `list_tickets` tool accepts Freshservice's filter query language.
|
|
122
|
+
|
|
123
|
+
### Built-in presets (`filter` parameter)
|
|
124
|
+
|
|
125
|
+
| Preset | Description |
|
|
126
|
+
|--------|-------------|
|
|
127
|
+
| `new_and_my_open` | New tickets + tickets assigned to you |
|
|
128
|
+
| `watching` | Tickets you are watching |
|
|
129
|
+
| `spam` | Spam tickets |
|
|
130
|
+
| `deleted` | Deleted tickets |
|
|
131
|
+
|
|
132
|
+
### Custom queries (`query` parameter)
|
|
133
|
+
|
|
134
|
+
Fields can be combined with `AND` / `OR`:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
agent_id:123 → assigned to specific agent
|
|
138
|
+
status:2 → open tickets
|
|
139
|
+
status:2 OR status:3 → open or pending
|
|
140
|
+
agent_id:123 AND status:2 → open tickets assigned to agent 123
|
|
141
|
+
priority:3 → high priority
|
|
142
|
+
group_id:456 → assigned to group 456
|
|
143
|
+
created_at:>'2024-01-01' → created after date
|
|
144
|
+
due_by:<'2024-12-31' → due before date
|
|
145
|
+
tag:'production' → tagged with "production"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Status codes
|
|
149
|
+
|
|
150
|
+
| Code | Status |
|
|
151
|
+
|------|--------|
|
|
152
|
+
| 2 | Open |
|
|
153
|
+
| 3 | Pending |
|
|
154
|
+
| 4 | Resolved |
|
|
155
|
+
| 5 | Closed |
|
|
156
|
+
|
|
157
|
+
### Priority codes
|
|
158
|
+
|
|
159
|
+
| Code | Priority |
|
|
160
|
+
|------|----------|
|
|
161
|
+
| 1 | Low |
|
|
162
|
+
| 2 | Medium |
|
|
163
|
+
| 3 | High |
|
|
164
|
+
| 4 | Urgent |
|
|
165
|
+
|
|
166
|
+
## Notes vs Replies
|
|
167
|
+
|
|
168
|
+
The `add_ticket_note` tool has two modes controlled by the `private` parameter:
|
|
169
|
+
|
|
170
|
+
- `private: true` (default) → **Internal note**, only visible to agents
|
|
171
|
+
- `private: false` → **Public reply**, sent to the requester by email
|
|
172
|
+
|
|
173
|
+
## Creating Tickets
|
|
174
|
+
|
|
175
|
+
Minimum required fields:
|
|
176
|
+
- `subject` (required)
|
|
177
|
+
- `email` OR `requester_id` (one of these required)
|
|
178
|
+
|
|
179
|
+
Useful optional fields:
|
|
180
|
+
- `priority` (1–4)
|
|
181
|
+
- `status` (default: 2 = Open)
|
|
182
|
+
- `type` (e.g. `"Incident"`, `"Service Request"`)
|
|
183
|
+
- `group_id` — route to a team
|
|
184
|
+
- `responder_id` — assign directly to an agent
|
|
185
|
+
- `tags` — categorization
|
|
186
|
+
|
|
187
|
+
## Local Development
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
git clone https://github.com/fairgentur/freshservice-mcp.git
|
|
191
|
+
cd freshservice-mcp
|
|
192
|
+
npm install
|
|
193
|
+
npm run build
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Then point your MCP client at the local build:
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"mcpServers": {
|
|
201
|
+
"freshservice": {
|
|
202
|
+
"command": "node",
|
|
203
|
+
"args": ["/absolute/path/to/freshservice-mcp/dist/index.js"],
|
|
204
|
+
"env": {
|
|
205
|
+
"FRESHSERVICE_DOMAIN": "yourcompany.freshservice.com",
|
|
206
|
+
"FRESHSERVICE_API_KEY": "your-api-key-here"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
> **Note:** `dist/index.js` is a self-contained esbuild bundle with all dependencies inlined. No `npm install` needed at runtime — just Node.js 18+.
|
|
214
|
+
|
|
215
|
+
### Standalone file deployment
|
|
216
|
+
|
|
217
|
+
If you don't want to clone the repo, just grab `dist/index.js` — it's a single 750KB file that runs standalone with `node`. No package manager required.
|
|
218
|
+
|
|
219
|
+
## Troubleshooting
|
|
220
|
+
|
|
221
|
+
### Server won't start
|
|
222
|
+
|
|
223
|
+
1. Verify Node.js 18+: `node --version`
|
|
224
|
+
2. Check environment variables are set correctly
|
|
225
|
+
3. Test manually: `FRESHSERVICE_DOMAIN=yourcompany.freshservice.com FRESHSERVICE_API_KEY=yourkey node dist/index.js`
|
|
226
|
+
|
|
227
|
+
### Authentication errors (401)
|
|
228
|
+
|
|
229
|
+
- Verify the domain — should be `yourcompany.freshservice.com` without `https://`
|
|
230
|
+
- Regenerate your API key in Freshservice Profile Settings
|
|
231
|
+
- API keys use HTTP Basic Auth (`key:X` base64-encoded)
|
|
232
|
+
|
|
233
|
+
### Filter queries return 500
|
|
234
|
+
|
|
235
|
+
Freshservice requires filter queries wrapped in double quotes internally. The server handles this automatically — do **not** add quotes around your query string yourself.
|
|
236
|
+
|
|
237
|
+
## Contributing
|
|
238
|
+
|
|
239
|
+
Pull requests welcome. For major changes, please open an issue first.
|
|
240
|
+
|
|
241
|
+
## License
|
|
242
|
+
|
|
243
|
+
[MIT](LICENSE)
|