claudmax 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/claudmax-1.0.16.tgz +0 -0
- package/{packages/cli/index.js → index.js} +2 -0
- package/package.json +27 -55
- package/.claude/settings.local.json +0 -7
- package/.env.example +0 -24
- package/.github/workflows/publish.yml +0 -31
- package/README.md +0 -178
- package/claudmax-mcp-1.0.2.tgz +0 -0
- package/help +0 -0
- package/help-wal +0 -0
- package/next-env.d.ts +0 -6
- package/next.config.mjs +0 -43
- package/packages/cli/claudmax-1.0.16.tgz +0 -0
- package/packages/cli/package.json +0 -33
- package/packages/mcp/claudmax-mcp-1.0.0.tgz +0 -0
- package/packages/mcp/claudmax-mcp-1.0.1.tgz +0 -0
- package/packages/mcp/claudmax-mcp-1.0.2.tgz +0 -0
- package/packages/mcp/claudmax-mcp-1.0.3.tgz +0 -0
- package/packages/mcp/index.js +0 -129
- package/packages/mcp/package-lock.json +0 -1146
- package/packages/mcp/package.json +0 -32
- package/postcss.config.mjs +0 -6
- package/prisma/schema.prisma +0 -130
- package/prisma/seed.ts +0 -27
- package/public/favicon.svg +0 -10
- package/public/robots.txt +0 -10
- package/run_build.sh +0 -4
- package/scripts/migrate-plans.js +0 -98
- package/scripts/seed-blog.ts +0 -1014
- package/src/app/admin/dashboard/AdminDashboardClient.tsx +0 -1546
- package/src/app/admin/dashboard/page.tsx +0 -13
- package/src/app/admin/page.tsx +0 -132
- package/src/app/api/admin/auth/me/route.ts +0 -34
- package/src/app/api/admin/health/route.ts +0 -110
- package/src/app/api/admin/keys/[id]/route.ts +0 -116
- package/src/app/api/admin/keys/route.ts +0 -192
- package/src/app/api/admin/keys-list/route.ts +0 -81
- package/src/app/api/admin/login/route.ts +0 -72
- package/src/app/api/admin/logout/route.ts +0 -8
- package/src/app/api/admin/migrate/route.ts +0 -133
- package/src/app/api/admin/plans/[id]/route.ts +0 -65
- package/src/app/api/admin/plans/route.ts +0 -66
- package/src/app/api/admin/posts/[id]/route.ts +0 -81
- package/src/app/api/admin/posts/route.ts +0 -83
- package/src/app/api/admin/seed/route.ts +0 -145
- package/src/app/api/admin/settings/route.ts +0 -44
- package/src/app/api/admin/stats/route.ts +0 -74
- package/src/app/api/admin/users/[id]/route.ts +0 -166
- package/src/app/api/admin/users/plans/route.ts +0 -45
- package/src/app/api/admin/users/route.ts +0 -202
- package/src/app/api/blog/[slug]/route.ts +0 -22
- package/src/app/api/blog/route.ts +0 -40
- package/src/app/api/cron/daily-status/route.ts +0 -208
- package/src/app/api/support/chat/route.ts +0 -55
- package/src/app/api/support/chat/session/route.ts +0 -62
- package/src/app/api/support/chat/stream/route.ts +0 -44
- package/src/app/api/support/email/route.ts +0 -63
- package/src/app/api/tools/understand_image/route.ts +0 -113
- package/src/app/api/tools/upload/route.ts +0 -179
- package/src/app/api/tools/web_search/route.ts +0 -99
- package/src/app/api/v1/audio/route.ts +0 -67
- package/src/app/api/v1/audio/speech/route.ts +0 -73
- package/src/app/api/v1/chat/completions/route.ts +0 -3
- package/src/app/api/v1/chat/route.ts +0 -1079
- package/src/app/api/v1/images/generations/route.ts +0 -93
- package/src/app/api/v1/info/route.ts +0 -30
- package/src/app/api/v1/key-status/route.ts +0 -109
- package/src/app/api/v1/key-status/stream/route.ts +0 -135
- package/src/app/api/v1/messages/count_tokens/route.ts +0 -22
- package/src/app/api/v1/messages/route.ts +0 -807
- package/src/app/api/v1/models/route.ts +0 -14
- package/src/app/api/v1/route.ts +0 -18
- package/src/app/blog/BlogClient.tsx +0 -193
- package/src/app/blog/[slug]/page.tsx +0 -117
- package/src/app/blog/page.tsx +0 -20
- package/src/app/check-usage/CheckUsageClient.tsx +0 -186
- package/src/app/check-usage/layout.tsx +0 -11
- package/src/app/check-usage/page.tsx +0 -15
- package/src/app/docs/layout.tsx +0 -16
- package/src/app/docs/page.tsx +0 -1055
- package/src/app/faq/FAQClient.tsx +0 -227
- package/src/app/faq/page.tsx +0 -21
- package/src/app/globals.css +0 -75
- package/src/app/layout.tsx +0 -80
- package/src/app/page.tsx +0 -256
- package/src/app/reseller/ResellerClient.tsx +0 -435
- package/src/app/reseller/page.tsx +0 -15
- package/src/app/setup.ps1/route.ts +0 -79
- package/src/app/setup.sh/route.ts +0 -113
- package/src/app/sitemap.ts +0 -50
- package/src/app/status/StatusClient.tsx +0 -103
- package/src/app/status/layout.tsx +0 -11
- package/src/app/status/page.tsx +0 -15
- package/src/app/support/SupportClient.tsx +0 -411
- package/src/app/support/page.tsx +0 -25
- package/src/app/v1/chat/completions/route.ts +0 -3
- package/src/app/v1/chat/route.ts +0 -4
- package/src/app/v1/messages/route.ts +0 -3
- package/src/components/Footer.tsx +0 -120
- package/src/components/Header.tsx +0 -131
- package/src/components/landing/features.tsx +0 -99
- package/src/components/ui/badge.tsx +0 -32
- package/src/components/ui/button.tsx +0 -46
- package/src/components/ui/card.tsx +0 -50
- package/src/components/ui/dialog.tsx +0 -97
- package/src/components/ui/dropdown-menu.tsx +0 -156
- package/src/components/ui/input.tsx +0 -21
- package/src/components/ui/label.tsx +0 -15
- package/src/components/ui/separator.tsx +0 -22
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/tabs.tsx +0 -51
- package/src/components/ui/toast.tsx +0 -103
- package/src/lib/auth.ts +0 -45
- package/src/lib/prisma.ts +0 -20
- package/src/lib/providers.ts +0 -158
- package/src/lib/security.ts +0 -165
- package/src/lib/utils.ts +0 -14
- package/src/middleware.ts +0 -30
- package/tailwind.config.ts +0 -53
- package/tsconfig.json +0 -41
- package/tsconfig.tsbuildinfo +0 -1
- package/vercel.json +0 -8
- /package/{packages/cli/bin → bin}/claudmax.js +0 -0
- /package/{packages/cli/claudmax-1.0.17.tgz → claudmax-1.0.17.tgz} +0 -0
package/claudmax-1.0.16.tgz
CHANGED
|
Binary file
|
|
@@ -90,6 +90,7 @@ function verifyConnection(apiKey) {
|
|
|
90
90
|
res.on('data', (chunk) => { body += chunk; });
|
|
91
91
|
res.on('end', () => {
|
|
92
92
|
try {
|
|
93
|
+
// key-status uses POST with { apiKey } field
|
|
93
94
|
const data = JSON.parse(body);
|
|
94
95
|
resolve({ status: res.statusCode, data, ok: true });
|
|
95
96
|
} catch {
|
|
@@ -101,6 +102,7 @@ function verifyConnection(apiKey) {
|
|
|
101
102
|
req.on('error', (err) => resolve({ status: 0, error: err.message, ok: false }));
|
|
102
103
|
req.on('timeout', () => { req.destroy(); resolve({ status: 0, error: 'timeout', ok: false }); });
|
|
103
104
|
|
|
105
|
+
// key-status endpoint expects { apiKey } in body
|
|
104
106
|
req.write(JSON.stringify({ apiKey }));
|
|
105
107
|
req.end();
|
|
106
108
|
});
|
package/package.json
CHANGED
|
@@ -1,61 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudmax",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "ClaudMax CLI — Configure Claude Code, Cursor, Windsurf, Cline, and Roo Code to use ClaudMax API gateway with one command",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"claudmax": "./index.js"
|
|
8
|
+
},
|
|
4
9
|
"scripts": {
|
|
5
|
-
"
|
|
6
|
-
"build": "next build",
|
|
7
|
-
"start": "next start",
|
|
8
|
-
"lint": "next lint",
|
|
9
|
-
"db:push": "prisma db push",
|
|
10
|
-
"db:generate": "prisma generate",
|
|
11
|
-
"db:studio": "prisma studio",
|
|
12
|
-
"db:seed": "tsx prisma/seed.ts",
|
|
13
|
-
"postinstall": "prisma generate"
|
|
10
|
+
"start": "node ./index.js"
|
|
14
11
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"next": "^16.2.2",
|
|
35
|
-
"next-auth": "^4.24.10",
|
|
36
|
-
"react": "^18.3.1",
|
|
37
|
-
"react-dom": "^18.3.1",
|
|
38
|
-
"resend": "^6.10.0",
|
|
39
|
-
"tailwind-merge": "^2.5.4",
|
|
40
|
-
"tailwindcss-animate": "^1.0.7",
|
|
41
|
-
"tsx": "^4.21.0",
|
|
42
|
-
"uuid": "^11.0.3",
|
|
43
|
-
"zod": "^3.23.8"
|
|
12
|
+
"keywords": [
|
|
13
|
+
"claudmax",
|
|
14
|
+
"claude",
|
|
15
|
+
"claude-code",
|
|
16
|
+
"anthropic",
|
|
17
|
+
"ai",
|
|
18
|
+
"api",
|
|
19
|
+
"proxy",
|
|
20
|
+
"gateway",
|
|
21
|
+
"cursor",
|
|
22
|
+
"windsurf",
|
|
23
|
+
"cline",
|
|
24
|
+
"mcp",
|
|
25
|
+
"setup",
|
|
26
|
+
"openrouter"
|
|
27
|
+
],
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=16.0.0"
|
|
44
31
|
},
|
|
45
|
-
"
|
|
46
|
-
"@types/bcryptjs": "^2.4.6",
|
|
47
|
-
"@types/better-sqlite3": "^7.6.13",
|
|
48
|
-
"@types/jsonwebtoken": "^9.0.10",
|
|
49
|
-
"@types/node": "^22.9.0",
|
|
50
|
-
"@types/react": "^18.3.12",
|
|
51
|
-
"@types/react-dom": "^18.3.1",
|
|
52
|
-
"@types/uuid": "^10.0.0",
|
|
53
|
-
"autoprefixer": "^10.4.20",
|
|
54
|
-
"eslint": "^8.57.1",
|
|
55
|
-
"eslint-config-next": "14.2.18",
|
|
56
|
-
"postcss": "^8.4.47",
|
|
57
|
-
"prisma": "^6.19.3",
|
|
58
|
-
"tailwindcss": "^3.4.14",
|
|
59
|
-
"typescript": "^5.6.3"
|
|
60
|
-
}
|
|
32
|
+
"preferGlobal": true
|
|
61
33
|
}
|
package/.env.example
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Environment Variables for ClaudeMax
|
|
2
|
-
|
|
3
|
-
# NextAuth
|
|
4
|
-
NEXTAUTH_URL=https://your-domain.com
|
|
5
|
-
NEXTAUTH_SECRET=generate-with-openssl-rand-base64-32
|
|
6
|
-
|
|
7
|
-
# Database (use Turso SQLite or Neon Postgres)
|
|
8
|
-
DATABASE_URL="libsql://your-db.turso.io?authToken=your-token"
|
|
9
|
-
# For local dev: DATABASE_URL="file:./dev.db"
|
|
10
|
-
|
|
11
|
-
# OpenRouter API Key (get from https://openrouter.ai/keys)
|
|
12
|
-
OPENROUTER_API_KEY=sk-or-v1-your-openrouter-api-key
|
|
13
|
-
|
|
14
|
-
# LiteRouter API Key — primary backend (get from https://literouter.com)
|
|
15
|
-
# Unlimited free requests/day on 5 free models (gemini-free, gpt-free, deepseek-free, glm-free, kimi-k2-thinking-free)
|
|
16
|
-
# Note: 7.5s cooldown between requests, 1 concurrent request per key
|
|
17
|
-
LITEROUTER_API_KEY=your-literouter-api-key
|
|
18
|
-
|
|
19
|
-
# OpenRouter Site URL & Referer
|
|
20
|
-
OPENROUTER_SITE_URL=https://your-domain.com
|
|
21
|
-
OPENROUTER_SITE_NAME=ClaudMax
|
|
22
|
-
|
|
23
|
-
# App Base URL
|
|
24
|
-
NEXT_PUBLIC_APP_URL=https://your-domain.com
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
name: Publish npm Package
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
paths:
|
|
8
|
-
- 'packages/cli/**'
|
|
9
|
-
workflow_dispatch:
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
publish:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
permissions:
|
|
15
|
-
contents: read
|
|
16
|
-
id-token: write
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v4
|
|
19
|
-
|
|
20
|
-
- uses: actions/setup-node@v4
|
|
21
|
-
with:
|
|
22
|
-
node-version: '20'
|
|
23
|
-
registry-url: 'https://registry.npmjs.org'
|
|
24
|
-
|
|
25
|
-
- name: Publish CLI package
|
|
26
|
-
working-directory: packages/cli
|
|
27
|
-
run: |
|
|
28
|
-
npm ci
|
|
29
|
-
npm publish --access public --provenance
|
|
30
|
-
env:
|
|
31
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/README.md
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
# ClaudeMax
|
|
2
|
-
|
|
3
|
-
> OpenAI-compatible API proxy powered by OpenRouter. Use Claude Code models in any IDE.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **OpenAI-Compatible API** — Drop-in replacement for OpenAI API endpoints
|
|
8
|
-
- **Claude Models** — Access Claude 3.5 Haiku, Sonnet, and Opus via OpenRouter
|
|
9
|
-
- **API Key Management** — Generate, revoke, and track API keys from your dashboard
|
|
10
|
-
- **Usage Analytics** — Real-time request tracking, token counts, and latency metrics
|
|
11
|
-
- **Rate Limiting** — Per-user, per-tier rate limits out of the box
|
|
12
|
-
- **Multi-Provider** — Claude, GPT-4o, Gemini Pro, DeepSeek, and 50+ models
|
|
13
|
-
- **Self-Hosted** — Deploy on Vercel, Railway, Render, or any Node.js platform
|
|
14
|
-
|
|
15
|
-
## Tech Stack
|
|
16
|
-
|
|
17
|
-
- **Framework:** Next.js 14 (App Router)
|
|
18
|
-
- **Styling:** Tailwind CSS + shadcn/ui
|
|
19
|
-
- **Database:** SQLite (dev) / Turso (prod)
|
|
20
|
-
- **ORM:** Prisma
|
|
21
|
-
- **Auth:** NextAuth.js v4
|
|
22
|
-
- **Proxy:** OpenRouter API
|
|
23
|
-
|
|
24
|
-
## Getting Started
|
|
25
|
-
|
|
26
|
-
### Prerequisites
|
|
27
|
-
|
|
28
|
-
- Node.js 18+
|
|
29
|
-
- npm or pnpm
|
|
30
|
-
- OpenRouter API key ([get one here](https://openrouter.ai/keys))
|
|
31
|
-
|
|
32
|
-
### Installation
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# Clone the repository
|
|
36
|
-
git clone https://github.com/yourusername/claudemax.git
|
|
37
|
-
cd claudemax
|
|
38
|
-
|
|
39
|
-
# Install dependencies
|
|
40
|
-
npm install
|
|
41
|
-
|
|
42
|
-
# Set up environment variables
|
|
43
|
-
cp .env.example .env.local
|
|
44
|
-
# Edit .env.local with your values
|
|
45
|
-
|
|
46
|
-
# Initialize database
|
|
47
|
-
npm run db:push
|
|
48
|
-
npm run db:generate
|
|
49
|
-
|
|
50
|
-
# Start development server
|
|
51
|
-
npm run dev
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Visit [http://localhost:3000](http://localhost:3000)
|
|
55
|
-
|
|
56
|
-
### Environment Variables
|
|
57
|
-
|
|
58
|
-
| Variable | Description |
|
|
59
|
-
|---|---|
|
|
60
|
-
| `NEXTAUTH_URL` | Your app URL (e.g. http://localhost:3000) |
|
|
61
|
-
| `NEXTAUTH_SECRET` | Random secret for NextAuth (generate with `openssl rand -base64 32`) |
|
|
62
|
-
| `DATABASE_URL` | SQLite: `file:./dev.db` / Turso: `libsql://your-db.turso.io?authToken=...` |
|
|
63
|
-
| `OPENROUTER_API_KEY` | Your OpenRouter API key |
|
|
64
|
-
| `OPENROUTER_SITE_URL` | Your site URL for OpenRouter referer |
|
|
65
|
-
| `OPENROUTER_SITE_NAME` | Your site name |
|
|
66
|
-
|
|
67
|
-
## Usage
|
|
68
|
-
|
|
69
|
-
### 1. Register & Get API Key
|
|
70
|
-
|
|
71
|
-
Sign up at `/register`, then go to Dashboard → API Keys → Create Key.
|
|
72
|
-
|
|
73
|
-
### 2. Use in Your App
|
|
74
|
-
|
|
75
|
-
```bash
|
|
76
|
-
# cURL
|
|
77
|
-
curl -X POST https://api.yourdomain.com/v1/chat/completions \
|
|
78
|
-
-H "Authorization: Bearer cmx_your_api_key" \
|
|
79
|
-
-H "Content-Type: application/json" \
|
|
80
|
-
-d '{
|
|
81
|
-
"model": "anthropic/claude-3.5-sonnet",
|
|
82
|
-
"messages": [{"role": "user", "content": "Hello!"}]
|
|
83
|
-
}'
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
```python
|
|
87
|
-
# Python
|
|
88
|
-
from openai import OpenAI
|
|
89
|
-
|
|
90
|
-
client = OpenAI(
|
|
91
|
-
base_url="https://api.yourdomain.com/v1",
|
|
92
|
-
api_key="cmx_your_api_key",
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
chat = client.chat.completions.create(
|
|
96
|
-
model="anthropic/claude-3.5-sonnet",
|
|
97
|
-
messages=[{"role": "user", "content": "Hello!"}],
|
|
98
|
-
)
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### 3. Works with Popular Tools
|
|
102
|
-
|
|
103
|
-
- **Cursor** — Settings → Models → Add API Key → Set base URL
|
|
104
|
-
- **Cline** — Settings → API Configuration → Custom provider
|
|
105
|
-
- **OpenClaw** — Settings → API Provider → OpenAI compatible
|
|
106
|
-
- **Continue.dev** — Config → Add model with custom base URL
|
|
107
|
-
- **Aider** — `aider --openai-api-base https://api.yourdomain.com/v1 --openai-api-key cmx_...`
|
|
108
|
-
|
|
109
|
-
## Pricing Tiers
|
|
110
|
-
|
|
111
|
-
| Tier | Price | Requests/Day | Tokens/Month |
|
|
112
|
-
|---|---|---|---|
|
|
113
|
-
| Free | $0 | 100 | 100K |
|
|
114
|
-
| Starter | $9/mo | 1,000 | 500K |
|
|
115
|
-
| Pro | $29/mo | 5,000 | 2M |
|
|
116
|
-
| Max | $79/mo | 20,000 | 10M |
|
|
117
|
-
|
|
118
|
-
## Deployment
|
|
119
|
-
|
|
120
|
-
### Vercel (Recommended)
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
npm i -g vercel
|
|
124
|
-
vercel
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Set environment variables in Vercel dashboard. Use **Turso** or **Neon** for the database.
|
|
128
|
-
|
|
129
|
-
### Railway
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
railway init
|
|
133
|
-
railway up
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### Docker
|
|
137
|
-
|
|
138
|
-
```dockerfile
|
|
139
|
-
FROM node:18-alpine
|
|
140
|
-
WORKDIR /app
|
|
141
|
-
COPY package*.json ./
|
|
142
|
-
RUN npm ci
|
|
143
|
-
COPY . .
|
|
144
|
-
RUN npx prisma generate
|
|
145
|
-
RUN npx prisma db push
|
|
146
|
-
EXPOSE 3000
|
|
147
|
-
CMD ["npm", "start"]
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
## Project Structure
|
|
151
|
-
|
|
152
|
-
```
|
|
153
|
-
src/
|
|
154
|
-
├── app/
|
|
155
|
-
│ ├── api/
|
|
156
|
-
│ │ ├── auth/ # NextAuth endpoints
|
|
157
|
-
│ │ ├── v1/
|
|
158
|
-
│ │ │ ├── chat/ # Proxy endpoint (core)
|
|
159
|
-
│ │ │ ├── models/ # Available models list
|
|
160
|
-
│ │ │ └── route.ts # Health check
|
|
161
|
-
│ │ ├── keys/ # API key CRUD
|
|
162
|
-
│ │ └── usage/ # Usage logs
|
|
163
|
-
│ ├── dashboard/ # Protected dashboard pages
|
|
164
|
-
│ ├── login/ # Auth pages
|
|
165
|
-
│ └── page.tsx # Landing page
|
|
166
|
-
├── components/
|
|
167
|
-
│ ├── landing/ # Landing page sections
|
|
168
|
-
│ └── ui/ # shadcn-style components
|
|
169
|
-
└── lib/
|
|
170
|
-
├── auth.ts # NextAuth config
|
|
171
|
-
├── prisma.ts # Prisma client
|
|
172
|
-
├── rate-limiter.ts # In-memory rate limiting
|
|
173
|
-
└── utils.ts # Helpers, pricing, constants
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
## License
|
|
177
|
-
|
|
178
|
-
MIT
|
package/claudmax-mcp-1.0.2.tgz
DELETED
|
Binary file
|
package/help
DELETED
|
File without changes
|
package/help-wal
DELETED
|
File without changes
|
package/next-env.d.ts
DELETED
package/next.config.mjs
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/** @type {import('next').NextConfig} */
|
|
2
|
-
const nextConfig = {
|
|
3
|
-
images: {
|
|
4
|
-
remotePatterns: [
|
|
5
|
-
{ protocol: 'https', hostname: 'avatars.githubusercontent.com' },
|
|
6
|
-
{ protocol: 'https', hostname: 'lh3.googleusercontent.com' },
|
|
7
|
-
],
|
|
8
|
-
},
|
|
9
|
-
serverExternalPackages: ['@prisma/client', 'bcryptjs'],
|
|
10
|
-
async headers() {
|
|
11
|
-
return [
|
|
12
|
-
{
|
|
13
|
-
source: '/api/:path*',
|
|
14
|
-
headers: [
|
|
15
|
-
{ key: 'X-Content-Type-Options', value: 'nosniff' },
|
|
16
|
-
{ key: 'X-Frame-Options', value: 'DENY' },
|
|
17
|
-
{ key: 'X-XSS-Protection', value: '1; mode=block' },
|
|
18
|
-
{ key: 'Content-Security-Policy', value: "default-src 'none'; frame-ancestors 'none';" },
|
|
19
|
-
{ key: 'Server', value: 'Claude-API' },
|
|
20
|
-
{ key: 'X-Powered-By', value: '' },
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
];
|
|
24
|
-
},
|
|
25
|
-
async rewrites() {
|
|
26
|
-
return [
|
|
27
|
-
// For api.claudmax.pro — rewrite / to /api/v1 (returns JSON 404)
|
|
28
|
-
{
|
|
29
|
-
source: '/',
|
|
30
|
-
has: [{ type: 'host', value: '^(www\\.)?api\\.claudmax\\.pro$' }],
|
|
31
|
-
destination: '/api/v1',
|
|
32
|
-
},
|
|
33
|
-
// For api.claudmax.pro — rewrite /v1/* to /api/v1/*
|
|
34
|
-
{
|
|
35
|
-
source: '/v1/:path*',
|
|
36
|
-
has: [{ type: 'host', value: '^(www\\.)?api\\.claudmax\\.pro$' }],
|
|
37
|
-
destination: '/api/v1/:path*',
|
|
38
|
-
},
|
|
39
|
-
];
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export default nextConfig;
|
|
Binary file
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "claudmax",
|
|
3
|
-
"version": "2.0.0",
|
|
4
|
-
"description": "ClaudMax CLI — Configure Claude Code, Cursor, Windsurf, Cline, and Roo Code to use ClaudMax API gateway with one command",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"bin": {
|
|
7
|
-
"claudmax": "./index.js"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"start": "node ./index.js"
|
|
11
|
-
},
|
|
12
|
-
"keywords": [
|
|
13
|
-
"claudmax",
|
|
14
|
-
"claude",
|
|
15
|
-
"claude-code",
|
|
16
|
-
"anthropic",
|
|
17
|
-
"ai",
|
|
18
|
-
"api",
|
|
19
|
-
"proxy",
|
|
20
|
-
"gateway",
|
|
21
|
-
"cursor",
|
|
22
|
-
"windsurf",
|
|
23
|
-
"cline",
|
|
24
|
-
"mcp",
|
|
25
|
-
"setup",
|
|
26
|
-
"openrouter"
|
|
27
|
-
],
|
|
28
|
-
"license": "MIT",
|
|
29
|
-
"engines": {
|
|
30
|
-
"node": ">=16.0.0"
|
|
31
|
-
},
|
|
32
|
-
"preferGlobal": true
|
|
33
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/packages/mcp/index.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* ClaudMax MCP Server
|
|
5
|
-
* Exposes Claude AI tools via the Model Context Protocol.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
9
|
-
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
10
|
-
import { z } from 'zod';
|
|
11
|
-
|
|
12
|
-
// ── Config ──────────────────────────────────────────────────────────────────
|
|
13
|
-
const API_KEY = process.env.CLAUDMAX_API_KEY || process.env.ANTHROPIC_API_KEY;
|
|
14
|
-
const API_BASE = (process.env.CLAUDMAX_URL || process.env.ANTHROPIC_BASE_URL || 'https://api.claudmax.pro').replace(/\/+$/, '');
|
|
15
|
-
const TIMEOUT_MS = 30000;
|
|
16
|
-
|
|
17
|
-
// ── Helpers ──────────────────────────────────────────────────────────────────
|
|
18
|
-
async function apiCall(path, body, timeout = TIMEOUT_MS) {
|
|
19
|
-
if (!API_KEY) {
|
|
20
|
-
throw new Error('CLAUDMAX_API_KEY or ANTHROPIC_API_KEY is not set');
|
|
21
|
-
}
|
|
22
|
-
const controller = new AbortController();
|
|
23
|
-
const timer = setTimeout(() => controller.abort(), timeout);
|
|
24
|
-
try {
|
|
25
|
-
const res = await fetch(`${API_BASE}${path}`, {
|
|
26
|
-
method: 'POST',
|
|
27
|
-
headers: {
|
|
28
|
-
'Content-Type': 'application/json',
|
|
29
|
-
'x-api-key': API_KEY,
|
|
30
|
-
},
|
|
31
|
-
body: JSON.stringify(body),
|
|
32
|
-
signal: controller.signal,
|
|
33
|
-
});
|
|
34
|
-
if (!res.ok) {
|
|
35
|
-
const err = await res.json().catch(() => ({ error: { message: `HTTP ${res.status}` } }));
|
|
36
|
-
throw new Error(err.error?.message || err.error || `API error: ${res.status}`);
|
|
37
|
-
}
|
|
38
|
-
return await res.json();
|
|
39
|
-
} finally {
|
|
40
|
-
clearTimeout(timer);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// ── MCP Server ───────────────────────────────────────────────────────────────
|
|
45
|
-
const server = new McpServer(
|
|
46
|
-
{ name: 'ClaudMax', version: '2.0.0' },
|
|
47
|
-
{ capabilities: { tools: {} } }
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
// ── Tools ─────────────────────────────────────────────────────────────────────
|
|
51
|
-
|
|
52
|
-
// web_search
|
|
53
|
-
server.registerTool('web_search', {
|
|
54
|
-
title: 'Web Search',
|
|
55
|
-
description: 'Search the web using ClaudMax API. Great for looking up current information, facts, news, and research.',
|
|
56
|
-
inputSchema: z.object({
|
|
57
|
-
query: z.string().describe('The search query'),
|
|
58
|
-
model: z.string().optional().describe('Model to use (optional)'),
|
|
59
|
-
}),
|
|
60
|
-
}, async ({ query, model }) => {
|
|
61
|
-
try {
|
|
62
|
-
const result = await apiCall('/api/tools/web_search', { query, model });
|
|
63
|
-
const items = result.results || result.organic || [];
|
|
64
|
-
const text = items.map((r) => `## ${r.title}\n${r.snippet || r.summary || ''}\n${r.link || r.url || ''}`).join('\n\n');
|
|
65
|
-
return { content: [{ type: 'text', text: text || 'No results.' }] };
|
|
66
|
-
} catch (err) {
|
|
67
|
-
return { content: [{ type: 'text', text: `Search failed: ${err.message}` }], isError: true };
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
// understand_image
|
|
72
|
-
server.registerTool('understand_image', {
|
|
73
|
-
title: 'Understand Image',
|
|
74
|
-
description: 'Analyze an image to understand its contents, describe objects, text, charts, or any visual information.',
|
|
75
|
-
inputSchema: z.object({
|
|
76
|
-
image_url: z.string().describe('URL or base64 data URL of the image'),
|
|
77
|
-
prompt: z.string().optional().describe('Question about the image'),
|
|
78
|
-
}),
|
|
79
|
-
}, async ({ image_url, prompt }) => {
|
|
80
|
-
try {
|
|
81
|
-
const result = await apiCall('/api/tools/understand_image', {
|
|
82
|
-
image_url,
|
|
83
|
-
prompt: prompt || 'Describe this image.',
|
|
84
|
-
});
|
|
85
|
-
return { content: [{ type: 'text', text: result.description || result.content || 'Unable to analyze.' }] };
|
|
86
|
-
} catch (err) {
|
|
87
|
-
return { content: [{ type: 'text', text: `Image analysis failed: ${err.message}` }], isError: true };
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
// upload_file
|
|
92
|
-
server.registerTool('upload_file', {
|
|
93
|
-
title: 'Upload File',
|
|
94
|
-
description: 'Upload and process files. Images are analyzed, text files are read. Supports PNG, JPEG, GIF, WebP, SVG, PDF, TXT, MD, JSON, CSV.',
|
|
95
|
-
inputSchema: z.object({
|
|
96
|
-
name: z.string().describe('Filename with extension (e.g. photo.png)'),
|
|
97
|
-
mime_type: z.string().describe('MIME type (e.g. image/png)'),
|
|
98
|
-
data: z.string().describe('Base64-encoded file contents'),
|
|
99
|
-
prompt: z.string().optional().describe('What to do with the file'),
|
|
100
|
-
}),
|
|
101
|
-
}, async ({ name, mime_type, data, prompt }) => {
|
|
102
|
-
try {
|
|
103
|
-
const result = await apiCall('/api/tools/upload', {
|
|
104
|
-
files: [{ name, mime_type, data }],
|
|
105
|
-
prompt: prompt || 'Process this file.',
|
|
106
|
-
});
|
|
107
|
-
const files = result.files || [];
|
|
108
|
-
const outputs = files.map((f) => {
|
|
109
|
-
if (f.error) return `ERROR ${f.name}: ${f.error}`;
|
|
110
|
-
if (f.type === 'image') return `IMAGE ${f.name}: ${f.description || f.content}`;
|
|
111
|
-
if (f.type === 'text') return `TEXT ${f.name}:\n${f.content}`;
|
|
112
|
-
return `FILE ${f.name}: processed`;
|
|
113
|
-
});
|
|
114
|
-
return { content: [{ type: 'text', text: outputs.join('\n') }] };
|
|
115
|
-
} catch (err) {
|
|
116
|
-
return { content: [{ type: 'text', text: `Upload failed: ${err.message}` }], isError: true };
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
// ── Start ─────────────────────────────────────────────────────────────────────
|
|
121
|
-
async function main() {
|
|
122
|
-
const transport = new StdioServerTransport();
|
|
123
|
-
await server.connect(transport);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
main().catch((err) => {
|
|
127
|
-
console.error('ClaudMax MCP error:', err.message);
|
|
128
|
-
process.exit(1);
|
|
129
|
-
});
|