LogDuck Documentation

Connect an AI agent

Markdown: this page · all of the docs · index

LogDuck is an MCP server. Any host that speaks the Model Context Protocol - Claude, Claude Code, Cursor, VS Code, ChatGPT and others - can connect to it and do what you can do in the dashboard: create projects and event types, mint API keys, wire webhooks and alerts, read events and analytics, and manage members. Describe your app and let the agent set LogDuck up; ask it what happened last night and it reads your events.

The server

The endpoint is https://api.logduck.com/mcp (Streamable HTTP, stateless). It serves the current protocol revision and the earlier handshake older hosts still speak. There are two ways to sign in.

Access tokens (Claude Code, Cursor, VS Code, scripts)

Create an access token under Your account → Access tokens in the dashboard. Choose an access level - read only, read and configure, or full access - and optionally limit it to one organization. The token is shown once. It acts as you, limited by its level, and stops working the moment you revoke it.

Claude Code, from a terminal:

terminal
claude mcp add --transport http logduck https://api.logduck.com/mcp \  --header "Authorization: Bearer ldt_YOUR_TOKEN"

Cursor, in ~/.cursor/mcp.json (or a project's .cursor/mcp.json):

JSON~/.cursor/mcp.json
{  "mcpServers": {    "logduck": {      "url": "https://api.logduck.com/mcp",      "headers": { "Authorization": "Bearer ldt_YOUR_TOKEN" }    }  }}

VS Code, in .vscode/mcp.json - the token is prompted for and kept out of the file:

JSON.vscode/mcp.json
{  "servers": {    "logduck": {      "type": "http",      "url": "https://api.logduck.com/mcp",      "headers": { "Authorization": "Bearer ${input:logduck-token}" }    }  },  "inputs": [    { "id": "logduck-token", "type": "promptString", "description": "LogDuck access token", "password": true }  ]}

Sign in with your account (Claude.ai, ChatGPT and other hosted agents)

Hosted agents cannot hold a static token, so they sign in with OAuth. Add LogDuck as a connector with the URL https://api.logduck.com/mcp; the host sends you to LogDuck, where you sign in, see which agent is asking, choose what it may do (read only, or read and configure) and optionally limit it to one organization, and approve. The connection then appears under Your account → Connected agents, where one click disconnects it. Hosts that need it may register themselves at https://api.logduck.com/oauth/register; metadata is at https://api.logduck.com/.well-known/oauth-authorization-server.

Claude Code can sign in this way too: add the server without a header (claude mcp add --transport http logduck https://api.logduck.com/mcp) and it opens the sign-in page for you - no token to copy.

What an agent can do

The tools mirror the dashboard: whoami and list_organizations to orient; create_project, list_environments, create_event_type, create_event_category, create_api_key; create_webhook and enable_event_type_webhook for Slack, Discord and custom URLs; create_alert_rule and create_scheduled_summary with recipient groups; list_events, get_telemetry, get_analytics, get_geo_distribution, get_field_breakdown and get_usage to read; and, with full access, invitations, members and teams. A read-only token sees only the read tools. Tools that configure anything are refused for viewers, exactly as the dashboard refuses them. The set_up_project prompt walks an agent from a description of your app to a project with event types, a key, the SDK snippet and a first test event.

Limits and safety

Every tool call is checked against your role and the token's level; a token restricted to an organization cannot name another. Calls are limited to 120 a minute per token and 600 per account, and warehouse analytics to 10 a minute. Revoking a token or disconnecting an agent takes effect on its next call. API keys minted by an agent are returned once, to you, and never stored by LogDuck in plain form - treat them as the agent's output, not its memory.