Skip to main content
Glama
README.md
# PDQ Connect MCP Server

A Model Context Protocol (MCP) server that provides tools for interacting with the PDQ Connect API. This server enables Claude and other MCP clients to manage devices, groups, packages, and deployments through PDQ Connect.

## Features

- **Device Management**: List and retrieve detailed device information with filtering, sorting, and pagination
- **Group Management**: List and filter device groups
- **Package Management**: Browse available packages and retrieve package details
- **Deployment Operations**: Deploy packages to target devices or groups
- **Advanced Filtering**: Support for string operators (starts with, contains, ends with), datetime comparisons, integer comparisons, and boolean filters
- **Pagination**: Handle large datasets with configurable page sizes (up to 100 per page)
- **Flexible Includes**: Retrieve nested device data (disks, drivers, features, networking, processors, updates, software, Active Directory information)

## Prerequisites

- Node.js 18.0.0 or higher
- PDQ Connect API bearer token (obtain from https://app.pdq.com)

## Installation

1. Clone or download this repository
2. Navigate to the project directory
3. Install dependencies:

```bash
npm install
```

4. Build the TypeScript code:

```bash
npm run build
```

## Configuration

### Environment Variables

Create a `.env` file in the project root or set environment variables:

```
PDQ_API_TOKEN=your_bearer_token_here
```

### Claude Desktop Configuration

Add the server to your Claude Desktop configuration file:

**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Linux**: `~/.config/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "pdq-connect": {
      "command": "node",
      "args": ["/path/to/pdq-connect-mcp/dist/index.js"],
      "env": {
        "PDQ_API_TOKEN": "your_bearer_token_here"
      }
    }
  }
}
```

**Note:** Replace `/path/to/pdq-connect-mcp` with the actual path to your installation:
- **Windows**: Use backslashes, e.g., `C:\\Users\\YourName\\mcp\\pdq-connect-mcp\\dist\\index.js`
- **macOS/Linux**: Use forward slashes, e.g., `/home/username/mcp/pdq-connect-mcp/dist/index.js` or `~/mcp/pdq-connect-mcp/dist/index.js`

### VS Code MCP Extension Configuration

Create or update `.vscode/mcp.json`:

```json
{
  "servers": {
    "pdq-connect": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/pdq-connect-mcp/dist/index.js"],
      "env": {
        "PDQ_API_TOKEN": "your_bearer_token_here"
      }
    }
  }
}
```

**Note:** Replace `/path/to/pdq-connect-mcp` with your actual installation path (see note above for platform-specific formats).

## Available Tools

### 1. pdq_list_devices

List devices from PDQ Connect with optional filtering, sorting, pagination, and includes.

**Parameters:**
- `includes` (optional): Comma-separated list of nested data to include (disks, drivers, features, networking, processors, updates, software, activeDirectory, activeDirectoryGroups, customFields)
- `group` (optional): Filter by group ID
- `pageSize` (optional): Page size (1-100, default: 100)
- `page` (optional): Page number (default: 1)
- `sort` (optional): Sort field in camelCase with optional "Desc" suffix (e.g., "insertedAt", "nameDesc")
- `filter` (optional): Object with filter criteria

**Filter Examples:**
```json
{
  "filter": {
    "name": "^WIN",              // Starts with "WIN"
    "manufacturer": "~Dell",      // Contains "Dell"
    "os": "Windows 11$",          // Ends with "Windows 11"
    "memory": ">8589934592",      // Greater than 8GB
    "requireReboot": "true"       // Boolean exact match
  }
}
```

### 2. pdq_get_device

Get detailed information about a specific device by ID.

**Parameters:**
- `device_id` (required): The unique device ID

### 3. pdq_list_groups

List device groups with optional filtering, sorting, and pagination.

**Parameters:**
- `pageSize` (optional): Page size (1-100, default: 100)
- `page` (optional): Page number (default: 1)
- `sort` (optional): Sort field in camelCase
- `filter` (optional): Filter object (id, name, source, type)

### 4. pdq_list_packages

List available packages with optional filtering, sorting, and pagination.

**Parameters:**
- `pageSize` (optional): Page size (1-100, default: 100)
- `page` (optional): Page number (default: 1)
- `sort` (optional): Sort field in camelCase
- `filter` (optional): Filter object (name, publisher, source)

### 5. pdq_get_package

Get detailed information about a specific package by ID, including recent versions.

**Parameters:**
- `package_id` (required): The unique package ID

### 6. pdq_deploy_package

Deploy a package version to target devices or groups.

**Parameters:**
- `package` (required): Package ID or Package Version ID
- `targets` (required): Comma-delimited Device IDs or Group IDs (e.g., "device-1,device-2")

**Note**: This is a write operation that initiates an actual deployment.

## Filter Operators

### String Filters
- No prefix: Exact match
- `^`: Starts with (e.g., `"^WIN"` matches "Windows", "WIN-PC")
- `~`: Contains (e.g., `"~Dell"` matches "Dell Inc.", "Dell Computer")
- `$`: Ends with (e.g., `"11$"` matches "Windows 11")

### Datetime Filters
- No prefix: Exact match (ISO 8601 format)
- `<`: Before (e.g., `"<2024-01-01T00:00:00.000000Z"`)
- `>`: After (e.g., `">2024-01-01T00:00:00.000000Z"`)

### Integer Filters
- No prefix: Exact match
- `<`: Less than
- `>`: Greater than
- `<=`: Less than or equal
- `>=`: Greater than or equal

### Boolean Filters
- `"true"` or `"false"` (strings)

## Valid Filter Fields

### Devices
- **String fields**: architecture, biosAssetTag, biosManufacturer, biosVersion, chassis, currentUser, dotNetVersions, family, hostname, lastUser, lastUserShortName, macAddress, manufacturer, model, name, os, osFullName, osProductType, osVersion, powershellVersion, publicIpAddress, serialNumber, servicePack, sku, systemVersion, timezone
- **Datetime fields**: insertedAt, lastBootUpTime, osInstallDate, updatedAt
- **Integer fields**: freePercent, memory
- **Boolean fields**: requireReboot, smbVersionOne

### Groups
- **String fields**: id, name, source, type
- **Datetime fields**: insertedAt

### Packages
- **String fields**: name, publisher, source

## Usage Examples

### Example 1: List all Windows 11 devices
```
List all devices running Windows 11 with their disk information
```

Claude will call:
```json
{
  "tool": "pdq_list_devices",
  "arguments": {
    "filter": { "os": "~Windows 11" },
    "includes": "disks"
  }
}
```

### Example 2: Get specific device details
```
Show me details for device ID abc-123
```

Claude will call:
```json
{
  "tool": "pdq_get_device",
  "arguments": {
    "device_id": "abc-123"
  }
}
```

### Example 3: Find Dell devices that need reboot
```
Find all Dell devices that require a reboot
```

Claude will call:
```json
{
  "tool": "pdq_list_devices",
  "arguments": {
    "filter": {
      "manufacturer": "~Dell",
      "requireReboot": "true"
    }
  }
}
```

### Example 4: Deploy a package to a group
```
Deploy package pkg-456 to group grp-789
```

Claude will call:
```json
{
  "tool": "pdq_deploy_package",
  "arguments": {
    "package": "pkg-456",
    "targets": "grp-789"
  }
}
```

## Development

### Build
```bash
npm run build
```

### Watch mode (auto-rebuild on changes)
```bash
npm run watch
```

### Run directly
```bash
npm start
```

## Troubleshooting

### Error: "PDQ_API_TOKEN environment variable is not set"
- Ensure you've set the `PDQ_API_TOKEN` in your environment or `.env` file
- Verify the token is not empty or contains only whitespace

### Error: "Authentication failed"
- Check that your bearer token is valid
- Verify you have access to the PDQ Connect API
- Try generating a new token from https://app.pdq.com

### Error: "Resource not found"
- Verify the device/package/group ID exists
- Check for typos in the ID

### Error: "Invalid parameters provided"
- Review the filter field names and operators
- Ensure filter values match the expected types
- Check pagination limits (max pageSize: 100)

### Server not appearing in Claude Desktop
- Restart Claude Desktop after updating the config
- Check the config file path is correct for your OS
- Verify the path to `dist/index.js` is absolute and correct
- Check Claude Desktop logs for errors

## API Reference

This MCP server implements the PDQ Connect API v1:
- Base URL: `https://app.pdq.com`
- API Documentation: https://app.pdq.com/api/docs

## Security Notes

- Never commit your `.env` file or expose your API token
- The bearer token provides full access to your PDQ Connect organization
- Use caution with deployment operations as they affect production systems
- Consider using read-only tokens if available for safer operations

## License

MIT

## Contributing

Contributions are welcome! Please ensure:
- TypeScript code compiles without errors
- All tools follow the established pattern
- Documentation is updated for new features
- Error handling is comprehensive

## Support

For issues with:
- **This MCP server**: Open an issue in the repository
- **PDQ Connect API**: Contact PDQ support
- **MCP protocol**: See https://modelcontextprotocol.io

TDQS

A3.5/5.0

Scored across 6 tools

Disambiguation5/5

Each tool targets a distinct resource+action pair: list vs get on devices and packages, listing groups, and a single clearly-labeled write operation (deploy_package). The descriptions explicitly call out that deploy_package is a write operation, leaving no ambiguity about side effects. No two tools could reasonably be confused for one another.

Naming Consistency5/5

All six tools follow an identical pdq_<verb>_<noun> pattern (pdq_get_device, pdq_list_devices, pdq_deploy_package), with consistent snake_case and verb-first ordering. The prefix cleanly namespaces the server's domain.

Tool Count4/5

Six tools is a tight, well-scoped surface for a device/package management server, with each tool earning its place. It's slightly thin given the domain's breadth, but nothing feels padded or redundant.

Completeness3/5

Read coverage is solid (devices, groups, packages) plus one write action, but there are notable gaps: no get_group to pair with list_groups, no deployment status/list_deployments tool, and no way to cancel or monitor a deployment. An agent that initiates a deployment has no tool to verify its outcome, which is a real dead end.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues