# GSB MCP Server CLI

A command-line interface to run the GSB MCP (Model Context Protocol) server for AI editors.

## Installation

You can run the CLI directly without installation using npx:

```bash
npx -y @gsb-core/backend-mcp
```

Or install it globally:

```bash
npm install -g @gsb-core/backend-mcp
gsb-mcp
```

## Usage

```bash
npx -y @gsb-core/backend-mcp [options]
```

### Options

- `--port, -p`: Port to run the server on (default: 6278)
- `--config, -c`: Path to configuration file
- `--gsb-api-url`: GSB API URL
- `--gsb-api-key`: GSB API Key
- `--gsb-tenant-code`: GSB Tenant Code
- `--shared-secret`: Shared secret for authentication
- `--debug, -d`: Run in debug mode
- `--yes, -y`: Skip all prompts and use environment variables only
- `--help, -h`: Show help
- `--version, -v`: Show version number

### Configuration File

You can provide a JSON configuration file with the following format:

```json
{
  "GSB_API_URL": "your-api-url",
  "GSB_API_KEY": "your-api-key",
  "GSB_TENANT_CODE": "your-tenant-code",
  "SHARED_SECRET": "your-shared-secret"
}
```

Example:

```bash
npx -y @gsb-core/backend-mcp --config ./gsb-config.json
```

## Environment Variables

You can also set the following environment variables:

- `GSB_API_URL`: GSB API URL
- `GSB_API_KEY`: GSB API Key
- `GSB_TENANT_CODE`: GSB Tenant Code
- `SHARED_SECRET`: Shared secret for authentication

## Non-Interactive Mode

If you want to skip all interactive prompts and use only environment variables, use the `-y` flag:

```bash
# Use environment variables and skip all prompts
npx @gsb-core/backend-mcp -y
```

This is particularly useful for:
- Docker containers
- CI/CD environments
- Scripted deployments

## Interactive Mode

If any of the required configuration values are missing and the `-y` flag is not used, the CLI will prompt you to enter them:

```bash
npx @gsb-core/backend-mcp
```

## Available Tools

The GSB MCP Server provides tools for working with GSB entities:

- Entity Operations (CRUD)
- Entity Definition Management
- Workflow Operations
- Mapped Item Management

## Use with AI Editors

The MCP server integrates with AI editors like Cursor or Windsurf, allowing AI models to interact with your GSB entities through natural language.

## License

MIT 