Integrations
Custom agents
Call GAAP MCP from your own code, over plain HTTP or with an MCP SDK.
Tested by Precedera. The HTTP example below was run against the server as written.
GAAP MCP is stateless. Each request is one HTTP POST to the server URL carrying one JSON-RPC message, so you do not need to open a session first. Send these headers:
| Header | Value |
|---|---|
Content-Type |
application/json |
Accept |
application/json, text/event-stream |
MCP-Protocol-Version |
A protocol version your code supports, for example 2025-06-18 |
X-API-Key or Authorization |
Your API key, as <key> or Bearer <key>. Omit it on the free-sample endpoint. |
Plain HTTP (JavaScript)
const MCP_URL = "https://mcp.precedera.com/mcp";
const API_KEY = process.env.PRECEDERA_API_KEY;
async function callTool(name, args) {
const res = await fetch(MCP_URL, {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json, text/event-stream",
"MCP-Protocol-Version": "2025-06-18",
"X-API-Key": API_KEY,
},
body: JSON.stringify({ jsonrpc: "2.0", id: Date.now(), method: "tools/call", params: { name, arguments: args } }),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
// The reply is JSON, or a server-sent event whose data line holds the JSON.
const raw = await res.text();
const data = raw.split("\n").filter((l) => l.startsWith("data:")).map((l) => l.slice(5)).pop() ?? raw;
const message = JSON.parse(data);
if (message.error) throw new Error(message.error.message);
return message.result; // { content: [{ type: "text", text }], structuredContent, isError }
}
const search = await callTool("search_guidance", { query: "loss contingency range of loss no best estimate" });
const ids = search.structuredContent.shortlist.slice(0, 2).map((c) => c.id);
const entries = await callTool("get_entries", { ids });
for (const e of entries.structuredContent.entries) console.log(e.id, "-", e.title);
In a real agent, let the model choose which IDs to fetch from the shortlist titles, rather than taking the top results.
With an MCP SDK
The official MCP SDKs connect with their streamable HTTP client transport. Point the transport at https://mcp.precedera.com/mcp and pass your API key as a request header, or use the SDK’s OAuth support. Then call tools/list and tools/call as usual.
Using results
content[0].textis written for a model to read. Pass it to your model as the tool result.structuredContentholds the same information as JSON for your code. See Responses.- Check
isError. A tool-level problem, such as invalid input, a rate limit or paid access needed, comes back as a normal result withisError: trueand an explanation. See Errors.