Skip to Content

API Reference

Technical documentation for Tetrix AI MCP Server integration. This reference covers the MCP protocol implementation, available resources, tools, and message formats.

MCP Protocol Overview

Tetrix AI implements the Model Context Protocol (MCP)  specification, providing standardized access to AI capabilities through any MCP-compatible client.

Connection Details

Endpoint: http://tetrix-level-1-dev-alb-463220232.us-east-1.elb.amazonaws.com/mcp Transport: HTTP only Authentication: None required (public endpoint) Protocol Version: MCP 1.0

Basic Connection

npx -y mcp-remote@latest http://tetrix-level-1-dev-alb-463220232.us-east-1.elb.amazonaws.com/mcp --transport http-only --allow-http

Available Resources

Tetrix AI exposes several types of resources through the MCP interface:

Code Resources

Resource Type: tetrix://code/*

Access to codebase analysis and understanding:

{ "uri": "tetrix://code/analysis", "name": "Code Analysis", "description": "Comprehensive codebase analysis and insights", "mimeType": "application/json" }

Infrastructure Resources

Resource Type: tetrix://infrastructure/*

AWS and cloud infrastructure analysis:

{ "uri": "tetrix://infrastructure/aws", "name": "AWS Infrastructure", "description": "AWS resource analysis and optimization", "mimeType": "application/json" }

System Resources

Resource Type: tetrix://system/*

System-wide insights and recommendations:

{ "uri": "tetrix://system/health", "name": "System Health", "description": "Overall system health and status", "mimeType": "application/json" }

Available Tools

Code Analysis Tools

analyze_codebase

Analyze entire codebase structure and relationships.

Parameters:

{ "path": "string (optional)", "language": "string (optional)", "depth": "number (optional, default: 3)" }

Example:

{ "name": "analyze_codebase", "arguments": { "path": "/src/components", "language": "typescript", "depth": 2 } }

find_dependencies

Discover dependencies and relationships between code components.

Parameters:

{ "component": "string (required)", "type": "string (optional: 'imports' | 'exports' | 'both')" }

detect_patterns

Identify architectural patterns and anti-patterns.

Parameters:

{ "scope": "string (optional: 'file' | 'directory' | 'project')", "pattern_type": "string (optional)" }

Infrastructure Tools

analyze_aws_resources

Analyze AWS infrastructure and provide optimization recommendations.

Parameters:

{ "service": "string (optional)", "region": "string (optional)", "cost_analysis": "boolean (optional, default: true)" }

security_assessment

Perform security analysis of infrastructure and code.

Parameters:

{ "scope": "string (required: 'code' | 'infrastructure' | 'both')", "severity": "string (optional: 'low' | 'medium' | 'high' | 'critical')" }

Expert Agent Tools

consult_expert

Access specialized expert agents for domain-specific advice.

Parameters:

{ "domain": "string (required)", "query": "string (required)", "context": "object (optional)" }

Available Domains:

  • architecture - System design and architectural patterns
  • devops - Infrastructure and deployment
  • security - Security analysis and recommendations
  • performance - Performance optimization
  • database - Database design and optimization

Message Formats

Request Format

Standard MCP request format:

{ "jsonrpc": "2.0", "id": "unique-request-id", "method": "tools/call", "params": { "name": "tool_name", "arguments": { "parameter": "value" } } }

Response Format

Standard MCP response format:

{ "jsonrpc": "2.0", "id": "unique-request-id", "result": { "content": [ { "type": "text", "text": "Response content" } ], "isError": false } }

Error Format

Error responses follow MCP error format:

{ "jsonrpc": "2.0", "id": "unique-request-id", "error": { "code": -32000, "message": "Error description", "data": { "details": "Additional error information" } } }

Server Capabilities

Initialization

When connecting to Tetrix AI MCP Server, the following capabilities are announced:

{ "capabilities": { "resources": { "subscribe": true, "listChanged": true }, "tools": { "listChanged": true }, "prompts": { "listChanged": false }, "logging": { "level": "info" } }, "serverInfo": { "name": "tetrix-ai-mcp-server", "version": "1.0.0", "description": "Tetrix AI MCP Server for system-wide intelligence" } }

Supported Operations

  • Resource Listing: resources/list
  • Resource Reading: resources/read
  • Tool Listing: tools/list
  • Tool Calling: tools/call
  • Server Info: initialize
  • Prompts: Not implemented
  • Sampling: Not implemented

Client Libraries

JavaScript/TypeScript

import { MCPClient } from '@modelcontextprotocol/client'; const client = new MCPClient({ transport: 'http', url: 'http://tetrix-level-1-dev-alb-463220232.us-east-1.elb.amazonaws.com/mcp' }); // Connect to server await client.connect(); // List available tools const tools = await client.request('tools/list'); // Call a tool const result = await client.request('tools/call', { name: 'analyze_codebase', arguments: { path: '/src' } });

Python

from mcp_client import MCPClient client = MCPClient( transport='http', url='http://tetrix-level-1-dev-alb-463220232.us-east-1.elb.amazonaws.com/mcp' ) # Connect to server await client.connect() # List available tools tools = await client.request('tools/list') # Call a tool result = await client.request('tools/call', { 'name': 'analyze_codebase', 'arguments': {'path': '/src'} })

Rate Limits

Current rate limits for the public endpoint:

  • Requests per minute: 60
  • Concurrent connections: 10
  • Request timeout: 30 seconds
  • Response size limit: 10MB

Error Codes

Common error codes and their meanings:

CodeNameDescription
-32000ServerErrorGeneric server error
-32001InvalidRequestInvalid request format
-32002MethodNotFoundRequested method not available
-32003InvalidParamsInvalid method parameters
-32004InternalErrorInternal server error
-32005ParseErrorJSON parsing error
-32006TimeoutRequest timeout
-32007RateLimitedRate limit exceeded

Examples

Complete Integration Example

// Complete example of integrating Tetrix AI MCP Server import { MCPClient } from '@modelcontextprotocol/client'; class TetrixAIClient { constructor() { this.client = new MCPClient({ transport: 'http', url: 'http://tetrix-level-1-dev-alb-463220232.us-east-1.elb.amazonaws.com/mcp', timeout: 30000 }); } async connect() { try { await this.client.connect(); console.log('Connected to Tetrix AI MCP Server'); // Get server capabilities const capabilities = await this.client.request('initialize'); console.log('Server capabilities:', capabilities); return true; } catch (error) { console.error('Connection failed:', error); return false; } } async analyzeCode(path = '.') { try { const result = await this.client.request('tools/call', { name: 'analyze_codebase', arguments: { path, depth: 2 } }); return result.content[0].text; } catch (error) { console.error('Code analysis failed:', error); throw error; } } async getAWSInsights() { try { const result = await this.client.request('tools/call', { name: 'analyze_aws_resources', arguments: { cost_analysis: true } }); return result.content[0].text; } catch (error) { console.error('AWS analysis failed:', error); throw error; } } async consultExpert(domain, query) { try { const result = await this.client.request('tools/call', { name: 'consult_expert', arguments: { domain, query } }); return result.content[0].text; } catch (error) { console.error('Expert consultation failed:', error); throw error; } } async disconnect() { await this.client.disconnect(); console.log('Disconnected from Tetrix AI MCP Server'); } } // Usage example async function main() { const tetrix = new TetrixAIClient(); if (await tetrix.connect()) { // Analyze codebase const codeAnalysis = await tetrix.analyzeCode('/src'); console.log('Code Analysis:', codeAnalysis); // Get AWS insights const awsInsights = await tetrix.getAWSInsights(); console.log('AWS Insights:', awsInsights); // Consult architecture expert const expertAdvice = await tetrix.consultExpert( 'architecture', 'How can I improve the scalability of my microservices?' ); console.log('Expert Advice:', expertAdvice); await tetrix.disconnect(); } } main().catch(console.error);

Best Practices

1. Connection Management

  • Reuse connections when possible
  • Implement proper error handling and reconnection logic
  • Close connections when done

2. Request Optimization

  • Batch related requests when possible
  • Use appropriate timeout values
  • Handle rate limits gracefully

3. Error Handling

  • Always handle MCP errors appropriately
  • Implement retry logic for transient failures
  • Log errors for debugging

4. Security

  • Never expose sensitive data in requests
  • Validate all inputs before sending to MCP server
  • Monitor for unusual usage patterns

Changelog

Version 1.0.0 (Current)

  • Initial MCP Server implementation
  • Basic code analysis tools
  • AWS infrastructure analysis
  • Expert agent consultation
  • HTTP transport support

Planned Features

  • WebSocket transport support
  • Enhanced security features
  • Additional expert domains
  • Batch processing capabilities
  • Custom resource types

Need help? Check our troubleshooting guide or ask in our GitHub discussions .

Last updated on