# API Reference
## Base URL
- **Cloud**: `https://code-mcp-production.up.railway.app`
- **Local**: `http://localhost:3000`
## Authentication
Include API key in header:
```
x-api-key: your-api-key
```
---
## Endpoints
### Health Check
```http
GET /health
```
**Response:**
```json
{
"status": "healthy",
"version": "1.0.0",
"tools": 35,
"resources": 135,
"prompts": 10
}
```
---
### List Tools
```http
GET /tools
```
**Response:**
```json
{
"tools": [
{
"name": "sequential_thinking",
"description": "Step-by-step reasoning",
"inputSchema": { ... }
}
]
}
```
---
### Call Tool
```http
POST /tools/:name
Content-Type: application/json
{
"argument1": "value1",
"argument2": "value2"
}
```
**Example:**
```bash
curl -X POST https://code-mcp-production.up.railway.app/tools/plan_task \
-H "Content-Type: application/json" \
-H "x-api-key: your-key" \
-d '{"task":"Build a REST API","scope":"medium"}'
```
---
### List Resources
```http
GET /resources
```
Returns all available language, database, and framework resources.
---
### List Prompts
```http
GET /prompts
```
Returns all available prompts/personas.
---
### MCP JSON-RPC
```http
POST /mcp
Content-Type: application/json
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list",
"params": {}
}
```
**Methods:**
- `tools/list` - List all tools
- `tools/call` - Call a tool with `params: {name, arguments}`
- `resources/list` - List all resources
- `prompts/list` - List all prompts