npm package: @noalia/mcp-server
Description: CodeTitan MCP Server — AI-powered code quality tools for Claude Code, Cursor, and any MCP client
Latest version: 1.0.1

# @codetitan/mcp-server

CodeTitan MCP Server — exposes the full **Detect → Fix → Prove → Learn** pipeline as MCP tools for Claude Code, Cursor, and any MCP-compatible client.

## Tools

| Tool | Description |
|------|-------------|
| `codetitan_analyze` | Run static analysis (1001+ rules) across security, performance, refactoring, testing, and documentation domains |
| `codetitan_fix` | Apply an AI-generated fix — `dry-run` to preview, `single` for one provider, `arena` to compete providers and pick the winner |
| `codetitan_arena` | Run TitanArena: multiple AIs generate fixes in isolated git worktrees, real tests + static analysis choose the winner |
| `codetitan_insights` | Show production feedback metrics: fix success rate, failing categories, auto-generated rule proposals |
| `codetitan_test` | Detect the test framework (Jest/Vitest/Mocha/pytest/Go/Cargo) and run tests |

## Setup

### Prerequisites

```bash
npm install -g @codetitan/mcp-server
# or run directly with npx
npx @codetitan/mcp-server
```

The server requires `@noalia/code-titan-core` to be installed either globally or in the project you are analysing.

---

### Claude Code

Add to `~/.claude/settings.json` (global) or `.claude/settings.json` (project):

```json
{
  "mcpServers": {
    "codetitan": {
      "command": "npx",
      "args": ["@codetitan/mcp-server"]
    }
  }
}
```

Or if installed globally:

```json
{
  "mcpServers": {
    "codetitan": {
      "command": "codetitan-mcp"
    }
  }
}
```

---

### Cursor

Add to `~/.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "codetitan": {
      "command": "npx",
      "args": ["@codetitan/mcp-server"]
    }
  }
}
```

---

### Claude Desktop

Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

```json
{
  "mcpServers": {
    "codetitan": {
      "command": "npx",
      "args": ["-y", "@codetitan/mcp-server"]
    }
  }
}
```

---

## Usage Examples

Once connected, ask your AI assistant:

```
Analyse /home/user/my-project for security vulnerabilities
```
→ calls `codetitan_analyze` with `domain: "security-god"`

```
Fix finding SEC-001 in src/auth.ts using arena mode
```
→ calls `codetitan_fix` with `mode: "arena"` — multiple AIs compete, tests validate the winner

```
Run a quick analysis of the current project (cap at 20 files)
```
→ calls `codetitan_analyze` with `quick: true`

```
Show me production feedback metrics for the last 30 days
```
→ calls `codetitan_insights` with `timeRange: "30d"`

```
Run the tests for src/utils.ts
```
→ calls `codetitan_test` with the file path

---

## Building from source

```bash
cd packages/mcp-server
npm install
npm run build   # outputs to build/
npm test        # 21 tests
```

## Architecture

The server runs over **stdio** (standard MCP transport). Each tool call dynamically `require()`s the relevant module from `@noalia/code-titan-core`, falling back to a workspace-local install under `<projectPath>/node_modules/`. This means the server itself stays lightweight and always uses the core version that matches the analysed project.