@aashari/mcp-server-atlassian-jira
Version:
Node.js/TypeScript MCP server for Atlassian Jira. Equips AI systems (LLMs) with tools to list/get projects, search/get issues (using JQL/ID), and view dev info (commits, PRs). Connects AI capabilities directly into Jira project management and issue tracki
106 lines (105 loc) • 4.06 kB
TypeScript
import { AtlassianCredentials, TransportResponse } from '../utils/transport.util.js';
/**
* Supported HTTP methods for API requests
*/
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
/**
* Request options for API calls
*/
export interface ApiRequestOptions {
method?: HttpMethod;
queryParams?: Record<string, string>;
body?: Record<string, unknown>;
}
/**
* Validates and returns Atlassian credentials
* @throws {McpError} If credentials are missing
* @returns {AtlassianCredentials} Valid credentials
*/
export declare function validateCredentials(): AtlassianCredentials;
/**
* Normalizes the API path by ensuring it starts with /
* @param path - The raw path provided by the user
* @returns Normalized path
*/
export declare function normalizePath(path: string): string;
/**
* Appends query parameters to a path
* @param path - The base path
* @param queryParams - Optional query parameters
* @returns Path with query string appended
*/
export declare function appendQueryParams(path: string, queryParams?: Record<string, string>): string;
/**
* Makes a generic API request to the Jira API
*
* @param path - API endpoint path (e.g., '/rest/api/3/project')
* @param options - Request options including method, queryParams, and body
* @returns Promise resolving to the raw API response
* @throws {McpError} If credentials are missing or API request fails
*
* @example
* // GET request
* const projects = await request('/rest/api/3/project', {
* method: 'GET',
* queryParams: { maxResults: '10' }
* });
*
* @example
* // POST request
* const issue = await request('/rest/api/3/issue', {
* method: 'POST',
* body: { fields: { project: { key: 'PROJ' }, summary: 'New Issue', ... } }
* });
*/
export declare function request<T = unknown>(path: string, options?: ApiRequestOptions): Promise<TransportResponse<T>>;
/**
* Makes a GET request to the Jira API
* @param path - API endpoint path
* @param queryParams - Optional query parameters
* @returns Promise resolving to the API response with rawResponsePath
*/
export declare function get<T = unknown>(path: string, queryParams?: Record<string, string>): Promise<TransportResponse<T>>;
/**
* Makes a POST request to the Jira API
* @param path - API endpoint path
* @param body - Request body
* @param queryParams - Optional query parameters
* @returns Promise resolving to the API response with rawResponsePath
*/
export declare function post<T = unknown>(path: string, body?: Record<string, unknown>, queryParams?: Record<string, string>): Promise<TransportResponse<T>>;
/**
* Makes a PUT request to the Jira API
* @param path - API endpoint path
* @param body - Request body
* @param queryParams - Optional query parameters
* @returns Promise resolving to the API response with rawResponsePath
*/
export declare function put<T = unknown>(path: string, body?: Record<string, unknown>, queryParams?: Record<string, string>): Promise<TransportResponse<T>>;
/**
* Makes a PATCH request to the Jira API
* @param path - API endpoint path
* @param body - Request body
* @param queryParams - Optional query parameters
* @returns Promise resolving to the API response with rawResponsePath
*/
export declare function patch<T = unknown>(path: string, body?: Record<string, unknown>, queryParams?: Record<string, string>): Promise<TransportResponse<T>>;
/**
* Makes a DELETE request to the Jira API
* @param path - API endpoint path
* @param queryParams - Optional query parameters
* @returns Promise resolving to the API response with rawResponsePath
*/
export declare function del<T = unknown>(path: string, queryParams?: Record<string, string>): Promise<TransportResponse<T>>;
declare const _default: {
request: typeof request;
get: typeof get;
post: typeof post;
put: typeof put;
patch: typeof patch;
del: typeof del;
validateCredentials: typeof validateCredentials;
normalizePath: typeof normalizePath;
appendQueryParams: typeof appendQueryParams;
};
export default _default;