UNPKG

roundhr-mcp-server

Version:

MCP server for RoundHR database tools

29 lines (28 loc) 825 B
import axios from "axios"; export class RoundApiCoreClient { constructor() { this.baseUrl = "https://api-prod.roundhr.com"; this.config = null; } initialize(config) { this.config = config; } getHeaders(contentType = "application/json") { if (!this.config) throw new Error("ApiCoreClient is not initialized."); return { headers: { "X-API-KEY": this.config.apiKey, "Content-Type": contentType, }, }; } async get(url, params) { const response = await axios.get(url, { params, ...this.getHeaders() }); return response.data; } async post(url, data) { const response = await axios.post(url, data, this.getHeaders()); return response.data; } }