The Jamf AI Agent is an intelligent assistant that uses natural language processing to interact with the Jamf MCP server. It can understand complex requests, plan multi-step operations, and execute them autonomously while ensuring safety and compliance.
# Set required environment variables
export JAMF_URL="https://your-instance.jamfcloud.com"
export JAMF_CLIENT_ID="your-client-id"
export JAMF_CLIENT_SECRET="your-client-secret"
export OPENAI_API_KEY="your-openai-api-key"
# Run the agent CLI
npm run agent
# Or run the example
npm run agent:exampleThe agent is built with a modular architecture:
- Core: Agent orchestration, configuration, context management, and task execution
- AI Integration: Support for multiple AI providers (OpenAI, Anthropic, local models)
- MCP Communication: Client wrapper for communicating with the Jamf MCP server
- Task Management: Planning, validation, and execution of multi-step tasks
- Safety & Compliance: Rules engine, audit logging, and confirmation handling
- Interfaces: CLI, REST API, and WebSocket for different interaction modes
See src/agent/README.md for detailed documentation.
src/: TypeScript source. Key entries:index-main.ts(CLI/server),index.ts(MCP server),tools/,resources/,prompts/,utils/.src/agent/: AI Agent modules for natural language interaction with Jamf MCP server.src/__tests__/: Jest tests (unit, integration, fixtures, helpers).dist/: Build output (generated). Binary:dist/index-main.jsexposed asjamf-mcp-server.docs/: Feature and error-handling docs.examples/: sample flows.
npm run dev: Start MCP server from TS (tsx src/index-main.ts).npm run dev:enhanced: Dev mode withJAMF_USE_ENHANCED_MODE=true.npm run build: Type-check and compile todist/.npm run serve: Run compiled server (node dist/index-main.js).npm run inspector: Launch MCP Inspector ondist/index-main.js.npm test/npm run test:watch/npm run test:coverage: Run Jest tests and coverage.npm run lint/npm run lint:fix: Lint TypeScript sources.
- Language: TypeScript (ESM, NodeNext, strict). Keep types explicit; avoid
any. - Indentation: 2 spaces; max 120 cols recommended.
- Filenames: kebab-case (
jamf-client-unified.ts), tests suffixed with.test.ts. - Linting: ESLint with
@typescript-eslint. Addressno-unused-vars(prefix unused with_), keepconsoletowarn/error.
- Framework: Jest via
ts-jest(ESM). Tests live undersrc/__tests__/and end with.test.ts. - Coverage thresholds: branches 70%, functions/lines/statements 80% (see
jest.config.js). - Use fixtures/helpers in
src/__tests__/fixturesandsrc/__tests__/helpers. - Commands:
npm testfor CI parity,npm run test:coveragebefore PR.
- Branch from
main; follow GitHub Flow. - Use Conventional Commit prefixes where possible:
feat:,fix:,docs:,test:,chore:(matches history). - PRs must: include a clear description, link issues, add/update tests, pass CI, and satisfy linting. Update docs/README when adding tools, env vars, or APIs.
- Never commit secrets. Copy
.env.exampleto.envfor local dev. - Key env vars:
JAMF_URL,JAMF_CLIENT_ID,JAMF_CLIENT_SECRET,JAMF_READ_ONLY,JAMF_USE_ENHANCED_MODE,JAMF_DEBUG_MODE. - Prefer read-only mode (
JAMF_READ_ONLY=true) when testing write actions.