Skip to main content

Install

npm install 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'],
  }),
});

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.