Model Context Protocol (MCP)

What is MCP?

The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to large language models (LLMs). Think of MCP like a USB-C port for AI applications - just as USB-C provides a standardized way to connect your devices to various peripherals, MCP provides a standardized way to connect AI models to different data sources and tools.

MCP helps you build agents and complex workflows on top of LLMs by providing:

  • A standardized way to connect AI models to data sources and tools
  • The flexibility to switch between LLM providers and vendors
  • Best practices for securing your data within your infrastructure

Key Features

  • Structured Communication: Defines how applications should communicate with language models
  • Context Management: Efficiently manages the limited context windows of LLMs
  • Tool Integration: Standardizes how LLMs interact with external tools and functions
  • Security: Helps prevent prompt injection attacks and unauthorized access
  • State Management: Maintains conversation history and relevant context

Infactory MCP Integration

Infactory provides a TypeScript package for integrating with the Model Context Protocol:

MCP SDK

@infactory/infactory-mcp

Our MCP implementation allows you to:

  • Connect your applications to various LLMs through a standardized interface
  • Provide structured context to enhance AI responses
  • Integrate with Infactory’s data sources and tools
  • Build agentic workflows with improved context management

Getting Started

Install the MCP package:

npm install @infactory/infactory-mcp
# or
yarn add @infactory/infactory-mcp
# or
pnpm add @infactory/infactory-mcp

Basic usage:

import { InfactoryMCP } from '@infactory/infactory-mcp';

// Initialize the MCP client
const mcp = new InfactoryMCP({
  apiKey: 'your-api-key'
});

// Use MCP to provide context to an LLM
const response = await mcp.sendMessage({
  content: "What insights can you provide from my sales data?",
  context: {
    dataSources: ["sales_q1_2025"]
  }
});

Learn More

For more information about the Model Context Protocol: