architectgbt-mcp 0.1.2 ā 0.2.0
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/README.md +84 -12
- package/dist/tools/get-recommendation.js +38 -8
- package/dist/tools/list-models.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,19 +14,21 @@ Get instant AI model recommendations without leaving your IDE.
|
|
|
14
14
|
|
|
15
15
|
### For Cursor
|
|
16
16
|
|
|
17
|
-
Add to your `~/.cursor/mcp.json
|
|
17
|
+
Add to your `~/.cursor/mcp.json` (or `C:\Users\YourName\.cursor\mcp.json` on Windows):
|
|
18
18
|
|
|
19
19
|
```json
|
|
20
20
|
{
|
|
21
21
|
"mcpServers": {
|
|
22
22
|
"architectgbt": {
|
|
23
23
|
"command": "npx",
|
|
24
|
-
"args": ["architectgbt-mcp"]
|
|
24
|
+
"args": ["-y", "architectgbt-mcp"]
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
**Important:** Restart Cursor completely after adding the configuration.
|
|
31
|
+
|
|
30
32
|
### For Claude Desktop
|
|
31
33
|
|
|
32
34
|
Add to your Claude Desktop config (`%APPDATA%\Claude\claude_desktop_config.json` on Windows):
|
|
@@ -59,32 +61,102 @@ Add to your MCP configuration:
|
|
|
59
61
|
|
|
60
62
|
## Available Tools
|
|
61
63
|
|
|
62
|
-
### `
|
|
64
|
+
### `list_models`
|
|
63
65
|
|
|
64
|
-
|
|
66
|
+
List available AI models with pricing information.
|
|
65
67
|
|
|
66
68
|
**Example prompts:**
|
|
67
|
-
- "
|
|
68
|
-
- "
|
|
69
|
-
- "
|
|
69
|
+
- "List all Anthropic models"
|
|
70
|
+
- "Show me all models"
|
|
71
|
+
- "What OpenAI models are available?"
|
|
72
|
+
|
|
73
|
+
**Example output:**
|
|
74
|
+
```
|
|
75
|
+
## š Available AI Models
|
|
76
|
+
|
|
77
|
+
| Model | Provider | Input $/1M | Output $/1M |
|
|
78
|
+
|-------|----------|------------|-------------|
|
|
79
|
+
| Claude Haiku 4.5 | Anthropic | $0.80 | $4.00 |
|
|
80
|
+
| Claude Opus 4.5 | Anthropic | $15.00 | $75.00 |
|
|
81
|
+
| Claude Sonnet 4.5 | Anthropic | $3.00 | $15.00 |
|
|
82
|
+
| GPT-4o | OpenAI | $2.50 | $10.00 |
|
|
83
|
+
| GPT-4o mini | OpenAI | $0.15 | $0.60 |
|
|
84
|
+
...
|
|
85
|
+
|
|
86
|
+
*Showing 10 models. Use `get_ai_recommendation` for personalized suggestions.*
|
|
87
|
+
```
|
|
70
88
|
|
|
71
89
|
### `get_code_template`
|
|
72
90
|
|
|
73
91
|
Get production-ready integration code for any AI model.
|
|
74
92
|
|
|
93
|
+
**Supported providers:** Anthropic (Claude), OpenAI (GPT), Google (Gemini)
|
|
94
|
+
**Languages:** TypeScript, Python
|
|
95
|
+
|
|
75
96
|
**Example prompts:**
|
|
76
97
|
- "Give me a TypeScript template for Claude"
|
|
77
98
|
- "Python code for OpenAI GPT-4"
|
|
78
99
|
- "Gemini integration in TypeScript"
|
|
79
100
|
|
|
80
|
-
|
|
101
|
+
**Example output:**
|
|
102
|
+
```typescript
|
|
103
|
+
// ā
Installation
|
|
104
|
+
npm install @anthropic-ai/sdk
|
|
81
105
|
|
|
82
|
-
|
|
106
|
+
// š Environment Variables
|
|
107
|
+
ANTHROPIC_API_KEY=your_api_key_here
|
|
108
|
+
|
|
109
|
+
// š¦ Code
|
|
110
|
+
import Anthropic from '@anthropic-ai/sdk';
|
|
111
|
+
|
|
112
|
+
const client = new Anthropic({
|
|
113
|
+
apiKey: process.env.ANTHROPIC_API_KEY,
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const message = await client.messages.create({
|
|
117
|
+
model: 'claude-3-5-sonnet-20241022',
|
|
118
|
+
max_tokens: 1024,
|
|
119
|
+
messages: [
|
|
120
|
+
{ role: 'user', content: 'Hello, Claude!' }
|
|
121
|
+
],
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
console.log(message.content);
|
|
125
|
+
|
|
126
|
+
// š” Usage Tips
|
|
127
|
+
// - Use streaming for real-time responses
|
|
128
|
+
// - Add system prompts for better control
|
|
129
|
+
// - Handle rate limits with retries
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### `get_ai_recommendation`
|
|
133
|
+
|
|
134
|
+
Get personalized AI model recommendations based on your project description.
|
|
135
|
+
|
|
136
|
+
**Note:** Requires authentication. For full recommendations with cost analysis and reasoning, visit [architectgbt.com](https://architectgbt.com) and sign up for a free account.
|
|
83
137
|
|
|
84
138
|
**Example prompts:**
|
|
85
|
-
- "
|
|
86
|
-
- "
|
|
87
|
-
- "
|
|
139
|
+
- "What AI model should I use for a customer support chatbot?"
|
|
140
|
+
- "Recommend a model for code generation on a budget"
|
|
141
|
+
- "Best model for document analysis with 100K context?"
|
|
142
|
+
|
|
143
|
+
**Example response:**
|
|
144
|
+
```
|
|
145
|
+
ā Authentication Required
|
|
146
|
+
|
|
147
|
+
The ArchitectGBT API requires authentication. To get AI model recommendations:
|
|
148
|
+
|
|
149
|
+
1. Visit https://architectgbt.com
|
|
150
|
+
2. Sign up for a free account (free tier available!)
|
|
151
|
+
3. Use the website directly for personalized recommendations
|
|
152
|
+
|
|
153
|
+
Alternatively, you can:
|
|
154
|
+
- Use `list_models` to browse available models
|
|
155
|
+
- Use `get_code_template` to get integration code for any model
|
|
156
|
+
|
|
157
|
+
For your query: "customer support chatbot"
|
|
158
|
+
I recommend visiting the website for a personalized analysis with cost estimates and reasoning.
|
|
159
|
+
```
|
|
88
160
|
|
|
89
161
|
## Development
|
|
90
162
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
const API_BASE = process.env.ARCHITECTGBT_API_URL || "https://architectgbt.com";
|
|
3
|
+
const API_KEY = process.env.ARCHITECTGBT_API_KEY;
|
|
3
4
|
export const getRecommendationTool = {
|
|
4
5
|
name: "get_ai_recommendation",
|
|
5
|
-
description: "Analyze a project description and recommend the best AI model with pricing, reasoning, and alternatives.
|
|
6
|
+
description: "Analyze a project description and recommend the best AI model with pricing, reasoning, and alternatives. Free tier: 3 recommendations/day. Add ARCHITECTGBT_API_KEY for unlimited access.",
|
|
6
7
|
inputSchema: {
|
|
7
8
|
type: "object",
|
|
8
9
|
properties: {
|
|
@@ -32,11 +33,19 @@ const InputSchema = z.object({
|
|
|
32
33
|
export async function handleGetRecommendation(args) {
|
|
33
34
|
const input = InputSchema.parse(args);
|
|
34
35
|
try {
|
|
35
|
-
|
|
36
|
+
// Determine which endpoint to use
|
|
37
|
+
const endpoint = API_KEY ? `${API_BASE}/api/recommend` : `${API_BASE}/api/recommend/public`;
|
|
38
|
+
// Build headers
|
|
39
|
+
const headers = {
|
|
40
|
+
"Content-Type": "application/json",
|
|
41
|
+
};
|
|
42
|
+
// Add API key if available
|
|
43
|
+
if (API_KEY) {
|
|
44
|
+
headers["Authorization"] = `Bearer ${API_KEY}`;
|
|
45
|
+
}
|
|
46
|
+
const response = await fetch(endpoint, {
|
|
36
47
|
method: "POST",
|
|
37
|
-
headers
|
|
38
|
-
"Content-Type": "application/json",
|
|
39
|
-
},
|
|
48
|
+
headers,
|
|
40
49
|
body: JSON.stringify({
|
|
41
50
|
prompt: input.prompt,
|
|
42
51
|
budget: input.budget,
|
|
@@ -44,13 +53,27 @@ export async function handleGetRecommendation(args) {
|
|
|
44
53
|
}),
|
|
45
54
|
});
|
|
46
55
|
if (!response.ok) {
|
|
56
|
+
// Handle rate limiting for free tier
|
|
57
|
+
if (response.status === 429) {
|
|
58
|
+
const data = await response.json();
|
|
59
|
+
const resetHeader = response.headers.get('X-RateLimit-Reset');
|
|
60
|
+
const resetTime = resetHeader ? new Date(resetHeader).toLocaleString() : 'tomorrow';
|
|
61
|
+
return {
|
|
62
|
+
content: [
|
|
63
|
+
{
|
|
64
|
+
type: "text",
|
|
65
|
+
text: `š« **Daily Limit Reached**\n\n${data.error?.message || 'You\'ve used all 3 free recommendations today.'}\n\nResets at: ${resetTime}\n\n**Get unlimited access:**\n1. Visit https://architectgbt.com\n2. Sign up for free (10 recommendations/month)\n3. Generate an API key from Settings\n4. Add to your MCP config:\n\`\`\`json\n{\n "mcpServers": {\n "architectgbt": {\n "command": "npx",\n "args": ["-y", "architectgbt-mcp"],\n "env": {\n "ARCHITECTGBT_API_KEY": "your_api_key_here"\n }\n }\n }\n}\n\`\`\`\n\nš” Pro tip: Upgrade to Pro ($15/mo) for unlimited recommendations!`,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
47
70
|
// Handle authentication requirement
|
|
48
|
-
if (response.status === 401) {
|
|
71
|
+
if (response.status === 401 || response.status === 405) {
|
|
49
72
|
return {
|
|
50
73
|
content: [
|
|
51
74
|
{
|
|
52
75
|
type: "text",
|
|
53
|
-
text: `ā **
|
|
76
|
+
text: `ā **API Key Invalid or Expired**\n\nYour API key is not valid. To fix this:\n\n1. Visit https://architectgbt.com/settings\n2. Generate a new API key\n3. Update your MCP config\n\n**Without an API key:**\nYou can still use the free tier (3 recommendations/day). Remove the ARCHITECTGBT_API_KEY from your config.`,
|
|
54
77
|
},
|
|
55
78
|
],
|
|
56
79
|
};
|
|
@@ -58,8 +81,15 @@ export async function handleGetRecommendation(args) {
|
|
|
58
81
|
throw new Error(`API error: ${response.status}`);
|
|
59
82
|
}
|
|
60
83
|
const data = await response.json();
|
|
84
|
+
// Show rate limit info if present
|
|
85
|
+
const remaining = response.headers.get('X-RateLimit-Remaining');
|
|
86
|
+
const limit = response.headers.get('X-RateLimit-Limit');
|
|
61
87
|
// Format the response nicely
|
|
62
|
-
|
|
88
|
+
let result = formatRecommendation(data);
|
|
89
|
+
// Add rate limit footer for free tier
|
|
90
|
+
if (remaining !== null && limit !== null && !API_KEY) {
|
|
91
|
+
result += `\n\n---\nš **Free Tier:** ${remaining}/${limit} recommendations remaining today\nš Get unlimited access at https://architectgbt.com`;
|
|
92
|
+
}
|
|
63
93
|
return {
|
|
64
94
|
content: [{ type: "text", text: result }],
|
|
65
95
|
};
|
|
@@ -53,7 +53,10 @@ export async function handleListModels(args) {
|
|
|
53
53
|
result += `| Model | Provider | Input $/1M | Output $/1M |\n`;
|
|
54
54
|
result += `|-------|----------|------------|-------------|\n`;
|
|
55
55
|
models.forEach((m) => {
|
|
56
|
-
|
|
56
|
+
// Convert per-1K pricing to per-1M for display
|
|
57
|
+
const inputPer1M = m.input_cost_per_1k ? (m.input_cost_per_1k * 1000).toFixed(2) : "?";
|
|
58
|
+
const outputPer1M = m.output_cost_per_1k ? (m.output_cost_per_1k * 1000).toFixed(2) : "?";
|
|
59
|
+
result += `| ${m.name} | ${m.provider} | $${inputPer1M} | $${outputPer1M} |\n`;
|
|
57
60
|
});
|
|
58
61
|
result += `\n*Showing ${models.length} models. Use \`get_ai_recommendation\` for personalized suggestions.*`;
|
|
59
62
|
return {
|