Skip to main content

Install

npm install agnost
pnpm add agnost
yarn add agnost

Integrate

Call trackMCP after creating your server, before connecting transport:
import { trackMCP } from 'agnost';

// your existing server setup...

trackMCP(server, 'your-org-id');
Get your org ID from app.agnost.ai.

Options

trackMCP(server, 'your-org-id', {
  disableInput: false,   // set true to skip tracking tool inputs
  disableOutput: false,  // set true to skip tracking tool outputs
  identify: (request, env) => ({
    userId: request?.headers?.['x-user-id'] || 'anonymous',
    email: request?.headers?.['x-user-email'],
  }),
});
Use a stable pseudonymous userId and non-sensitive traits. Avoid forwarding raw email, name, or other personal data unless your team has approved that data flow. If tool inputs or outputs may contain sensitive data, set disableInput or disableOutput to true, or redact before returning tool results. See Data Governance.

Checkpoints

Use checkpoint() inside tool handlers to get per-step latency breakdowns:
import { trackMCP, checkpoint } from 'agnost';

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  checkpoint('db_query_start');
  const rows = await db.query(/* ... */);
  checkpoint('db_query_done', { rowCount: rows.length });

  checkpoint('format_start');
  const result = format(rows);
  checkpoint('format_done');

  return result;
});

trackMCP(server, 'your-org-id');
Checkpoints appear as a timeline in your dashboard.

What appears in Agnost

  • Tools for MCP tool invocations.
  • Raw logs for every tracked call.
  • Checkpoint timeline for calls that use checkpoint().
  • Errors when a tool call fails.

Verify

Call one MCP tool from your client, then open app.agnost.ai. Check Raw logs first, then Tools.

Troubleshooting

  • Call trackMCP after creating your server and before connecting transport.
  • Confirm the org ID is correct.
  • Use disableInput / disableOutput if tool args or results are sensitive.