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
| stdio | Streamable HTTP | |
|---|---|---|
| Who starts what | the client starts TKTail.exe mcp --stdio | the client connects to the running TKTail |
| Edition | every edition | Trial, Pro, Developer |
| Turned on by | the user: Allow AI access | the user: Allow AI access + Accept AI clients over HTTP |
| Address | standard input / output, one JSON-RPC message per line | POST http://127.0.0.1:47711/mcp (port and network bind are the user’s settings) |
| Authentication | your Windows user (the per-user pipe) | Authorization: Bearer <token> on every request - also on this computer |
| Configuration | Settings > AI Access > Copy Client Configuration | Settings > 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;Acceptmust includeapplication/json(application/json, text/event-streamis fine). Replies are single JSON objects - TKTail opens no event stream (GETis 405).- One message per POST; notifications are answered with 202, batches are refused.
- Handshake revisions:
initializereturnsMcp-Session-Id; send it with every later request andDELETE /mcpwith 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: sendMCP-Protocol-Version,Mcp-Methodand, fortools/call,Mcp-Name- they must equal the body (400 otherwise).- 401: the token is missing or replaced; 403: a
Hostother than a loopback name (when TKTail listens on this computer only) or a browserOrigin; 503: more than 8 connections at once.
First calls
tktail_status- the edition and what the license allows (license,features), whether a TKTail window answers (connection), the investigation scope (investigationScope:safeWorkspaceorsafeWorkspace+extended), the tool names and the limits of the answers.tktail_list_sources- the open logs, event logs and Metrics Views, each with asourceId.tktail_get_current_context- what the user is looking at.
Source ids (src-...) and evidence references are valid while that TKTail runs: list again after a restart; pass
references back unchanged.
Permissions
Every refusal is a tool result with isError: true and structuredContent.error {category, message} - the message
says what the user can do. A client should tell the user, not retry:
| Category | Meaning |
|---|---|
access_off | the user has not allowed AI access |
capability_unavailable | the license does not include it (Extended Investigation, Metrics, HTTP) |
not_allowed | a change whose permission is off - Allow AI to save custom formats, to save searches and Metric Sets, to manage alerts |
scope_not_allowed | a path that is not open in TKTail and not below an Investigation Root the user approved |
conflict | the alert, Saved Search, Metric Set or profile changed since it was read - read it again |
The full list is in docs/MCP.md “Tool errors”. Writing tools are annotated readOnlyHint: false; ask
the user before calling one, and validate first (tktail_validate_format, tktail_validate_alert - they need no
permission and write nothing).
What TKTail reads and writes
| Object | Shape | Check it with |
|---|---|---|
| Format profile | the profile file’s JSON - JSON Schema, docs/CUSTOM_FORMATS.md | tktail_validate_format, tktail_preview_format |
| Search | a SearchDefinition: sources + predicate (text, regex, fields, time), optionally a sequence - docs/SEARCH.md “Schema” | tktail_search (it says what ran in definition) |
| Metric Set | name, metrics: {object, counter, instance} in English, as tktail_list_metrics shows them | tktail_save_metric_set refuses an unknown counter |
| Alert | the alert file’s JSON - name, severity, condition (a search definition), trigger, actions, capture - docs/ALERTS.md; tktail_get_alert shows a saved one as alert | tktail_validate_alert |
| Evidence | evidenceRef objects from records, results and contexts; incidents and their evidence pages | tktail_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(orlimit),nextOffset,hasMore; metric history withnextFrom. 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 hasevidenceMayBeMissing: trueand 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
Explain the current error: tktail_get_current_context -> tktail_get_records_around (anchor current) ->
tktail_search for its request id over {"kind":"open"}.
A profile for a delimited log (needs Allow AI to save custom formats to save):
tktail_new_format_draftwithsourceIdandtemplate: "delimited"- a draft fitted to the log: its delimiter, quote, header and one field per column (columnslists them, 1-based).- Give columns their meaning in
definition.fields:"role": "timestamp"and"type": "timestamp"on the time column,"role": "severity","role": "message"; rename ids freely ("severity_level"). tktail_validate_format, thentktail_preview_formatwith thesourceIduntil every record parses.tktail_save_formatwithapplyToSourceId; to have the file use it after a restart, put its file name indefinition.fileMatch.namesbefore saving (["export-*.csv"]).
Watch it (needs Allow AI to save searches and Metric Sets and Allow AI to manage alerts):
tktail_save_search-name,definition{"sources":[{"kind":"source","path":"<sourceId>"}], "predicate":{"all":[{"field":{"name":"severity_level","op":"eq","value":"ERROR"}}]}}.tktail_validate_alertwithalert{"name":"Export errors","severity":"error","condition":<the same definition>,"trigger":{"kind":"everyMatch"},"actions":["notify"],"capture":{"items":[{"kind":"file", "recordsBefore":5,"recordsAfter":5}]}}- thentktail_save_alertwith the samealert.- Later:
tktail_list_alert_occurrences,tktail_get_alert_occurrence,tktail_get_occurrence_evidence.
To change a saved one, read it (tktail_get_alert, tktail_get_saved_search, tktail_get_metric_set) and pass its
version as expectedVersion (a Metric Set: its contentId as expectedContent).
Rules for agents
- Read what is there before writing; never invent paths - use
tktail_list_sources, and with Extended Investigationtktail_list_investigation_roots/tktail_discover_files. - Ask the user before any change; on
not_allowedsay which permission the user would turn on. - Quote evidence with its source and position; say when results were partial.
- Name the TKTail it came from by the answer’s own
source-nodeId(this TKTail’s data folder) andinstanceId(this run) - never by an earlier call: a restart is a new run, another computer another node.displayName,nodeNameandinstanceNameare labels, not keys; an incident’soriginis the run that captured it, which may not be the one answering (Which TKTail answered). - TKTail has no tool for commands, programs, settings, files outside its stores or Investigation Roots - do not look for one.
TKTail publishes no llms.txt: an MCP client learns TKTail from the server itself (tools/list - every tool with its
description and input schema - and the instructions of initialize), and people from this Help.