AgentKeeper MCP Server
AgentKeeper MCP Server lets approved AI assistants query AgentKeeper evidence through a hosted, governed MCP endpoint. Use it when a SOC copilot, coding assistant, SOAR workflow, GRC assistant, or internal agent needs scoped access to AgentKeeper activity, investigations, workstation posture, Gateway posture, policy context, and audit-ready summaries.
This is not a generic connector and it is not the local MCP Gateway. Treat it like API access for AI clients: credentials live in Settings > MCP Server, every call is scoped, every result is redacted by default, and every request leaves an audit trail.
Only Owners and Admins can create, rotate, enable, disable, or review hosted AgentKeeper MCP Server clients. Developers and legacy Members cannot access the client management screen or client audit diagnostics.
Where this belongs
AgentKeeper has multiple MCP-related surfaces. They solve different jobs.
| Surface | Use it for | Lives in |
|---|---|---|
| AgentKeeper MCP Server | Giving AI assistants governed read access to AgentKeeper evidence and summaries | Settings > MCP Server, /api/mcp, this page |
| MCP Gateway | Routing and governing developer MCP tool traffic before it reaches upstream tools | MCP Gateway docs, Gateway dashboard, agentkeeper-mcp-gateway |
| Runtime Integration API | Sending runtime, hook, scan, gateway, MCP, and OTLP events into AgentKeeper | Runtime Integration API |
| Webhooks and API Reference | Exporting events or integrating AgentKeeper data with external systems | Trust and reference docs |
If you are configuring Claude Desktop, Cursor, or another client to route developer MCP tools through AgentKeeper, start with MCP Gateway. If you are giving an assistant access to AgentKeeper's own security evidence, stay here.
What ships now
| Capability | Current contract |
|---|---|
| Transport | Hosted Streamable HTTP at /api/mcp; no local server install |
| Authentication | Bearer service-account tokens created in Settings > MCP Server; OAuth protected-resource metadata is published for compatible clients |
| Default profile | standard redaction |
| Tool surface | Security summary, activity, investigations, workstation and agent inventory, AI Discovery, coverage, host posture, MCP Gateway posture, drift, and policy explanation |
| Resources | Organization security summary and redaction profile reference |
| Prompts | Activity triage, evidence packet preparation, MCP drift review |
| Audit | Every call is bound to org, client, subject, request, method, redaction profile, and result hash |
| Writes | Governed investigation and evidence-export workflows only; destructive admin writes are excluded |
Prompt evidence remains sealed in MCP responses. The hosted MCP Server does not expose a raw prompt unseal tool in this release; human dashboard unseal remains owner/admin-only with a required reason and audit log.
Setup in under 10 minutes
- Open Settings > MCP Server as an owner or admin.
- Create a service-account client.
- Keep
standardredaction unless Security approves a narrower or deeper profile. - Grant only the scopes the assistant needs.
- Store the visible-once
ak_mcp_...token. - Copy the MCP URL and config snippet into the client.
- Select Claude Code, Cursor, or VS Code and copy the generated config. Run Run real data test to check initialization, tool discovery, and a live security summary.
- Ask the assistant for a security summary or bounded activity search.
To expand or reduce an existing client's access, open it in the Clients table and select Change permissions. The existing token keeps working, the new scope set applies immediately, and the change is written to both the MCP audit trail and the organization admin audit log.
Client configuration
Use this shape for MCP clients that support remote Streamable HTTP servers.
{
"mcpServers": {
"agentkeeper": {
"type": "http",
"url": "https://agentkeeper.dev/api/mcp",
"headers": {
"Authorization": "Bearer ak_mcp_REPLACE_WITH_VISIBLE_ONCE_SECRET"
}
}
}
}
Some clients use slightly different names for remote HTTP MCP servers. Keep the values the same: URL /api/mcp, header Authorization: Bearer ..., and protected-resource metadata URL /.well-known/oauth-protected-resource.
Claude Code
claude mcp add agentkeeper --transport http https://agentkeeper.dev/api/mcp \
--header "Authorization: Bearer ak_mcp_REPLACE_WITH_VISIBLE_ONCE_SECRET"
Run claude mcp list or /mcp in Claude Code to confirm the server is registered.
Cursor
Add this to .cursor/mcp.json:
{
"mcpServers": {
"agentkeeper": {
"url": "https://agentkeeper.dev/api/mcp",
"headers": {
"Authorization": "Bearer ak_mcp_REPLACE_WITH_VISIBLE_ONCE_SECRET"
}
}
}
}
Restart Cursor after changing the file.
VS Code
Add this to .vscode/mcp.json:
{
"servers": {
"agentkeeper": {
"type": "http",
"url": "https://agentkeeper.dev/api/mcp",
"headers": {
"Authorization": "Bearer ak_mcp_REPLACE_WITH_VISIBLE_ONCE_SECRET"
}
}
}
}
Windsurf
Add this to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"agentkeeper": {
"serverUrl": "https://agentkeeper.dev/api/mcp",
"headers": {
"Authorization": "Bearer ak_mcp_REPLACE_WITH_VISIBLE_ONCE_SECRET"
}
}
}
}
Restart the client after editing its MCP config.
Embed in an internal agent
Use the official MCP TypeScript client with a token supplied by your secret manager. Do not embed a service token in browser code, commit it, or paste it into a model prompt.
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const client = new Client({ name: "internal-security-agent", version: "1.0.0" });
const transport = new StreamableHTTPClientTransport(new URL(process.env.AGENTKEEPER_MCP_URL!), {
requestInit: { headers: { Authorization: `Bearer ${process.env.AGENTKEEPER_MCP_TOKEN}` } },
});
await client.connect(transport);
try {
const result = await client.callTool({ name: "agentkeeper_get_security_summary", arguments: { window_hours: 24 } });
if (result.isError) throw new Error("AgentKeeper tool call failed");
// Preserve result IDs, omissions, redaction metadata, and links in your agent's output.
console.log(result.structuredContent);
} finally {
await transport.terminateSession();
await client.close();
}
The endpoint uses JSON responses to POST requests. GET returns 405 because it does not offer an SSE stream. Deleted or expired session IDs return 404; initialize again. This release uses manually provisioned bearer tokens, not an interactive OAuth sign-in flow. Clients that require OAuth-only remote connectors are not supported.
Questions to try
Start with prompts that force the assistant to cite result scope before making claims.
- "Ask AgentKeeper for a security summary for the last 24 hours. Include the redaction profile, omissions, and links."
- "Search AgentKeeper activity for blocked or warned MCP activity today, then summarize the top investigative questions."
- "Prepare an investigation brief for the highest-severity open alert, including timeline, host posture, policy decision, and omitted data."
- "Compare MCP Gateway drift and list unmanaged or runtime-only MCP servers with affected hosts."
- "Search Agent Inventory for every skill, plugin, and MCP server observed in the last 30 days. Include install coverage, usage, risk, policy posture, and omissions."
- "Search the full AI Discovery queue for high-risk items, then retrieve the evidence samples, complete counts, omissions, and newest review history for the top result."
- "Create an audit-ready evidence packet for this customer question, but do not include raw prompts or tool payloads."
Scopes
| Scope | Purpose |
|---|---|
activity:read | Search and summarize AgentKeeper activity |
investigations:read | Investigation search, briefs, timelines, and related context |
investigations:write | Governed investigation acknowledgement, comments, and exception requests |
inventory:read | Workstations, skills, plugins, MCP servers, observed usage, reporting coverage, and policy posture |
ai_discovery:read | Full read-only AI Discovery queue, candidate evidence and history, and coverage proof |
gateway:read | MCP Gateway posture, drift, server, and tool context |
policies:read | Policy decision explanation and rule context |
evidence:export | Bounded evidence export jobs and durable export resources |
audit:read | Client usage diagnostics and support review |
Denied calls return the required scopes and the scopes the client actually has, so admins can understand the exact permission gap before changing credentials.
Write scopes do not unlock destructive administration. The v1 governed write surface is limited to investigation acknowledgement, assignment, comments, exception requests, and export requests. Policy edits, deletes, unblock actions, raw evidence reveal, client administration, and broad mutation tools are excluded.
Redaction profiles
| Profile | Use for | Behavior |
|---|---|---|
minimal | Broad assistants and executive summaries | Small evidence slices, capped strings, deeper object fields omitted |
standard | Default read profile | Redacts raw prompts, tool input/output, payload bodies, secrets, tokens, webhooks, and credentials |
forensic | Approved incident response | Deeper fields and larger evidence caps, still audited and bounded |
Every tool response includes:
{
"schema_version": "agentkeeper.mcp.v1",
"result_id": "...",
"org_id": "...",
"source": "agentkeeper.activity",
"time_window": { "from": "...", "to": "..." },
"redaction_profile": "standard",
"result_cap": 50,
"next_cursor": "...",
"links": [],
"summary": {},
"evidence": [],
"redactions": {
"profile": "standard",
"redacted": 4,
"omitted": 0,
"capped": 2,
"notes": []
},
"omissions": []
}
The assistant should cite result_id, time window, redaction profile, omissions, and console links whenever it prepares an incident summary or audit packet.
Response contract
AgentKeeper returns model-readable evidence, not chat-shaped prose. Each response should make it obvious what was searched, what was capped, what was redacted, and where a human can verify the source.
| Field | Why it matters |
|---|---|
schema_version | Lets clients and prompts handle future contract changes safely |
result_id | Stable handle for support, audit, and assistant citations |
time_window | Prevents assistants from overclaiming beyond the bounded search |
redaction_profile | Shows which exposure policy shaped the result |
result_cap and next_cursor | Makes pagination and truncation explicit |
links | Gives humans console drill-down without exposing raw data in chat |
redactions and omissions | Forces summaries to disclose what was removed or withheld |
Tools
| Tool | What it does |
|---|---|
agentkeeper_get_security_summary | Returns recent activity volume, open investigation count, workstation count, MCP Gateway event count, links, and newest redacted events |
agentkeeper_search_activity | Searches bounded activity with query, time window, verdicts, sources, cursor pagination, and caps |
agentkeeper_activity_summary | Produces a compact SOC/GRC brief with notable events and next investigative questions |
agentkeeper_search_investigations | Searches investigation alerts by query, status, severity, actor, host, MCP server, and MCP tool |
agentkeeper_prepare_investigation_brief | Builds a brief with the real case timeline, AI triage, review history, related cases, host and policy context, omissions, and next questions |
agentkeeper_search_inventory | Pages the same reconciled physical workstations as the UI; separates configuration, fresh reporting, stale signals, routing, enforcement, and proof |
agentkeeper_get_host_posture | Retrieves one workstation with identity, runtime, scan, shield, Cowork, gateway, and recent MCP event context |
agentkeeper_search_agent_inventory | Searches skills, plugins, and MCP servers with install evidence, observed sessions, users, risk, publisher/package metadata, reporting coverage, and current skill-policy posture |
agentkeeper_get_agent_inventory_item | Retrieves one inventory item plus all available summary fields, policy and coverage context, and paginated associated workstation posture |
agentkeeper_search_ai_discovery | Searches every AI Discovery candidate kind with retained risk, review, source, owner, affected-host/user, metadata, bounded evidence samples, and complete aggregate counts |
agentkeeper_get_ai_discovery_item | Retrieves one discovery candidate with bounded retained evidence and principal samples, complete counts, provenance, metadata, owner/note, and the newest read-only review history; omissions disclose every sample cap |
agentkeeper_get_ai_discovery_coverage | Returns deduplicated tool/workstation coverage, proof-state breakdowns, freshness, providers, platforms, catalog versions, and affected workstations |
agentkeeper_search_mcp_gateway_posture | Pages current Gateway server inventory with reporting, routed, enforcing, proven, stale, and no-traffic control states |
agentkeeper_compare_mcp_drift | Compares discovered servers, runtime events, policies, affected hosts, runtime-only servers, and unapproved runtime servers |
agentkeeper_explain_policy_decision | Explains a Shield, MCP, or investigation decision with matched rule, outcome language, evidence, omissions, and console links |
agentkeeper_acknowledge_investigation | Moves an investigation to review and records an audited MCP-scoped analyst note |
agentkeeper_comment_investigation | Records an audited analyst comment on an investigation without resolving or mutating policy state |
agentkeeper_assign_investigation | Assigns an investigation to a human owner by email or user id with an audited MCP-scoped workflow note |
agentkeeper_request_exception | Creates a governed exception request only when the existing policy eligibility gate allows it |
agentkeeper_request_evidence_export | Creates a bounded export job and returns a durable agentkeeper://exports/<id> resource URI |
agentkeeper_search_mcp_audit | Reads this client's own recent protocol, tool, resource, prompt, permission, row-count, and latency audit records |
Tool descriptions are intentionally model-readable. They explain the required scopes, bounded windows, caps, and how to use links for console drill-down.
The new Inventory and AI Discovery tools are read-only. They cannot approve or reclassify a discovery, edit skill policy, install or remove software, or modify a workstation. inventory:read and ai_discovery:read are separate, and AI Discovery must be selected explicitly, so neither an existing client nor a new default read-only client silently gains review, owner, note, risk, or evidence data.
Inventory results distinguish installed/reporting evidence from observed usage. A workstation that has not reported inventory is not counted as a confirmed absence. AI Discovery results preserve configured, inventoried, and observed source provenance; a discovered or approved item is not automatically routed, protected, or enforced.
Every AI Discovery response includes summary.source_availability. If an inventory source, optional integration, or activity collector is unavailable, complete is false, failure counts and sanitized error codes are returned, and omissions states that totals are partial. An unavailable source is never presented as an empty source.
Activity pages preserve all returned rows before advancing next_cursor. Investigation, workstation, and gateway searches accept a one-based page and report next_page. Invalid arguments are rejected rather than silently ignored. Nested evidence and long text remain profile-capped, with truncation counts in redactions.
Investigation acknowledgement, comments, and assignment are atomic and idempotent per client and case. Reusing an idempotency key with a different action or payload is rejected. Acknowledgement does not reopen resolved cases or change policy enforcement.
Resources
| Resource | What it returns |
|---|---|
agentkeeper://org/security-summary | Current redacted security summary for the organization |
agentkeeper://catalog/redaction-profiles | Minimal, standard, and forensic profile behavior |
agentkeeper://exports/recent | Recent evidence export jobs for the current MCP client |
agentkeeper://exports/<id> | Job status while queued/running; a completed redacted evidence envelope with export_job metadata when complete |
Export jobs run every minute and expire after seven days. They are client-bound snapshots, not unlimited bulk downloads. Activity exports include at most 200 events plus a continuation cursor; use the original time window with agentkeeper_search_activity for additional pages. Investigation and host exports are current snapshots. Drift exports use the exact requested event window plus current inventory and control posture. The underlying read scopes are required as well as evidence:export.
Prompts
| Prompt | Best use |
|---|---|
agentkeeper_triage_activity | Suspicious agent activity, blocked command, prompt injection, or MCP tool review |
agentkeeper_prepare_evidence_packet | Customer trust, audit, GRC, or incident review packet |
agentkeeper_review_mcp_drift | Installed vs runtime MCP drift, unmanaged servers, deprecated tools, and affected hosts |
Prompts do not perform hidden actions. They give the assistant a disciplined workflow that starts with redaction, omissions, and time windows before making claims.
Admin review before enabling a client
Before credentials are used, review the client like an API key with an AI-specific blast radius.
| Review item | What good looks like |
|---|---|
| Owner | Human or service principal is named and accountable |
| Scopes | Only the assistant's job scopes are enabled |
| Redaction | standard is default; forensic has security approval |
| Network | Allowed IPs or environment restrictions are set when available |
| Rate limits | High-volume workflows have explicit caps and support contacts |
| Test transcript | Setup center shows initialize, list, and one bounded tool call |
| Audit path | Admins know where to inspect request ID, session hash, and denied-scope diagnostics |
Support diagnostics
Support can diagnose a request with:
- Client ID
- Org ID
- Request ID
- Session hash
- Audit event ID
- Protocol method
- Tool, resource, or prompt name
- Redaction profile and counts
- Denied scope
- Rate-limit state
- Timestamp and user agent
Security model
Read access excludes destructive admin actions, raw profile exposure by default, unbounded analytics scans, and policy mutation. Large exports should return jobs and durable resource links rather than streaming huge windows through MCP.
The highest-risk classes are cross-org access, token leakage, redaction leaks, unbounded queries, and client compatibility drift. Treat those as launch gates, not polish.
Troubleshooting
| Symptom | Check |
|---|---|
401 from /api/mcp | Token missing, expired, revoked, or copied with extra whitespace |
403 from /api/mcp | Client disabled or scope denied |
| Tool is visible but call is denied | Create a new client with the required scope, or keep the current narrower client for least privilege |
| Assistant output overclaims | Tell it to cite redactions, omissions, and time_window before conclusions |
| No events returned | Narrow query, extend the bounded window, or confirm Activity has matching events |
| Tools do not appear in the client | Confirm the server URL is exactly /api/mcp, restart the client, and check the setup center test transcript |
| You expected MCP tool routing or blocking | Use MCP Gateway; MCP Server is for assistant access to AgentKeeper evidence |
| You need headless automation | Use a service-account MCP client with the smallest scope set and a named owner |
Product benchmark
The setup experience should feel like the best modern hosted MCP servers: obvious endpoint, no local install, copyable client snippets, practical prompts to try, clear authentication guidance, live test transcript, and client-specific troubleshooting. AgentKeeper's differentiator is the security layer around the evidence: redaction by default, policy context, auditability, durable links, transparent permission explanations, and enterprise-safe summaries.