DocumentationGetting Started

Getting Started

Get up and running with MCPCodex in under 5 minutes. This guide will walk you through installation, configuration, and your first AI-powered code generation.

5 min setup
npm/yarn/pnpm support
TypeScript ready

Prerequisites

Required

  • Node.js 18.0 or higher
  • npm, yarn, or pnpm package manager
  • Git for version control

Recommended

  • VS Code with MCPCodex extension
  • Docker for containerized deployments
  • TypeScript 5.0+ for type safety

Installation Steps

Step 1: Install MCPCodex CLI

npm install -g @mcpcodex/cli

Step 2: Initialize Your Project

mcpcodex init my-ai-project --template=advanced

Step 3: Configure Your First Agent

import { MCPCodex } from '@mcpcodex/core';

const agent = new MCPCodex({
  apiKey: process.env.MCPCODEX_API_KEY,
  model: 'gpt-4-turbo',
  context: {
    maxTokens: 8192,
    temperature: 0.7
  }
});

// Connect to your codebase
await agent.connect({
  repository: './src',
  includeTests: true,
  watchMode: true
});

Step 4: Execute Your First Command

// Generate code with context awareness
const result = await agent.execute({
  prompt: "Create a REST API endpoint for user authentication",
  context: {
    framework: 'express',
    database: 'postgresql',
    includeTests: true
  }
});

console.log(result.files); // Generated files
console.log(result.explanation); // AI explanation

Configuration

Environment Variables

Create a .env file in your project root with the following variables:

# MCPCodex Configuration
MCPCODEX_API_KEY=your_api_key_here
MCPCODEX_MODEL=gpt-4-turbo
MCPCODEX_MAX_TOKENS=8192
MCPCODEX_TEMPERATURE=0.7

# Optional: Advanced Settings
MCPCODEX_CACHE_ENABLED=true
MCPCODEX_TELEMETRY_ENABLED=false
MCPCODEX_LOG_LEVEL=info

Pro Tip: Get your API key from the dashboard after signing up for a free account.