npm package: @jvittechs/jai1-mcp
Description: MCP stdio proxy for Jai1 MCP Server - connects IDE AI agents to Jai1 developer tools
Author: JVIT
Latest version: 1.1.6

# @jvittechs/jai1-mcp

MCP (Model Context Protocol) proxy for connecting IDE AI agents to Jai1 developer tools.

## Overview

This package provides a stdio MCP server that proxies requests to the remote Jai1 MCP Server. It allows AI agents in Cursor, Windsurf, and other MCP-compatible IDEs to access powerful developer tools:

- **Feature Planning** - Get structured development plans with requirements and task breakdowns
- **Code Review** - Quality analysis with best practices suggestions
- **Security Audit** - Vulnerability detection and security recommendations
- **Commit Messages** - Generate Conventional Commits formatted messages
- **Tech Stack Suggestions** - Get technology recommendations for your project
- **Technical Research** - Research topics with structured summaries
- **Mermaid Fix** - Detect and repair Mermaid flowchart syntax errors
- **Translation** - Professional translation between Vietnamese, Japanese, and English

## Installation

```bash
npm install -g @jvittechs/jai1-mcp
```

Or use directly with npx (recommended):

```bash
npx @jvittechs/jai1-mcp
```

## Configuration

### Required Environment Variables

| Variable | Description |
|----------|-------------|
| `JAI1_ACCESS_KEY` | Your Jai1 access key |
| `JAI1_MCP_SERVER_URL` | MCP server URL (provided by your admin) |

### Optional Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `JAI1_MCP_TIMEOUT` | `120000` | Request timeout in milliseconds |
| `JAI1_MCP_DEBUG` | `false` | Enable debug logging |

## IDE Setup

### Cursor IDE

Add to your Cursor MCP configuration (`~/.cursor/mcp.json` or project `.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "jai1": {
      "command": "npx",
      "args": ["@jvittechs/jai1-mcp"],
      "env": {
        "JAI1_ACCESS_KEY": "your_access_key_here",
        "JAI1_MCP_SERVER_URL": "https://mcp.your-company.com"
      }
    }
  }
}
```

### Windsurf IDE

Add to your Windsurf MCP configuration:

```json
{
  "mcpServers": {
    "jai1": {
      "command": "npx",
      "args": ["@jvittechs/jai1-mcp"],
      "env": {
        "JAI1_ACCESS_KEY": "your_access_key_here",
        "JAI1_MCP_SERVER_URL": "https://mcp.your-company.com"
      }
    }
  }
}
```

### Claude Desktop

Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):

```json
{
  "mcpServers": {
    "jai1": {
      "command": "npx",
      "args": ["@jvittechs/jai1-mcp"],
      "env": {
        "JAI1_ACCESS_KEY": "your_access_key_here",
        "JAI1_MCP_SERVER_URL": "https://mcp.your-company.com"
      }
    }
  }
}
```

## Available Tools

Once connected, the following tools are available to your AI agent:

### `plan_feature`

Create a structured development plan for a feature.

**Input:**
- `feature_description` (required): Description of the feature
- `codebase_context`: Current codebase context
- `tech_stack`: Tech stack being used
- `constraints`: Any constraints to consider

### `suggest_techstack`

Get tech stack recommendations based on requirements.

**Input:**
- `requirements` (required): Project requirements and goals
- `project_type`: Type of project (web app, mobile, API, etc.)
- `constraints`: Budget, team skills, timeline
- `preferences`: Technology preferences

### `research`

Research a technical topic.

**Input:**
- `topic` (required): The topic to research
- `context`: Context for the research
- `depth`: One of "brief", "standard", "deep"

### `review_code`

Review code for quality and best practices.

**Input:**
- `code` (required): The code or diff to review
- `language`: Programming language
- `scope`: Areas to focus on
- `project_guidelines`: Project-specific guidelines

### `review_security`

Audit code for security vulnerabilities.

**Input:**
- `code` (required): The code or diff to audit
- `language`: Programming language
- `context`: Context about the code

### `generate_commit`

Generate a commit message from a git diff.

**Input:**
- `diff` (required): Git diff content
- `files_changed`: List of files changed

### `mermaid_fix`

Analyze and fix Mermaid flowchart syntax errors.

**Input:**
- `mermaid_code` (required): The Mermaid flowchart code to analyze and fix

**Output:**
Returns JSON with:
- `fixed_code`: Complete fixed Mermaid code
- `explanation`: Explanation of fixes
- `changes`: Array of changes with type, original, fixed, and reason

**Example:**
```
{
  "fixed_code": "graph TD\n  A[Start] --> B{Check}\n  B -- \"yes\" --> C[End]",
  "explanation": "Fixed node text with special characters and arrow labels",
  "changes": [...]
}
```

### `translate`

Professional translation between Vietnamese, Japanese, and English.

**Input:**
- `text` (required): Text to translate
- `target_language` (required): One of "vi", "ja", "en"
- `source_language`: One of "vi", "ja", "en", "auto" (default: auto)
- `context`: Additional context (e.g., "UI text", "documentation")

**Output:**
Returns JSON with:
- `translated_text`: The translated content
- `source_language`: Detected or provided source language
- `target_language`: Target language
- `notes`: Translation notes and special handling

**Special Features:**
- Handles technical terminology preservation
- Smart number/currency formatting:
  - Vietnamese: `50k` → `50.000`, `man` → `10.000`
  - Japanese: `万` (man) = 10,000
  - English: `50,000` format
- Context-aware translation for software development

**Example:**
```
{
  "translated_text": "My monthly salary is 500,000 Yen",
  "source_language": "vi",
  "target_language": "en",
  "notes": "Converted 'man' from 50 man = 500,000 Yen"
}
```

## Error Codes

| Code | Description |
|------|-------------|
| `ERR-MCP-001` | Invalid access key |
| `ERR-MCP-002` | Request timeout |
| `ERR-MCP-003` | Tool not found |
| `ERR-MCP-004` | Server error |
| `ERR-MCP-005` | Network error |

## Getting an Access Key

To get a JAI1_ACCESS_KEY, please contact the Jai1 team or use the jai1-cli:

```bash
# Login to get your access key
jai1 auth login
```

## License

MIT