Skip to main content

Introduction to TRMX AI

TRMX AI is the platform for building powerful, context-aware AI applications using the Model Context Protocol (MCP).

What you'll find in this guide​

Whether you're building your first AI application or looking to enhance existing systems, this guide will help you understand how the Model Context Protocol transforms AI development:

  • Foundation knowledge - Understand what the Model Context Protocol (MCP) is and why it matters for modern AI applications
  • Technical advantages - Explore key features that differentiate TRMX AI from traditional AI development approaches
  • Practical application - Learn how to quickly set up and build your first context-aware application
  • Community resources - Discover where to find support, tools, and best practices for your AI journey

What is the Model Context Protocol?​

The Model Context Protocol (MCP) is an open standard that revolutionizes how applications communicate with AI models. It solves critical challenges in building AI-powered applications by providing:

  • Context Management: Automatically tracks conversation history
  • Tool Integration: Connects AI models to external APIs and services
  • Resource Access: Provides secure data access to AI models
  • Provider Flexibility: Works with all major AI model providers

Context Management​

MCP automatically maintains conversation history, allowing AI models to remember previous interactions without manual tracking.

// Example: Context is maintained automatically
const conversation = client.createConversation({
contextId: 'user-123'
});

// First message
const response1 = await conversation.sendMessage("Hello, who are you?");

// Second message - model remembers the context
const response2 = await conversation.sendMessage("What can you help me with?");

Tool Integration​

Enable AI models to perform actions in the real world through a standardized tool interface.

// Example: Define a tool that AI models can use
const weatherTool = {
name: 'get_weather',
description: 'Get the current weather for a location',
parameters: {
location: {
type: 'string',
description: 'The location to get weather for'
}
},
execute: async ({ location }) => {
// Implementation to fetch weather data
return { temperature: 72, conditions: 'sunny' };
}
};

Resource Access​

Provide AI models with access to your data sources through a secure, standardized interface.

// Example: Define a resource for document access
const documentsResource = {
name: 'company_docs',
description: 'Access to company knowledge base',
fetch: async (query) => {
// Implementation to search documents
return [
{ id: 'doc1', title: 'Getting Started', content: '...' },
{ id: 'doc2', title: 'API Reference', content: '...' }
];
}
};

Provider Flexibility​

Switch between different AI model providers without changing your application code.

// Configure which model provider to use
const server = new MCPServer({
modelProvider: 'openai', // or 'anthropic', 'cohere', etc.
modelConfig: {
apiKey: process.env.OPENAI_API_KEY,
model: 'gpt-4'
}
});

Why Use TRMX AI?​

Key Benefits​

TRMX AI's Model Context Protocol simplifies AI development in four key ways:

  • Reduced Development Time - Build complex AI applications with 70% less code
  • Lower Costs - Reduce token usage by up to 40% with optimized context management
  • Future-Proof - Switch between model providers without changing application code
  • Enhanced Security - Keep sensitive data protected with built-in security features

Reduced Development Time​

Traditional AI integration requires complex handling of context, tool calls, and responses. MCP simplifies this dramatically.

// Without MCP: Complex context handling, tool integration, and error handling
const messages = [];
messages.push({ role: "user", content: "What's the weather in New York?" });

// Manual tool definition
const tools = [{
type: "function",
function: {
name: "get_weather",
description: "Get weather for a location",
parameters: {
type: "object",
properties: {
location: {
type: "string",
description: "The city and state",
}
},
required: ["location"]
}
}
}];

// First API call to get tool call
const response = await openai.chat.completions.create({
model: "gpt-4",
messages: messages,
tools: tools
});

// Manual tool call handling
messages.push(response.choices[0].message);
if (response.choices[0].message.tool_calls) {
const functionCall = response.choices[0].message.tool_calls[0];
const functionArgs = JSON.parse(functionCall.function.arguments);
const weatherData = await fetchWeather(functionArgs.location);

messages.push({
role: "tool",
tool_call_id: functionCall.id,
name: functionCall.function.name,
content: JSON.stringify(weatherData)
});

// Second API call needed for final response
const finalResponse = await openai.chat.completions.create({
model: "gpt-4",
messages: messages
});
}

// With MCP: One simple call handles everything
const conversation = client.createConversation({ contextId: 'user-123' });
const response = await conversation.sendMessage("What's the weather in New York?");
// That's it - context management and tool invocation handled automatically

Lower Costs​

Smart context management significantly reduces token usage and lowers your AI API costs.

// Without MCP: Sending entire history every time
async function chatWithoutMCP(newUserMessage) {
messageHistory.push({ role: "user", content: newUserMessage });

// Every message in history is sent with each request
const response = await openai.chat.completions.create({
model: "gpt-4",
messages: messageHistory // Gets larger with each interaction
});

messageHistory.push({ role: "assistant", content: response.choices[0].message.content });
return response.choices[0].message.content;
}

// With MCP: Intelligent context optimization
const conversation = client.createConversation({
contextId: 'user-123',
contextOptions: {
maxTokens: 2000, // Limit context size
summarizationThreshold: 0.8, // Auto-summarize when needed
relevanceWindow: 10 // Only keep relevant messages
}
});

// Context optimization happens automatically
const response = await conversation.sendMessage(newUserMessage);

Future-Proof Architecture​

MCP lets you switch between AI providers with a simple configuration change, not a code rewrite.

// Without MCP: Each provider requires different code
// For OpenAI
const openaiResponse = await openai.chat.completions.create({
model: "gpt-4",
messages: messageHistory
});

// For Anthropic - completely different format
const anthropicResponse = await anthropic.messages.create({
model: "claude-3-sonnet-20240229",
messages: messageHistory.map(msg => ({
role: msg.role === "user" ? "user" : "assistant",
content: msg.content
}))
});

// With MCP: Just change the config, not your code
const server = new MCPServer({
// Simply change the provider name and config
modelProvider: 'openai', // or 'anthropic', 'cohere', etc.
modelConfig: {
apiKey: process.env.API_KEY,
model: 'gpt-4' // or 'claude-3-sonnet-20240229', etc.
}
});

// Your application code remains unchanged

Enhanced Security​

MCP provides built-in security features that would otherwise require custom implementation.

// Without MCP: Custom security requires extensive code
function manualSecureAIRequest(userMessage, userRole) {
// Manual PII filtering
const sanitizedMessage = removePII(userMessage);

// Manual role-based access control
if (!hasPermission(userRole, 'ai-access')) {
throw new Error('Unauthorized access');
}

// Custom logging for compliance
logAIInteraction(userId, sanitizedMessage);

// Finally make the actual request
return openai.chat.completions.create({
model: "gpt-4",
messages: [{ role: "user", content: sanitizedMessage }]
});
}

// With MCP: Security is configured, not coded
const server = new MCPServer({
security: {
contentFiltering: true, // Automatic PII removal
authentication: { // Built-in auth
type: 'oauth',
provider: 'auth0'
},
accessControl: { // Fine-grained permissions
tools: ['allowed_tool_1'],
resources: ['allowed_resource_1']
},
auditLogging: true // Compliance-ready logging
}
});

Getting Started​

Quick Start Guide​

Ready to build your first MCP application? Follow these steps:

  1. Installation - Set up the TRMX AI SDK and CLI
  2. Quick Start - Build a simple calculator tool
  3. Learn Core Concepts - Understand MCP fundamentals
  4. Create an MCP Server - Build a full-featured MCP server

Here are some guides to help you go deeper with TRMX AI:

Video Introduction​

Learn more about MCP in this quick overview video:

Join Our Community​

Connect with other developers and the TRMX AI team:

  • GitHub - Contribute to the TRMX AI open-source projects
  • Discord - Join our community to get help and share ideas
  • Twitter - Follow us for the latest updates and news

Next Steps​

Continue Learning​

Ready to dive deeper? Check out these resources: