Skip to main content

Overview

CertGov implements the Model Context Protocol (MCP), an open standard that lets AI assistants call structured tools over HTTP. Once connected, you can manage your certificate environment in plain language — no API client, no scripting.
When a session starts, the AI is automatically given your organisation name, ID, and a live certificate posture snapshot (active, expiring, expired, and revoked counts) — so it has context without you having to ask. Every tool call is logged with latency, status, and the key that made the request. The MCP / AI Agents dashboard (Settings → MCP / AI Agents) shows usage analytics and unsolved queries — requests the AI couldn’t fulfill because CertGov hasn’t exposed that capability yet.

Prerequisites

  • A CertGov API key with the mcp scope (Settings → API Keys → Add Key)
  • An MCP-compatible AI client (see Compatible Clients)

Endpoint

Self-hosted: replace app.certgov.app with your own hostname. Transport: Streamable HTTP (MCP 2024-11-05). Single POST endpoint; synchronous JSON responses.

Available Tools

Certificates & Audit

Approvals

Governance — Query

Diagnostics

Setup Guidance

Action Tools — Create (two-step)

Action tools require explicit confirmation before writing anything. See Two-Step Confirmation below.

Feedback


Example: Checking a Pending Approval with DNS Challenge

When a cert is stuck waiting for a manual DNS TXT record, list_approvals shows the challenge details:
The agent calls list_approvals(status="pending") and finds:
The AI can tell you exactly what TXT record to add. Once you add it in your DNS provider and click Confirm in the Approvals UI, the ACME validation proceeds automatically. After confirming, the TXT record remains visible in the Approvals UI for 2 hours (marked as “Confirmed — ACME validating”) so you can verify what value was used if validation fails.

Example: Diagnosing an ACME Issuance Failure

When a certificate fails to issue, the agent can trace the problem end-to-end:
The agent calls:
  1. check_domain(domain="secure.example.com") — finds the Trust Profile and its configured CA
  2. list_dns_accounts() — inspects the Cloudflare DNS account referenced by that profile
The DNS account response flags the issue immediately:
Fix: Settings → DNS Accounts → edit the Cloudflare account → add the Zone ID from your Cloudflare dashboard (domain → right sidebar → Zone ID).

Example: Certificate Security Rating

Every certificate issued by CertGov carries a security grade. The get_certificate tool includes it automatically:
Grades are computed from five factors: key algorithm (35 pts), signature algorithm (20 pts), validity period (20 pts), validity remaining (15 pts), and auto-renew (10 pts). SHA-1 or MD5 forces grade F regardless of other factors. The rating is also shown as a visual scorecard on the certificate detail page in the CertGov UI.

Two-Step Confirmation

All action tools (create_*) use a mandatory two-step flow. Passing dry_run=false alone is not enough — the tool also requires confirmed=true. This is enforced in code, not just instructions.

Step 1 — Preview (default)

Call the tool with any arguments. A preview is always returned first:

Step 2 — Execute

After the user confirms, call again with both dry_run: false and confirmed: true:
If either flag is missing, the preview is returned again — it cannot be bypassed.

Example: End-to-End nginx Setup

The plan_setup tool generates a personalized checklist from your current state:
The AI calls plan_setup(domain="fun.example.com", goal="nginx_auto_issuance") and gets back a step-by-step plan:
  1. Configure a Certificate Authority (if none exists) → links to the CA Connectors guide or ACME Setup
  2. Create a Trust Profile for fun.example.com → links to Trust Profiles
  3. Create an Application record → links to Applications
  4. Install the connector agent on the nginx host → links to Connector Agent
  5. Add a Delivery Target to the Application → links to Local Application Cert Delivery
  6. Verify end-to-end with check_domain and check_dns
Steps already completed are marked done. The AI then walks through each required step using the two-step create flow — previewing each change before creating it.

Setup: Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
Restart Claude Desktop. CertGov tools are available in every conversation.

Setup: Claude Code (CLI)

Claude Code runs on Linux, Mac, and Windows. Add CertGov as a server:
Verify:
Start a new claude session — MCP tools initialize at session start.

Setup: Cursor

Add to ~/.cursor/mcp.json (create if it doesn’t exist):
Restart Cursor. CertGov tools appear in the agent panel.

Setup: Zed

Add to ~/.config/zed/settings.json:

Setup: OpenAI-compatible clients (Grok, GPT-4o, etc.)

Clients that use OpenAI function-calling (xAI Grok, OpenAI Assistants, etc.) don’t support the MCP transport natively. Use mcp-bridge to proxy:
Then configure your client to call http://localhost:8080 for tools.

Compatible Clients


Analytics & Unsolved Queries

Every tool call is recorded in the MCP / AI Agents dashboard (Settings → MCP / AI Agents):
  • Tool Usage — which tools are called, how often, error rates, and average latency
  • Recent Calls — last 50 invocations with status, latency, arguments, and the key that made the call
  • Unsolved Queries — requests the AI logged via report_missing_capability when no tool existed for what the user asked
The Unsolved Queries list is a live product backlog. The most common gaps drive which MCP tools CertGov adds next.

Testing the Connection