@agentlify/mcp-server 2.0.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 ADDED
@@ -0,0 +1,230 @@
1
+ # Agentlify MCP Server
2
+
3
+ Model Context Protocol server for Agentlify - enables AI coding assistants to integrate Agentlify directly into developer workflows.
4
+
5
+ ## Features
6
+
7
+ - ๐Ÿ”„ **Code Migration** - Convert OpenAI/Anthropic code to Agentlify
8
+ - ๐ŸŽฏ **Router Management** - Create and configure AI model routers
9
+ - ๐Ÿงช **Live Testing** - Test routers with real requests and see cost breakdowns
10
+ - ๐Ÿ“Š **Usage Analytics** - Track spending and get optimization tips
11
+ - ๐Ÿ’ฐ **Cost Optimization** - Get recommendations to reduce AI costs
12
+ - ๐Ÿ” **Model Comparison** - Compare models on cost, quality, and speed
13
+ - ๐Ÿ’ณ **Balance Checking** - View credits and subscription status
14
+ - ๐Ÿ’ป **Code Generation** - Generate production-ready integration code
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install -g @agentlify/mcp-server
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ ### 1. Get your Agentlify API Key
25
+
26
+ Sign up at [agentlify.app](https://agentlify.app) and create an API key in the dashboard.
27
+
28
+ ### 2. Configure in your AI Assistant
29
+
30
+ #### For Cascade / Windsurf
31
+
32
+ Add to your MCP settings:
33
+
34
+ ```json
35
+ {
36
+ "mcpServers": {
37
+ "agentlify": {
38
+ "command": "agentlify-mcp",
39
+ "env": {
40
+ "AGENTLIFY_API_KEY": "mp_your-api-key-here"
41
+ }
42
+ }
43
+ }
44
+ }
45
+ ```
46
+
47
+ #### For Cline
48
+
49
+ Add to `~/.cline/mcp.json`:
50
+
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "agentlify": {
55
+ "command": "npx",
56
+ "args": ["-y", "@agentlify/mcp-server"],
57
+ "env": {
58
+ "AGENTLIFY_API_KEY": "mp_your-api-key-here"
59
+ }
60
+ }
61
+ }
62
+ }
63
+ ```
64
+
65
+ ### 3. Start Using!
66
+
67
+ Talk to your AI assistant:
68
+
69
+ ```
70
+ "Migrate this OpenAI code to Agentlify"
71
+ "Create a cost-optimized router for my chatbot"
72
+ "Test my router with this prompt and show me the cost"
73
+ "How can I reduce my AI costs?"
74
+ ```
75
+
76
+ ## Available Tools
77
+
78
+ ### migrate_code
79
+
80
+ Convert OpenAI or Anthropic SDK code to Agentlify. Shows converted code and estimated cost savings.
81
+
82
+ **Example:**
83
+
84
+ ```
85
+ User: "Migrate this code to Agentlify: [paste OpenAI code]"
86
+ AI: [Shows converted code] "This will save you ~45% on costs"
87
+ ```
88
+
89
+ ### create_router
90
+
91
+ Create a new AI model router with guided configuration.
92
+
93
+ **Example:**
94
+
95
+ ```
96
+ User: "Create a cost-optimized router for my chatbot"
97
+ AI: "What models would you like to include?"
98
+ User: "GPT-4o-mini and Claude 3.5 Sonnet"
99
+ AI: [Creates router] "Router created! Here's your sample code..."
100
+ ```
101
+
102
+ ### test_request
103
+
104
+ Test a router with a real request. Returns response, cost, latency, and model used.
105
+
106
+ **Example:**
107
+
108
+ ```
109
+ User: "Test my router 'chatbot-123' with: Hello, how are you?"
110
+ AI: [Shows response] "Cost: $0.0008 | Model: gpt-4o-mini | Latency: 450ms"
111
+ ```
112
+
113
+ ### get_usage_summary
114
+
115
+ View usage statistics and costs for the last 24h, 7d, or 30d.
116
+
117
+ **Example:**
118
+
119
+ ```
120
+ User: "Show my usage for the last 7 days"
121
+ AI: "Total: $12.45 | 1,234 requests | Top model: GPT-4o-mini (65%)"
122
+ ```
123
+
124
+ ### optimize_router
125
+
126
+ Get cost-saving recommendations for a router.
127
+
128
+ **Example:**
129
+
130
+ ```
131
+ User: "How can I optimize my chatbot router?"
132
+ AI: "Switch to GPT-4-Turbo โ†’ Save $45/month | Enable cost-optimized routing"
133
+ ```
134
+
135
+ ### compare_models
136
+
137
+ Compare models side-by-side on cost, quality, and speed.
138
+
139
+ **Example:**
140
+
141
+ ```
142
+ User: "Compare GPT-4o vs Claude 3.5 Sonnet vs Gemini Pro"
143
+ AI: [Shows comparison table] "Gemini Pro is cheapest, Claude 3.5 Sonnet has best quality"
144
+ ```
145
+
146
+ ### get_balance
147
+
148
+ Check current credit balance and subscription status.
149
+
150
+ **Example:**
151
+
152
+ ```
153
+ User: "What's my balance?"
154
+ AI: "Balance: $45.67 | Subscription: Pro | This month: $12.34 spent"
155
+ ```
156
+
157
+ ### generate_integration_code
158
+
159
+ Generate production-ready code in Python, JavaScript, or TypeScript.
160
+
161
+ **Example:**
162
+
163
+ ```
164
+ User: "Generate Python code for my router with error handling and retries"
165
+ AI: [Generates complete code with retries, error handling, and examples]
166
+ ```
167
+
168
+ ## Documentation
169
+
170
+ The MCP server includes 10 comprehensive documentation resources:
171
+
172
+ - **Quickstart Guide** - Get started in 5 minutes
173
+ - **OpenAI Migration** - Complete migration guide from OpenAI
174
+ - **Anthropic Migration** - Complete migration guide from Anthropic
175
+ - **Router Configuration** - Best practices for router setup
176
+ - **Python SDK** - Full Python SDK reference
177
+ - **JavaScript SDK** - Full JavaScript SDK reference
178
+ - **Routing Strategies** - Understanding cost/quality/speed optimization
179
+ - **Cost Optimization** - Top strategies for reducing costs
180
+ - **Chatbot Example** - Production chatbot implementation
181
+ - **Pricing Guide** - Understanding billing and pricing
182
+
183
+ Access via:
184
+
185
+ ```
186
+ User: "Show me the OpenAI migration guide"
187
+ AI: [Displays agentlify://migration/openai]
188
+ ```
189
+
190
+ ## Development
191
+
192
+ ### Setup
193
+
194
+ ```bash
195
+ cd agentlify-mcp
196
+ npm install
197
+ ```
198
+
199
+ ### Development Mode
200
+
201
+ ```bash
202
+ npm run dev
203
+ ```
204
+
205
+ ### Build
206
+
207
+ ```bash
208
+ npm run build
209
+ ```
210
+
211
+ ### Test Locally
212
+
213
+ ```bash
214
+ AGENTLIFY_API_KEY=mp_your-key npm start
215
+ ```
216
+
217
+ ## Requirements
218
+
219
+ - Node.js 18+
220
+ - Agentlify API key
221
+
222
+ ## Support
223
+
224
+ - **Documentation**: [docs.agentlify.app](https://docs.agentlify.app)
225
+ - **Dashboard**: [agentlify.app/dashboard](https://agentlify.app/dashboard)
226
+ - **Support**: support@agentlify.app
227
+
228
+ ## License
229
+
230
+ MIT
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Agentlify MCP Server
4
+ * Provides AI assistants with access to Agentlify features via Model Context Protocol
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG"}