MCP Server

Connect AI agents to your infrastructure via the Model Context Protocol. Query resources, relationships, and context packs programmatically.

Overview

Knowledge Tree includes a Model Context Protocol (MCP)server that allows AI agents (like Claude, GPT, or custom agents) to query your infrastructure directly. The MCP server exposes tools for searching resources, traversing relationships, and assembling context packs.

Transports

The MCP server supports two transport modes:

TransportUse Case
stdioClaude Desktop, local agents
HTTP+SSERemote agents, web applications

Available Tools

The MCP server exposes these tools to connected agents:

ToolDescriptionParameters
search_resourcesSearch for resourcesquery, type, provider, limit
get_resourceGet a specific resourcetype, id
get_relationshipsGet edges for a resourceid, direction, edgeType
traverseGraph traversalstartId, direction, edgeTypes, maxDepth
assemble_contextBuild a context packpackType, target, maxTokens
query_graphExecute a Cypher querycypher, params

Context Packs

Context packs are pre-assembled bundles of relevant infrastructure information, sized to fit within LLM token budgets. Available pack types:

Pack TypePurpose
runbookOperational runbook for a resource
architectureArchitecture description with neighbors
impactImpact analysis (what depends on this)
inventoryResource inventory matching a query
searchSemantic search across documentation

Configuration

# In your MCP client config (e.g., Claude Desktop)
{
  "mcpServers": {
    "knowledge-tree": {
      "command": "kt-agent",
      "args": ["mcp", "--config", "configs/dev.yaml"],
      "transport": "stdio"
    }
  }
}
HTTP+SSE Transport
For remote agents, the MCP server also listens on the configured MCP port (default 9090). Point your agent's MCP client athttp://your-server:9090/mcp.