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.
npm install -g @mcpcodex/cli
mcpcodex init my-ai-project --template=advanced
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
});
// 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
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.
Learn about MCP architecture, agents, and context management.
Explore the complete API documentation with examples.
Connect MCPCodex with your favorite tools and services.
You now have everything you need to start building AI-powered applications with MCPCodex.
Build your first app