nable-mcp-tools
v1.0.0
Published
A collection of bash scripts for interacting with the N-Able API, following the Mission Control Protocol (MCP) pattern
Maintainers
Readme
N-Able MCP Tools
A collection of bash scripts for interacting with the N-Able API, following the Mission Control Protocol (MCP) pattern.
Overview
This project provides a set of tools for managing and interacting with the N-Able API, including:
- Authentication handling with JWT tokens
- Token refresh and validation
- API client with error handling and retries
- Functions for working with devices, customers, and scheduled tasks
- Health checking utilities
- Dashboard for easy interaction
- Utilities for bulk operations and reporting
Installation
Clone this repository:
git clone https://github.com/yourusername/nable-mcp-tools.git cd nable-mcp-toolsRun the setup script:
./scripts/setup.sh --url https://your-ncentral-server.com --jwt your_jwt_token
Requirements
- bash (version 4 or higher)
- curl
- jq
Configuration
Configuration is stored in config/config.json:
api_base_url: Base URL of the N-Able APIapi_version: API versiontimeout: Request timeout in secondsretry_attempts: Number of retry attempts for failed requestslog_level: Logging level (debug, info, warn, error)
JWT token and authentication tokens are stored in config/credentials.json.
Usage
Dashboard
For an interactive experience, use the dashboard:
./scripts/dashboard.shThe dashboard provides a menu-based interface for common operations:
- Configure API settings
- Configure JWT token
- Authenticate with the API
- Check API health
- Work with devices, customers, and tasks
Authentication
Authenticate with the API:
./scripts/auth/authenticate.sh --jwt "your_jwt_token"Validate existing token:
./scripts/auth/authenticate.sh --validateForce re-authentication:
./scripts/auth/authenticate.sh --forceDevices
List all devices:
./scripts/examples/list-devices.shGet device by ID:
./scripts/examples/get-device.sh --id "device_id"Export devices to CSV:
./scripts/examples/export-devices.sh --output devices.csvCustomers
List all customers:
./scripts/examples/list-customers.shTasks
Create a direct support task:
./scripts/examples/create-task.sh --name "Test Task" --item-id 1 --customer-id 100 --device-id 1234567890 --param "CommandLine=echo Hello World"Create tasks for multiple devices:
./scripts/examples/bulk-task.sh --name "Test Task" --item-id 1 --customer-id 100 --filter "deviceClass=Workstations - Windows" --param "CommandLine=echo Hello World"Monitor a task:
./scripts/examples/monitor-task.sh --id "task_id"Monitor multiple tasks:
./scripts/examples/monitor-multiple-tasks.sh --ids "task_id1,task_id2"Export task execution report:
./scripts/examples/export-task-report.sh --id "task_id"API Health
Check API health:
./scripts/examples/check-health.shProject Structure
nable-mcp-tools/
├── config/ # Configuration files
│ ├── config.json # General configuration
│ └── credentials.json # Authentication credentials (gitignored)
├── scripts/ # Script files
│ ├── api/ # API client scripts
│ │ ├── api-client.sh # Base API client
│ │ ├── customers.sh # Customer-related API functions
│ │ ├── devices.sh # Device-related API functions
│ │ ├── health.sh # API health functions
│ │ └── tasks.sh # Task-related API functions
│ ├── auth/ # Authentication scripts
│ │ ├── authenticate.sh # Authentication script
│ │ └── token-manager.sh # Token management functions
│ ├── utils/ # Utility scripts
│ │ ├── config.sh # Configuration functions
│ │ ├── http.sh # HTTP functions
│ │ ├── json.sh # JSON parsing functions
│ │ └── logger.sh # Logging functions
│ ├── examples/ # Example scripts
│ │ ├── list-devices.sh # List devices
│ │ ├── get-device.sh # Get device by ID
│ │ ├── list-customers.sh # List customers
│ │ ├── create-task.sh # Create a task
│ │ ├── monitor-task.sh # Monitor a task
│ │ ├── check-health.sh # Check API health
│ │ ├── bulk-task.sh # Create tasks for multiple devices
│ │ ├── export-devices.sh # Export devices to CSV
│ │ ├── monitor-multiple-tasks.sh # Monitor multiple tasks
│ │ └── export-task-report.sh # Export task report to CSV
│ ├── dashboard.sh # Interactive dashboard
│ └── setup.sh # Initial setup script
├── README.md # This file
├── IMPLEMENTATION_REPORT.md # Implementation details
└── COMMIT_MESSAGE.txt # Git commit messageExtending the Tools
You can extend these tools by:
- Adding new API endpoint functions in the appropriate module
- Creating new utility scripts for common operations
- Adding new example scripts for specific use cases
License
MIT
