Skip to main content
Glama
AtlassianBaseService.ts1.84 kB
import axios, { AxiosInstance, AxiosRequestConfig } from 'axios'; import dotenv from 'dotenv'; dotenv.config(); export default abstract class AtlassianBaseService { protected client: AxiosInstance; protected baseUrl: string; constructor(baseUrl: string) { this.baseUrl = baseUrl; this.client = axios.create({ baseURL: baseUrl, auth: { username: process.env.ATLASSIAN_EMAIL || '', password: process.env.ATLASSIAN_API_TOKEN || '', }, headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', }, }); // Add request interceptor for logging this.client.interceptors.request.use((config) => { console.log(`Making ${config.method?.toUpperCase()} request to ${config.baseURL}${config.url}`); return config; }); // Add response interceptor for error handling this.client.interceptors.response.use( (response) => response, (error) => { console.error('API Error:', error.response?.data || error.message); return Promise.reject(error); } ); } protected async get<T>(url: string, config?: AxiosRequestConfig): Promise<T> { const response = await this.client.get<T>(url, config); return response.data; } protected async post<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T> { const response = await this.client.post<T>(url, data, config); return response.data; } protected async put<T>(url: string, data?: any, config?: AxiosRequestConfig): Promise<T> { const response = await this.client.put<T>(url, data, config); return response.data; } protected async delete<T>(url: string, config?: AxiosRequestConfig): Promise<T> { const response = await this.client.delete<T>(url, config); return response.data; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/solidus-/atlassian-cursor-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server