Build a Custom Agent with the Paprel-Hosted MCP Server
Paprel already hosts the MCP server. ChatGPT, Claude, Cursor, and other compatible clients can connect directly using the company-specific URL available at Settings > App Connect > MCP Server.
You need custom code only when you are building your own agent application. That application connects to the same Paprel-hosted Streamable HTTP endpoint and receives only the tools allowed by the company's connection scope.
Choose the path that matches your use case
| Goal | What to do |
|---|---|
| Use Paprel from ChatGPT, Claude, Cursor, or another MCP client | Add the company-specific Paprel connection URL in that client's MCP connection flow. No server repository or deployment is needed. |
| Build a custom finance copilot or workflow agent | Use an agent SDK as the MCP client and connect it to the Paprel URL with a scoped token. |
| Allow an agent to prepare accounting work | Create a separate least-privilege connection, keep supported actions in draft, and add explicit human approval. |
TypeScript example
The runnable example is maintained in examples/paprel-mcp-agent in the Paprel website repository. It uses the OpenAI Agents SDK as one example client; Paprel's endpoint is standard Streamable HTTP MCP and is not tied to that SDK.
import { Agent, MCPServerStreamableHttp, run } from "@openai/agents";
const paprel = new MCPServerStreamableHttp({
name: "Paprel Accounting",
url: process.env.PAPREL_MCP_URL!,
requestInit: {
headers: { Authorization: `Bearer ${process.env.PAPREL_MCP_TOKEN}` },
},
});
const agent = new Agent({
name: "Paprel finance analyst",
instructions: "Use Paprel reports as the system of record. Do not change accounting records.",
mcpServers: [paprel],
});
await paprel.connect();
try {
const result = await run(agent, "Summarize the current financial position.");
console.log(result.finalOutput);
} finally {
await paprel.close();
}
Authorization is the real safety boundary
A prompt saying “read only” is useful but is not access control. Start with a Paprel token whose scope permits only the reports and records the custom agent needs to inspect.
If a workflow later needs draft creation:
- issue a separate connection with the smallest required scope;
- expose only the relevant draft tools;
- require a person to approve the tool call or review the resulting draft;
- keep posting, sending, matching, and irreversible transitions outside autonomous execution;
- retain Paprel's actor attribution and activity history.
Connection values
- Copy the MCP URL from the connected company's Paprel settings. Do not construct or probe connection URLs.
- Treat the scoped token as a secret and keep it server-side.
- Use a distinct connection per environment and permission profile.
- Rotate the token when an agent, operator, or deployment no longer needs access.
For the current product surface and screenshots, read Paprel MCP for AI agents. For the broader authorization model, read Authentication and tenant-scoped tokens.