okta-logs-mcp
Provides read-only tools to query and summarize Okta System Log events via GET /api/v1/logs, with filters for time window, event type, actor, target, outcome, keyword, and raw filter, plus summary counts by event type/outcome, top actors, failure reasons, and source IPs.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
okta-logs-mcp
A small, read-only MCP server for the Okta System Log, designed to sit behind the Okta Agent Gateway so an AI agent (for example a Microsoft 365 Copilot declarative agent) can answer questions about Okta activity while Okta governs and audits every call.
No dependencies beyond Node.js ≥ 20. One file of config, two tools, an end-to-end test against a fake Okta.
Why this exists
Okta API scopes such as okta.logs.read can only be issued by an org's org authorization server. An Agent Gateway
authenticates agents against a custom authorization server, which can't issue okta.* scopes, so the gateway can't
obtain a System Log token on the agent's behalf.
This server splits the two hops:
AI agent ──(token from the gateway's custom AS, scope: logs.read)──▶ Okta Agent Gateway
──▶ okta-logs-mcp (validates that token: signature, issuer, audience, scope, optional client allow-list)
──(its own API Services app: client credentials + private key, scope: okta.logs.read)──▶ Okta System Log APIThe gateway decides which agents and users may reach the tools, and logs each call.
This server holds a read-only Okta credential and only ever calls
GET /api/v1/logs.Each tool call is written to stdout as a JSON audit line (tool, outcome, caller
sub, client ID, duration). Tokens are never logged.
Related MCP server: Okta MCP Server
Tools
Tool | What it does |
| Returns matching events (newest first by default), slimmed to the useful fields: time, event type, message, outcome + reason, actor, client IP/location, targets. Filters: |
| Counts events in a window: by event type and outcome, top actors, top failure reasons, top source IPs. Good for "what's going on?" questions. |
Both are annotated readOnlyHint: true. The server supports MCP protocol versions 2025-11-25, 2025-06-18,
2025-03-26 and 2024-11-05 over Streamable HTTP (stateless, JSON responses).
Setup
Okta's admin console labels change over time (and the Agent Gateway / MCP server screens are Early Access); the steps below describe the intent, so match them to what your console shows.
1. Okta: an API Services app for the System Log (outbound credential)
Applications → Applications → Create App Integration → API Services. Name it, e.g.
okta-logs-mcp.Client Credentials → Edit → Client authentication: Public key / Private key → Add key → Generate new key. Save the private key (PEM) straight into your secret store. Note the key's KID.
Okta API Scopes tab → Grant
okta.logs.read(nothing else).Admin roles tab → assign Read-Only Administrator (or a custom role limited to reading the System Log).
DPoP: new API Services apps often have Require Demonstrating Proof of Possession (DPoP) turned on. The server handles DPoP automatically (
OKTA_DPOP=auto), so you can leave it on.
2. Okta: the custom authorization server the gateway uses (inbound tokens)
On the custom authorization server your Agent Gateway uses (Security → API → Authorization Servers):
Scopes → Add scope
logs.read(any name works; setAUTH_REQUIRED_SCOPEto match).Access Policies: make sure the rule covering your agent / gateway client allows
logs.read.Note the server's Issuer (
AUTH_ISSUER) and Audience (AUTH_AUDIENCE) from its Settings tab.
3. Deploy
Any host that gives the container a public HTTPS URL reachable by Okta works. Configure it with the variables in
.env.example; keep the private key in the host's secret store, never in the image or the repo.
docker build -t okta-logs-mcp .docker run -p 8080:8080 --env-file .env -v /path/to/secrets:/run/secrets:ro okta-logs-mcpExample: Azure Container Apps (placeholders in <>):
az containerapp up --name okta-logs-mcp --resource-group <rg> --location <region> --source . --ingress external --target-port 8080az containerapp secret set --name okta-logs-mcp --resource-group <rg> --secrets okta-private-key="$(cat <path-to-private-key.pem>)"az containerapp update --name okta-logs-mcp --resource-group <rg> --set-env-vars OKTA_PRIVATE_KEY=secretref:okta-private-key OKTA_ORG_URL=<https://your-org.okta.com> OKTA_CLIENT_ID=<api-services-client-id> OKTA_KEY_ID=<kid> AUTH_ISSUER=<custom-as-issuer> AUTH_AUDIENCE=<custom-as-audience> AUTH_REQUIRED_SCOPE=logs.read RESOURCE_URL=https://<app-fqdn>/mcpCheck it: GET https://<host>/healthz → {"ok":true}, and GET https://<host>/.well-known/oauth-protected-resource/mcp
shows your issuer and scope.
4. Okta: register it behind the Agent Gateway
Applications and Resources → MCP Servers → Add a custom MCP server with resource URL
https://<host>/mcp.Authorization servers → Add → Okta custom authorization server → the server from step 2, scope
logs.read.Discover tools; you should see
query_okta_logsandsummarize_okta_logs.On your Agent Gateway, add the server as a resource connection and, if you like, restrict which agents may call which tools.
Optional hardening: set
AUTH_ALLOWED_CLIENT_IDSto the client ID(s) that appear ascidin tokens the gateway sends.
5. Agent
If the agent discovers tools at runtime, it picks the tools up automatically. A line in its instructions helps, e.g. "You can read the Okta System Log with summarize_okta_logs and query_okta_logs. Only read; never change anything."
Configuration
See .env.example. Required: RESOURCE_URL, AUTH_ISSUER, AUTH_AUDIENCE, OKTA_ORG_URL,
OKTA_CLIENT_ID, and OKTA_PRIVATE_KEY_FILE or OKTA_PRIVATE_KEY.
Test
npm testRuns the server against a local fake Okta (authorization server + System Log API, with and without DPoP) and checks token validation (signature, issuer, audience, expiry, scope, client allow-list), protocol negotiation, both tools, pagination, input validation and that no tokens reach the logs. No network or real credentials needed.
Security notes
Read-only by design: the only outbound call is
GET /api/v1/logson the configured org; pagination links to any other host are refused.Least privilege: grant the API Services app only
okta.logs.readand a read-only admin role.Tool inputs that build filter expressions reject quotes and backslashes; the raw
filterinput is passed to Okta as a read-only query.The System Log itself can contain personal data (logins, IPs, locations). Decide who may reach these tools in the gateway's policies accordingly.
Okta keeps 90 days of System Log; older windows are clipped. Okta's API rate limits apply (the server reports 429s with the retry time).
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Lets AI agents analyze API metrics, request logs, and traces, and manage apps and alerts.
Ask your AI assistant about your logs, traces, security events, robot runs and video. Read-only.
Read-only finance and operations controls for AI agents with evidence and safe next actions.
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to securely access Okta Identity Governance APIs for managing users, groups, apps, access requests, and certifications with configurable deployment modes and safety controls.-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Okta users, groups, applications, policies, and logs through natural language commands.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables natural language management of Okta organizations, allowing users to perform administrative tasks such as user management, group operations, and application monitoring through AI agents.Apache 2.0
- AlicenseCqualityBmaintenanceEnables AI assistants to manage Okta users, groups, applications, policies, group rules, and system logs through the Okta API. Includes dry-run safety guardrails, confirmation flags, and a read-only inspection mode.69MIT