{"id":18538,"library":"mcpcat-api","title":"MCPCat API TypeScript SDK","description":"MCPCat API is a TypeScript/JavaScript SDK for interacting with the MCPCat service. Version 0.1.8 provides a generated client using the Fetch API, supporting both Node.js and browser environments. It compiles to ES5/ES6 and works with CommonJS or ES module systems, with built-in TypeScript definitions. The SDK is generated from OpenAPI specs and is in early development with a focus on type safety and REST API integration.","status":"active","version":"0.1.8","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install mcpcat-api","lang":"bash","label":"npm"},{"cmd":"yarn add mcpcat-api","lang":"bash","label":"yarn"},{"cmd":"pnpm add mcpcat-api","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default import recommended for ESM. CommonJS also supported via require.","wrong":"const MCPCatApi = require('mcpcat-api');","symbol":"default import","correct":"import MCPCatApi from 'mcpcat-api';"},{"note":"Named export for the main client class.","wrong":"const ApiClient = require('mcpcat-api').ApiClient;","symbol":"ApiClient","correct":"import { ApiClient } from 'mcpcat-api';"},{"note":"Configuration is a named export, not default.","wrong":"import Configuration from 'mcpcat-api/Configuration';","symbol":"Configuration","correct":"import { Configuration } from 'mcpcat-api';"}],"quickstart":{"code":"import MCPCatApi from 'mcpcat-api';\n\nconst api = new MCPCatApi({\n  basePath: 'https://api.mcpcat.com',\n  apiKey: process.env.MCPCAT_API_KEY ?? ''\n});\n\nasync function getModels() {\n  try {\n    const response = await api.listModels();\n    console.log(response.data);\n  } catch (error) {\n    console.error('Error:', error);\n  }\n}\n\ngetModels();","lang":"typescript","description":"Initializes the MCPCat API client with base URL and API key, then fetches a list of models."},"warnings":[{"fix":"Use Node.js 18+ or polyfill global fetch.","message":"The SDK uses fetch, which is not available in older Node.js versions (<18).","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Replace 'baseUri' with 'basePath' in the configuration object.","message":"The constructor option 'baseUri' is deprecated; use 'basePath' instead.","severity":"deprecated","affected_versions":"0.1.5"},{"fix":"Ensure apiKey is a string, e.g., from environment variables.","message":"API key must be a string; passing a non-string will cause a runtime error.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Upgrade to Node.js 18+ or install a fetch polyfill like 'node-fetch'.","cause":"The SDK requires the fetch API, which is missing in Node.js versions before 18.","error":"TypeError: fetch is not defined"},{"fix":"Pass an apiKey property when creating a new MCPCatApi instance.","cause":"The SDK configuration requires an API key for authentication.","error":"Error: Configuration must include 'apiKey'"},{"fix":"Wrap API calls in try-catch blocks to handle errors.","cause":"The response may be undefined if an error occurs and is not caught.","error":"Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'data')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}