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 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
| 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
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.