Skip to main content
Glama
nks-hub

NKS osTicket MCP

by nks-hub
README.md
# NKS osTicket MCP

A [Model Context Protocol](https://modelcontextprotocol.io/) server for
[osTicket](https://osticket.com/). It lets AI agents (Claude, etc.) list,
search, read, create, update, reply to and delete tickets, plus read stats,
manage parent/child subtickets and download attachments.

It talks to the companion
[NKS osTicket API plugin](https://github.com/nks-hub/nks-osticket-plugin),
which exposes a single JSON endpoint inside osTicket.

## Tools

| Tool | Purpose |
|---|---|
| `osticket_list_tickets` | List tickets (filter by status/department, paginated) |
| `osticket_search_tickets` | Full-text search by subject |
| `osticket_get_ticket` | One ticket with full message thread |
| `osticket_get_stats` | Total / open / closed / overdue counts |
| `osticket_list_statuses` | All ticket statuses |
| `osticket_create_ticket` | Create a ticket |
| `osticket_update_ticket` | Change status / due date / topic, add internal note |
| `osticket_reply_ticket` | Post a customer-facing reply (emailed) |
| `osticket_delete_ticket` | Delete a ticket (irreversible) |
| `osticket_link_subticket` | Link child under parent |
| `osticket_unlink_subticket` | Remove a child's parent link |
| `osticket_get_children` | List a parent's children |
| `osticket_get_parent` | Get a child's parent |
| `osticket_download_attachment` | Download an attachment (base64) |

## Requirements

- Node.js ≥ 18
- The NKS osTicket API plugin installed on your osTicket instance
- An osTicket API key (Admin → Manage → API Keys) with the permissions your
  tools need, bound to the source IP this server runs from

## Install

```bash
npm install
npm run build
```

## Configuration

Set via environment variables (see `.env.example`):

| Variable | Required | Default | Description |
|---|---|---|---|
| `NKS_OSTICKET_URL` | yes | – | URL of the API entry, `…/api/nks-osticket.php` |
| `NKS_OSTICKET_API_KEY` | yes | – | osTicket API key |
| `NKS_OSTICKET_TIMEOUT_MS` | no | `30000` | Request timeout |
| `NKS_OSTICKET_REJECT_UNAUTHORIZED` | no | `true` | `false` allows self-signed TLS |

## Use with Claude Code / Claude Desktop

Add to your MCP server configuration:

```json
{
  "mcpServers": {
    "osticket": {
      "command": "node",
      "args": ["/absolute/path/to/nks-osticket-mcp/dist/index.js"],
      "env": {
        "NKS_OSTICKET_URL": "https://support.example.com/api/nks-osticket.php",
        "NKS_OSTICKET_API_KEY": "your-api-key"
      }
    }
  }
}
```

## License

MIT — see [LICENSE](LICENSE).

TDQS

A3.7/5.0

Scored across 14 tools

Disambiguation5/5

Each tool targets a unique operation on tickets or related entities (attachments, parent-child relationships, statistics, statuses). There is no ambiguity between tools; even similar ones like get_ticket vs list_tickets vs search_tickets have clearly different purposes.

Naming Consistency5/5

All tools follow the pattern osticket_verb_noun with consistent snake_case. Verbs like create, delete, get, list, search, reply, update, link, unlink, and download are appropriately chosen and clearly convey the action.

Tool Count5/5

14 tools cover the essential ticket management operations (CRUD, parent-child, attachments, statistics, statuses) without being excessive. Each tool earns its place for a focused osTicket MCP server.

Completeness4/5

Core ticket lifecycle (create, read, update, delete), parent-child management, replying, searching, and statistics are covered. Minor gap: no tool for uploading attachments on ticket creation or replies, but the overall surface is thorough.

Maintenance

ActivitySlowing
ResponsivenessNo issues