Getting Started with MCP Server
This tutorial will guide you through setting up the Txlog Agent as a Model Context Protocol (MCP) server, allowing AI assistants like Claude or Gemini to query your datacenter information directly.
Prerequisites
Before you begin, ensure you have:
- Txlog Agent installed (see Getting Started).
- Txlog Server version 1.19.0 or higher running and accessible.
- A configured
txlog.yamlwith valid server credentials. - An MCP-compatible client (e.g., Claude Desktop, Gemini CLI).
Step 1: Verify Configuration
First, ensure your txlog.yaml is properly configured:
cat /etc/txlog.yamlYou should see your server URL and authentication configured:
server:
url: https://txlog.example.com:8080
api_key: your_api_key_hereStep 2: Start the MCP Server
The MCP server can run in two modes. For Claude Desktop integration, use stdio mode:
txlog mcp serveYou should see output indicating the server is ready:
MCP server started in stdio modeStep 3: Configure Claude Desktop
To use the MCP server with Claude Desktop, add this configuration to your claude_desktop_config.json:
Linux: ~/.config/Claude/claude_desktop_config.jsonmacOS: ~/Library/Application Support/Claude/claude_desktop_config.jsonWindows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"txlog": {
"command": "/usr/bin/txlog",
"args": ["mcp", "serve", "--config", "/etc/txlog.yaml"]
}
}
}After saving, restart Claude Desktop.
Step 4: Test the Integration
Open Claude Desktop and try asking natural language questions about your infrastructure:
- "Which servers are running AlmaLinux 9?"
- "List all servers that need to be restarted"
- "Show me the package transactions for server webserver01"
- "Generate an executive report for December 2024"
Step 5: Try Available Prompts
The MCP server includes pre-built prompts for common tasks. In Claude Desktop, you can access them through the prompt menu:
- Infrastructure Report: Complete overview of your datacenter
- Security Audit: Focus on specific packages
- Troubleshoot Asset: Debug a specific server
- Compliance Check: Verify infrastructure compliance
Next Steps: Check the How-to Guides to learn about SSE transport for web clients, or explore the Reference for a complete list of available tools.
