Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Connect any MCP client

This page is for people who connect TKTail to an AI client, an agent framework or their own script - and for the model on the other side. It lists what a client needs to know; AI integration is the user’s view, the MCP tool reference the exact tools, and the developer reference (docs/MCP.md) every detail.

Connection

stdioStreamable HTTP
Who starts whatthe client starts TKTail.exe mcp --stdiothe client connects to the running TKTail
Editionevery editionTrial, Pro, Developer
Turned on bythe user: Allow AI accessthe user: Allow AI access + Accept AI clients over HTTP
Addressstandard input / output, one JSON-RPC message per linePOST http://127.0.0.1:47711/mcp (port and network bind are the user’s settings)
Authenticationyour Windows user (the per-user pipe)Authorization: Bearer <token> on every request - also on this computer
ConfigurationSettings > AI Access > Copy Client ConfigurationSettings > AI Access > Copy HTTP Client Configuration

Protocol revisions: 2026-07-28 (stateless: _meta io.modelcontextprotocol/protocolVersion and io.modelcontextprotocol/clientCapabilities on every request) and 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05 (an initialize handshake). Capabilities: tools only - no resources, prompts or sampling.

HTTP specifics:

  • Content-Type: application/json; Accept must include application/json (application/json, text/event-stream is fine). Replies are single JSON objects - TKTail opens no event stream (GET is 405).
  • One message per POST; notifications are answered with 202, batches are refused.
  • Handshake revisions: initialize returns Mcp-Session-Id; send it with every later request and DELETE /mcp with it to end the session. 404 means the session is gone (TKTail restarted, the token was regenerated, or 30 idle minutes) - initialize again.
  • 2026-07-28: send MCP-Protocol-Version, Mcp-Method and, for tools/call, Mcp-Name - they must equal the body (400 otherwise).
  • 401: the token is missing or replaced; 403: a Host other than a loopback name (when TKTail listens on this computer only) or a browser Origin; 503: more than 8 connections at once.

First calls and refusals

Start with tktail_status, tktail_list_sources and tktail_get_current_context - the Agent quickstart is the whole loop, with complete calls. Source ids (src-...) and evidence references are valid while that TKTail runs: list again after a restart; pass references back unchanged.

Every refusal is a tool result with isError: true and structuredContent.error {category, message} - the message says what the user can do; tell the user instead of retrying. What decides access and what each category means: Agent permissions.

What TKTail reads and writes

ObjectShapeCheck it with
Format profilethe profile file’s JSON - JSON Schema, docs/CUSTOM_FORMATS.mdtktail_validate_format, tktail_preview_format
Searcha SearchDefinition: sources + predicate (text, regex, fields, time), optionally a sequence - docs/SEARCH.md “Schema”tktail_search (it says what ran in definition)
Metric Setname, metrics: {object, counter, instance} in English, as tktail_list_metrics shows themtktail_save_metric_set refuses an unknown counter
Alertthe alert file’s JSON - name, severity, condition (a search definition), trigger, actions, capture - docs/ALERTS.md; tktail_get_alert shows a saved one as alerttktail_validate_alert
EvidenceevidenceRef objects from records, results and contexts; incidents and their evidence pagestktail_get_record, tktail_get_occurrence_evidence

The authoritative check is always TKTail’s own: the JSON Schema helps an editor or a generator, the validation tools also check patterns, conditions and references.

Paging and partial results

  • Long lists come in pages: offset / maxResults (or limit), nextOffset, hasMore; metric history with nextFrom. Every answer stays within 256 KiB of structured content.
  • Cut values say so (truncated, the original length). A search that could not look at everything has evidenceMayBeMissing: true and its state (incomplete, cancelled, failed) with the reason - report it, never present such a result as complete.
  • An incident’s evidence item has its own state (complete, partial, failed) and reason.

Recipes

Explaining an error, tracing a request across logs, reading an incident and setting up monitoring, writing a format profile for an unknown log, and reading metrics around a time: Investigation playbooks. To change a saved alert, search or Metric Set, read it first (tktail_get_alert, tktail_get_saved_search, tktail_get_metric_set) and pass its version as expectedVersion (a Metric Set: its contentId as expectedContent).

Agents that read documentation before they connect: AI agents - llms.txt, llms-full.txt, the AI manifest, the machine-readable tool reference and the AI Agent Harness of each release. The authority stays the server itself: tools/list (every tool with its description and input schema) and the instructions of initialize.