@zxkane/quip-mcp-server
Version:
MCP server for interacting with Quip spreadsheets
73 lines (72 loc) • 2.7 kB
TypeScript
/**
* Simple Quip API client implementation for the MCP server
*/
export declare class QuipClient {
private accessToken;
private baseUrl;
private axiosInstance;
/**
* Initialize the Quip client with the given access token and base URL
*
* @param accessToken Quip API access token
* @param baseUrl Base URL for the Quip API (default: https://platform.quip.com)
*/
constructor(accessToken: string, baseUrl?: string);
/**
* Get a thread by ID
*
* @param threadId ID of the thread to retrieve
* @returns Promise resolving to thread information
* @throws Error if the request fails
*/
getThread(threadId: string): Promise<Record<string, any>>;
/**
* Export a thread to XLSX format and save it locally
*
* @param threadId ID of the thread to export
* @param outputPath Local file path where the XLSX file should be saved
* @returns Promise resolving to path to the saved XLSX file
* @throws Error if the request fails
*/
exportThreadToXLSX(threadId: string, outputPath: string): Promise<string>;
/**
* Export a thread to CSV format using HTML parsing as fallback method
*
* @param threadId ID of the thread to export
* @param sheetName Name of the sheet to extract (optional)
* @returns Promise resolving to CSV data as string
* @throws Error if the thread is not found or does not contain a spreadsheet
*/
exportThreadToCSVFallback(threadId: string, sheetName?: string): Promise<string>;
/**
* Check if a thread is a spreadsheet
*
* @param threadId ID of the thread to check
* @returns Promise resolving to true if the thread is a spreadsheet, false otherwise
*/
isSpreadsheet(threadId: string): Promise<boolean>;
}
/**
* Find a spreadsheet with the given name in the document HTML
*
* @param documentHtml HTML content of the document
* @param sheetName Name of the sheet to find (optional)
* @returns Cheerio element or null if not found
*/
export declare function findSheetByName(documentHtml: string, sheetName?: string): any;
/**
* Extract data from a sheet element
*
* @param sheet Cheerio element
* @returns Array of rows, where each row is an array of cell values
*/
export declare function extractSheetData(sheet: any): string[][];
/**
* Convert XLSX file to CSV format, optionally extracting a specific sheet
*
* @param xlsxPath Path to the XLSX file
* @param sheetName Name of the sheet to extract (optional)
* @returns CSV data as string
* @throws Error if the sheet is not found
*/
export declare function convertXLSXToCSV(xlsxPath: string, sheetName?: string): string;