@genlobe/mcp-server 2.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 +116 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +3402 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
noteId: "5546f5b00e1211f1bab5dd288af14df6"
|
|
3
|
+
tags: []
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 🔌 MCP Server for Multi-tenant SaaS API
|
|
8
|
+
|
|
9
|
+
## What is this?
|
|
10
|
+
|
|
11
|
+
This is a **documentation SDK for tenants**. Tenants (developers who build on top of this platform) install this MCP server in their AI-enabled IDEs (GitHub Copilot, Cursor, Claude, etc.) so their AI coding assistants can understand and consume the **end-user API** when building frontend applications for their customers (end-users).
|
|
12
|
+
|
|
13
|
+
**In short:** Tenant installs MCP → AI assistant learns the API → AI helps build the tenant's app faster.
|
|
14
|
+
|
|
15
|
+
This server documents ONLY the **end-user facing endpoints** (API Key + JWT auth). It does NOT document tenant dashboard or admin endpoints, as those are not relevant when building end-user frontends.
|
|
16
|
+
|
|
17
|
+
## ⚠️ Important: Two Types of Endpoints
|
|
18
|
+
|
|
19
|
+
This API has **TWO types of endpoints**:
|
|
20
|
+
|
|
21
|
+
1. **Tenant/Dashboard endpoints** (`/v1/tenant-auth/*`, `/v1/dashboard/*`)
|
|
22
|
+
- For tenant admins managing their SaaS account
|
|
23
|
+
- Uses JWT from tenant login
|
|
24
|
+
- **NOT for end-user frontends — NOT documented by this MCP**
|
|
25
|
+
|
|
26
|
+
2. **End-user endpoints** (`/v1/auth/*`, `/v1/organizations/*`, `/v1/users/*`, etc.)
|
|
27
|
+
- For building frontend applications that serve the tenant's customers
|
|
28
|
+
- Uses API Key (`X-API-Key`) + User JWT
|
|
29
|
+
- **USE THESE for end-user frontends — documented by this MCP**
|
|
30
|
+
|
|
31
|
+
## 🚀 Installation
|
|
32
|
+
|
|
33
|
+
Add this to your project's `.vscode/mcp.json`:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"servers": {
|
|
38
|
+
"multiagent": {
|
|
39
|
+
"command": "npx",
|
|
40
|
+
"args": ["-y", "https://api.your-domain.com/static/mcp-server.tgz"],
|
|
41
|
+
"env": {
|
|
42
|
+
"SAAS_API_URL": "https://api.your-domain.com"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Restart VS Code and you're ready!
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 🛠️ Available Tools
|
|
54
|
+
|
|
55
|
+
| Tool | Description |
|
|
56
|
+
|------|-------------|
|
|
57
|
+
| `get_api_overview` | High-level API architecture overview |
|
|
58
|
+
| `get_end_user_endpoints` | Detailed documentation for end-user endpoints |
|
|
59
|
+
| `get_request_headers` | Required HTTP headers for API requests |
|
|
60
|
+
| `get_sdk_template` | Complete TypeScript SDK template |
|
|
61
|
+
| `get_authentication_flow` | Step-by-step auth implementation guide |
|
|
62
|
+
| `get_common_patterns` | Best practices for frontend development |
|
|
63
|
+
| `search_endpoints` | Search endpoints by keyword |
|
|
64
|
+
| `get_endpoint_details` | Get details of a specific endpoint |
|
|
65
|
+
| `get_openapi_spec` | Full OpenAPI specification from live API |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 📋 Quick Start for AI Assistants
|
|
70
|
+
|
|
71
|
+
When building a frontend for end-users:
|
|
72
|
+
|
|
73
|
+
1. **Call `get_api_overview`** first to understand the architecture
|
|
74
|
+
2. **Call `get_authentication_flow`** to implement login/register
|
|
75
|
+
3. **Call `get_end_user_endpoints`** to see all available endpoints
|
|
76
|
+
4. **Call `get_sdk_template`** to get a ready-to-use API client
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 📦 Local Development
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
cd mcp-server
|
|
84
|
+
npm install
|
|
85
|
+
npm run build
|
|
86
|
+
npm pack # Creates .tgz package
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 📊 End-User Endpoint Coverage
|
|
92
|
+
|
|
93
|
+
Categories currently documented in `get_end_user_endpoints`:
|
|
94
|
+
|
|
95
|
+
| Category | Routes | Status |
|
|
96
|
+
|----------|--------|--------|
|
|
97
|
+
| `authentication` | `/v1/auth/*` | ✅ Complete |
|
|
98
|
+
| `organizations` | `/v1/organizations/*` (incl. subscription, usage, members) | ✅ Complete |
|
|
99
|
+
| `subscriptions` | `/v1/subscriptions/*` | ✅ Complete |
|
|
100
|
+
| `billing` | `/v1/billing/*` | ✅ Complete |
|
|
101
|
+
| `plans` | `/v1/plans/*` | ✅ Complete |
|
|
102
|
+
| `agents` | `/v1/user/agents/*` | ✅ Complete |
|
|
103
|
+
| `users` | `/v1/users/*` | ✅ Complete |
|
|
104
|
+
| `usage` | `/v1/api/usage/*`, `/v1/usage/*` | ✅ Complete |
|
|
105
|
+
| `entities` | `/v1/entity/schemas/*`, `/v1/entity/records/*` | ✅ Complete |
|
|
106
|
+
| `departments` | `/v1/departments/*` | ✅ Complete |
|
|
107
|
+
| `ai` | `/v1/ai/completions` | ✅ Complete |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 🔧 Environment Variables
|
|
112
|
+
|
|
113
|
+
| Variable | Description | Required |
|
|
114
|
+
|----------|-------------|----------|
|
|
115
|
+
| `SAAS_API_URL` | API base URL | Yes |
|
|
116
|
+
| `SAAS_API_KEY` | API Key for accessing protected docs | No |
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MCP Server for Multi-tenant SaaS API
|
|
4
|
+
*
|
|
5
|
+
* This server provides AI assistants with comprehensive API documentation
|
|
6
|
+
* and tools to understand how to build frontends using this API.
|
|
7
|
+
*
|
|
8
|
+
* The API has TWO types of endpoints:
|
|
9
|
+
* 1. TENANT/DASHBOARD endpoints - For tenant admins (JWT auth from dashboard login)
|
|
10
|
+
* 2. END-USER endpoints - For end-users of tenants (API Key + optional JWT)
|
|
11
|
+
*
|
|
12
|
+
* When building a frontend for END-USERS of a tenant, you should ONLY use
|
|
13
|
+
* the End-user endpoints, NOT the Tenant/Dashboard endpoints.
|
|
14
|
+
*
|
|
15
|
+
* Usage:
|
|
16
|
+
* npx @multiagent/mcp-server
|
|
17
|
+
*
|
|
18
|
+
* Or configure in VS Code MCP settings with SAAS_API_URL environment variable.
|
|
19
|
+
*/
|
|
20
|
+
export {};
|