Skip to main content
Glama
akeledath-gif

MySkillDB Job Categories MCP

README.md
# MySkillDB Job Categories MCP

MCP server so Claude (Desktop / Code) or Cursor can **push job categories** into a college org through the existing MySkillDB API.

Two ways to run it:

| Mode | File | Auth | Best for |
|------|------|------|----------|
| **HTTP connector (recommended)** | `src/http.ts` | Click **Connect** in Claude → login page → done | Claude custom connectors |
| Stdio | `src/index.ts` | Paste JWT into config env | Cursor / quick local use |

## HTTP connector — "Connect" with login

Start it (MySkillDB API must be running):

```bash
cd MySkillDb-mcp
npm run start:http
# MCP endpoint: http://localhost:3737/mcp
```

Then in **Claude → Settings → Connectors → Add custom connector**, enter:

```
http://localhost:3737/mcp
```

Click **Connect** — a MySkillDB login page opens. Sign in with your **org admin** email/password and Claude gets access automatically. Tokens refresh on their own; no JWT copying.

The org is taken from the logged-in user's account, so there's nothing else to configure.

> If your Claude client refuses plain `http://localhost` (claude.ai web requires a public HTTPS URL), expose it with a tunnel:
>
> ```bash
> npx cloudflared tunnel --url http://localhost:3737
> ```
>
> Then restart with `MCP_PUBLIC_URL=https://your-tunnel-domain.trycloudflare.com npm run start:http` and add `https://your-tunnel-domain.trycloudflare.com/mcp` as the connector.

Env vars (all optional):

| Env | Default |
|-----|---------|
| `MYSKILLDB_API_BASE_URL` | `http://localhost:3001/api` |
| `MCP_PORT` | `3737` |
| `MCP_PUBLIC_URL` | `http://localhost:3737` (set when tunneling) |

## Stdio mode (token in config)

## Tools

| Tool | Purpose |
|------|---------|
| `list_job_categories` | List categories for the org |
| `get_job_category` | Fetch one by slug or id |
| `upsert_job_category` | Create or update one category (match by `categoryKey` / `slug`) |
| `push_job_categories` | Batch upsert (up to 50) — best for Claude-authored catalogs |
| `ensure_other_category` | Ensure the catch-all **Other** category exists |
| `delete_job_category` | Delete by id (Other is protected server-side) |

## Setup

```bash
cd MySkillDb-mcp
npm install
```

### 1. Get an access token

Log in as `org_admin` (or `acc_manager` / `master_admin`) and copy the JWT access token, e.g. from DevTools → Application → localStorage, or:

```bash
curl -s -X POST http://localhost:3001/api/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"email":"you@college.edu","password":"your-password"}'
```

Use the `accessToken` from the response. Also note your `organizationId`.

### 2. Env vars the MCP needs

| Env | Example |
|-----|---------|
| `MYSKILLDB_API_BASE_URL` | `http://localhost:3001/api` |
| `MYSKILLDB_ACCESS_TOKEN` | JWT from login |
| `MYSKILLDB_ORGANIZATION_ID` | `69206d9f666e11592c65bcc7` |

### 3. Claude Desktop config

Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "myskilldb-job-categories": {
      "command": "npx",
      "args": [
        "tsx",
        "/Users/ajaykrishnan/Downloads/MySkillDB/Apps/MySkillDB_New/MySkillDb-mcp/src/index.ts"
      ],
      "env": {
        "MYSKILLDB_API_BASE_URL": "http://localhost:3001/api",
        "MYSKILLDB_ACCESS_TOKEN": "paste-jwt-here",
        "MYSKILLDB_ORGANIZATION_ID": "paste-org-id-here"
      }
    }
  }
}
```

Restart Claude Desktop after saving.

### 4. Cursor config

Add the same block under Cursor MCP settings / `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "myskilldb-job-categories": {
      "command": "npx",
      "args": [
        "tsx",
        "/Users/ajaykrishnan/Downloads/MySkillDB/Apps/MySkillDB_New/MySkillDb-mcp/src/index.ts"
      ],
      "cwd": "/Users/ajaykrishnan/Downloads/MySkillDB/Apps/MySkillDB_New/MySkillDb-mcp",
      "env": {
        "MYSKILLDB_API_BASE_URL": "http://localhost:3001/api",
        "MYSKILLDB_ACCESS_TOKEN": "paste-jwt-here",
        "MYSKILLDB_ORGANIZATION_ID": "paste-org-id-here"
      }
    }
  }
}
```

## Example prompt for Claude

> Using the MySkillDB job categories MCP, push a Tech category for "Backend Engineering" with slug `backend-engineering`, categoryKey `backend`, about/day-in-life/skills/tools/growth plan suitable for Indian campus placement students. Then list categories to confirm.

Claude should call `upsert_job_category` or `push_job_categories`.

## Local smoke test

With the API running and env exported:

```bash
export MYSKILLDB_API_BASE_URL=http://localhost:3001/api
export MYSKILLDB_ACCESS_TOKEN=...
export MYSKILLDB_ORGANIZATION_ID=...
npm run inspect
```

## Notes

- The MySkillDB server must be running.
- Token must belong to an admin role that can write `/api/job-categories`.
- Never commit real JWTs into git — keep them in local MCP config only.
- stdout is reserved for MCP JSON-RPC; logs go to stderr.