npm package: @orangeweb3/mcp-orange-api
Description: Orange Web3 MCP server with Bedrock auth tooling and CLI
Latest version: 0.4.0

# @orangeweb3/mcp-orange-api

MCP server and auth client toolkit for Orange automation.

This package now includes two areas:

- project/review tools for Orange Web3
- Bedrock auth tools and CLI helpers

## Tooling in This Package

### Project and review tools

- `list_projects`
- `get_project`
- `list_user_projects`
- `create_project`
- `update_project`
- `list_liked_projects_by_orange_id`
- `submit_feedback`
- `check_rate_limit`
- `get_job_status`

### Auth tools (existing Bedrock endpoints)

- `auth_register_email`
- `auth_login_email`
- `auth_refresh`
- `auth_whoami`
- `auth_logout`
- `list_skills`

These auth tools call existing Bedrock Passport endpoints only.

## Install

### Consumers (npm)

Install globally to get both CLI binaries:

```bash
npm install -g @orangeweb3/mcp-orange-api
```

This provides:

- `orange-mcp` (MCP stdio server)
- `orange-auth` (Bedrock auth CLI)

You can also run without global install:

```bash
npx -y -p @orangeweb3/mcp-orange-api orange-auth --help
```

### Contributors (monorepo)

```bash
pnpm install
pnpm --filter @orangeweb3/mcp-orange-api build
```

## Development Commands

```bash
# MCP server dev watch
pnpm --filter @orangeweb3/mcp-orange-api dev

# Auth CLI (pnpm + tsx)
pnpm --filter @orangeweb3/mcp-orange-api dev:auth -- --help

# Tests
pnpm --filter @orangeweb3/mcp-orange-api test

# Typecheck
pnpm --filter @orangeweb3/mcp-orange-api typecheck
```

## Auth + Project CLI

The package exposes `orange-auth` as a bin entry after build.

### Common usage

```bash
pnpm --filter @orangeweb3/mcp-orange-api dev:auth -- auth login --email "you@example.com" --password "your-password" --json
pnpm --filter @orangeweb3/mcp-orange-api dev:auth -- auth whoami --json
pnpm --filter @orangeweb3/mcp-orange-api dev:auth -- auth refresh --json
pnpm --filter @orangeweb3/mcp-orange-api dev:auth -- auth logout --json
pnpm --filter @orangeweb3/mcp-orange-api dev:auth -- skills --json

# project endpoints
pnpm --filter @orangeweb3/mcp-orange-api dev:auth -- project list-user --project-status approved --json
pnpm --filter @orangeweb3/mcp-orange-api dev:auth -- project create --payload-file ./project-payload.json --json
pnpm --filter @orangeweb3/mcp-orange-api dev:auth -- project update --project-id "123" --payload-file ./project-payload.json --json
pnpm --filter @orangeweb3/mcp-orange-api dev:auth -- project liked --orange-id "orange_user_id" --json
```

### Skills discovery

```bash
orange-auth skills
orange-auth help skills
```

In MCP clients, call `list_skills` to retrieve the same packaged catalog of auth/project guidance, examples, and related Orange workflow summaries.

### XDG persistence

Session file:

- `$XDG_STATE_HOME/orange-cli/auth.json`
- fallback: `~/.local/state/orange-cli/auth.json`

Behavior:

- `login` and `register` persist session by default.
- `whoami`, `refresh`, and `logout` can run without explicit token flags.
- project commands read `--access-token` first and fall back to persisted session unless `--no-persist` is set.
- use `--no-persist` to disable persistence for one command.

## Environment Variables

### Project/review tools

- `ORANGE_API_BASE` (default: `https://app.orangeweb3.com/api`)
- `WORKER_API_BASE` (default: `http://localhost:3001/api`)

### Auth tools/CLI

- `BEDROCK_AUTH_BASE_URL` (default: `https://api.bedrockpassport.com/api/v1/auth`)
- `BEDROCK_SUBSCRIPTION_KEY` (or `OCP_APIM_SUBSCRIPTION_KEY`; optional override, default: `d3d4ee166782499f9232c4b6be687322`)
- `BEDROCK_AUTH_DEFAULT_TENANT_ID` (optional override for login, default: `orangeid-vFlBDiUkSj`)
- `BEDROCK_AUTH_TIMEOUT_MS` (default: `15000`)

## OpenClaw MCP Config Example

Add to `~/.clawdbot/openclaw.json`:

```jsonc
{
  "mcpServers": {
    "orange-web3": {
      "command": "orange-mcp",
      "env": {
        "ORANGE_API_BASE": "https://app.orangeweb3.com/api",
        "WORKER_API_BASE": "http://localhost:3001/api",
        "BEDROCK_AUTH_BASE_URL": "https://api.bedrockpassport.com/api/v1/auth",
        // Optional overrides:
        // "BEDROCK_SUBSCRIPTION_KEY": "<your-key>",
        // "BEDROCK_AUTH_DEFAULT_TENANT_ID": "<your-tenant>"
      }
    }
  }
}
```

If your OpenClaw runtime does not inherit PATH, use:

```jsonc
{
  "mcpServers": {
    "orange-web3": {
      "command": "npx",
      "args": ["-y", "-p", "@orangeweb3/mcp-orange-api", "orange-mcp"],
      "env": {
        // Optional overrides:
        // "BEDROCK_SUBSCRIPTION_KEY": "<your-key>",
        // "BEDROCK_AUTH_DEFAULT_TENANT_ID": "<your-tenant>"
      }
    }
  }
}
```

## Contracts and Notes

- Auth flow is built on existing Bedrock endpoints only.
- `orange-auth` and `orange-mcp` default to the public subscription key `d3d4ee166782499f9232c4b6be687322` and tenant id `orangeid-vFlBDiUkSj` when callers do not override them.
- `refresh` returns a new access token.
- `logout` request must send `{}` body.

For full end-to-end integration details, see the repository doc:

- `docs/BOT_AUTH_AUTOMATION.md`

## Publish to npm

From repository root:

```bash
pnpm --filter @orangeweb3/mcp-orange-api test
pnpm --filter @orangeweb3/mcp-orange-api typecheck
pnpm --filter @orangeweb3/mcp-orange-api pack
pnpm --filter @orangeweb3/mcp-orange-api publish --access public
```