Custom AI app
If you're building an AI application with the OpenAI API, you can add Holistics as an MCP tool so your app can query data and run analytics as part of its workflow.
Include the Holistics MCP server in your tool list when calling the OpenAI Responses API:
import OpenAI from "openai";
import type { ResponseInput } from 'openai/resources/responses/responses';
const client = new OpenAI({
apiKey: "<YOUR_OPENAI_KEY>",
});
async function chat(input: ResponseInput) {
const completion = await client.responses.create({
model: "gpt-4.1",
input: input,
tools: [
{
type: "web_search",
},
{
type: "mcp",
server_label: "holistics_mcp",
server_url: "<MCP_SERVER_ADDRESS>",
server_description: "Holistics MCP to access my BI and business data",
headers: {
"X-Holistics-Key": "<YOUR_HOLISTICS_API_KEY>",
},
require_approval: "never",
},
],
tool_choice: "auto",
parallel_tool_calls: true,
});
console.log(completion.output_text);
}
Replace <MCP_SERVER_ADDRESS> with your connection URL and <YOUR_HOLISTICS_API_KEY> with your API key.