API Endpoints

Complete reference for all MCPCodex REST API endpoints

Base URL

https://api.mcpcodex.com

All endpoints are prefixed with the base URL above.

Authentication

Most endpoints require authentication using a Bearer token in the Authorization header:

Authorization: Bearer your_access_token

Authentication

POST/api/v1/auth/login

Authenticate user and get access token

Parameters:

emailpassword
cURL Example
curl -X POST https://api.mcpcodex.com/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]", "password": "password123"}'
POST/api/v1/auth/refresh

Refresh access token

Parameters:

refresh_token
cURL Example
curl -X POST https://api.mcpcodex.com/v1/auth/refresh \
  -H "Content-Type: application/json" \
  -d '{"refresh_token": "your_refresh_token"}'

Code Generation

POST/api/v1/generate

Generate code using AI

Parameters:

promptlanguagemodelcontext
cURL Example
curl -X POST https://api.mcpcodex.com/v1/generate \
  -H "Authorization: Bearer your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Create a user authentication function",
    "language": "typescript",
    "model": "claude-3-opus",
    "context": {
      "framework": "express",
      "database": "postgresql"
    }
  }'
POST/api/v1/agents/create

Create a multi-agent workflow

Parameters:

nameagentsconfig
cURL Example
curl -X POST https://api.mcpcodex.com/v1/agents/create \
  -H "Authorization: Bearer your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Code Review Pipeline",
    "agents": [
      {"type": "analyzer", "model": "gpt-4"},
      {"type": "reviewer", "model": "claude-3"}
    ]
  }'

Projects

GET/api/v1/projects

List user projects

Parameters:

pagelimit
cURL Example
curl -X GET "https://api.mcpcodex.com/v1/projects?page=1&limit=10" \
  -H "Authorization: Bearer your_token"
POST/api/v1/projects

Create new project

Parameters:

namedescriptiontemplate
cURL Example
curl -X POST https://api.mcpcodex.com/v1/projects \
  -H "Authorization: Bearer your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My API Project",
    "description": "REST API with authentication",
    "template": "express-typescript"
  }'

Response Examples

Authentication Response

JSON Response
{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
  "refresh_token": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...",
  "user": {
    "id": 12345,
    "email": "[email protected]",
    "name": "John Doe",
    "plan": "pro"
  },
  "expires_in": 3600
}

Code Generation Response

JSON Response
{
  "id": "gen_abc123",
  "code": "export async function authenticateUser(email: string, password: string) {\n  // Generated code here\n}",
  "language": "typescript",
  "model": "claude-3-opus",
  "tokens_used": 250,
  "processing_time": 1.2
}

Error Codes

400Bad Request
401Unauthorized
403Forbidden
429Rate Limited
500Server Error
503Service Unavailable

Rate Limits

1,000
requests/hour
Free Plan
10,000
requests/hour
Pro Plan
100,000
requests/hour
Enterprise Plan