Build a custom AI application
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.
Before you start
Make sure you have enabled both Holistics AI and the MCP Server.
If you don't have admin access, ask your workspace admin to do this.
Add Holistics MCP to your app
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 data center's MCP address and <YOUR_HOLISTICS_API_KEY> with your API key.