@rebasepro/mcp-server 0.3.0 → 0.5.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 +113 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# @rebasepro/mcp-server
|
|
2
|
+
|
|
3
|
+
Model Context Protocol (MCP) server that exposes Rebase schema, database, document CRUD, user management, and dev server tools to AI assistants.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @rebasepro/mcp-server
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or run directly:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx rebase-mcp
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## What This Package Does
|
|
18
|
+
|
|
19
|
+
`@rebasepro/mcp-server` implements the [Model Context Protocol](https://modelcontextprotocol.io) over stdio, allowing AI assistants (Gemini, Claude, Cursor, etc.) to interact with a Rebase project. It provides 20 tools across four categories and exposes collection definitions and generated schemas as MCP resources.
|
|
20
|
+
|
|
21
|
+
## Configuration
|
|
22
|
+
|
|
23
|
+
The server reads configuration from environment variables and `.env` files:
|
|
24
|
+
|
|
25
|
+
| Variable | Default | Description |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| `REBASE_PROJECT_DIR` | `process.cwd()` | Project root directory |
|
|
28
|
+
| `REBASE_BASE_URL` | `http://localhost:3001` | Rebase backend URL |
|
|
29
|
+
| `REBASE_API_TOKEN` / `REBASE_TOKEN` | (empty) | Auth token for API calls |
|
|
30
|
+
|
|
31
|
+
The server attempts to load `.env` from `$REBASE_PROJECT_DIR/.env` or `$REBASE_PROJECT_DIR/app/.env`.
|
|
32
|
+
|
|
33
|
+
## Tools
|
|
34
|
+
|
|
35
|
+
### CLI Tools (6)
|
|
36
|
+
|
|
37
|
+
Spawn `npx rebase <command>` in the project directory.
|
|
38
|
+
|
|
39
|
+
| Tool | Description |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `rebase_schema_generate` | Generate Drizzle schema from collection definitions |
|
|
42
|
+
| `rebase_db_push` | Apply schema directly to DB (dev shortcut) |
|
|
43
|
+
| `rebase_schema_introspect` | Introspect live DB → collection definitions |
|
|
44
|
+
| `rebase_db_generate` | Generate SQL migration files from schema diff |
|
|
45
|
+
| `rebase_db_migrate` | Run pending SQL migrations |
|
|
46
|
+
| `rebase_generate_sdk` | Generate typed TypeScript SDK |
|
|
47
|
+
|
|
48
|
+
### Data Tools (5)
|
|
49
|
+
|
|
50
|
+
CRUD operations via `@rebasepro/client`.
|
|
51
|
+
|
|
52
|
+
| Tool | Required Args | Description |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| `list_documents` | `collection` | List with optional `limit`, `offset`, `orderBy`, `where` |
|
|
55
|
+
| `get_document` | `collection`, `id` | Get single document by ID |
|
|
56
|
+
| `create_document` | `collection`, `data` | Create a new document |
|
|
57
|
+
| `update_document` | `collection`, `id`, `data` | Update existing document |
|
|
58
|
+
| `delete_document` | `collection`, `id` | Delete a document |
|
|
59
|
+
|
|
60
|
+
### Admin Tools (5)
|
|
61
|
+
|
|
62
|
+
User and role management.
|
|
63
|
+
|
|
64
|
+
| Tool | Required Args | Description |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| `list_users` | (none) | List all users with roles |
|
|
67
|
+
| `create_user` | `email` | Create user (optional: `displayName`, `password`, `roles`) |
|
|
68
|
+
| `update_user` | `userId` | Update user (optional: `email`, `displayName`, `roles`) |
|
|
69
|
+
| `delete_user` | `userId` | Delete a user |
|
|
70
|
+
| `list_roles` | (none) | List all defined roles |
|
|
71
|
+
|
|
72
|
+
### Dev Server Tools (3)
|
|
73
|
+
|
|
74
|
+
Manage the local development server.
|
|
75
|
+
|
|
76
|
+
| Tool | Description |
|
|
77
|
+
|---|---|
|
|
78
|
+
| `rebase_dev_start` | Start `pnpm run dev` in the `app/` directory |
|
|
79
|
+
| `rebase_dev_logs` | Read recent output (default: 50 lines, max buffer: 500) |
|
|
80
|
+
| `rebase_dev_stop` | Send SIGTERM to the dev server process |
|
|
81
|
+
|
|
82
|
+
## Resources
|
|
83
|
+
|
|
84
|
+
The server exposes MCP resources for AI context:
|
|
85
|
+
|
|
86
|
+
| URI | Description |
|
|
87
|
+
|---|---|
|
|
88
|
+
| `rebase://collections/{name}` | TypeScript source of a collection definition |
|
|
89
|
+
| `rebase://schema` | Generated Drizzle schema (`schema.generated.ts`) |
|
|
90
|
+
|
|
91
|
+
Collection files are discovered from `app/config/collections/`, `config/collections/`, or `collections/` under the project directory.
|
|
92
|
+
|
|
93
|
+
## Quick Start
|
|
94
|
+
|
|
95
|
+
Add to your AI assistant's MCP config (e.g. `.gemini/settings.json`):
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"mcpServers": {
|
|
100
|
+
"rebase": {
|
|
101
|
+
"command": "npx",
|
|
102
|
+
"args": ["rebase-mcp"],
|
|
103
|
+
"env": {
|
|
104
|
+
"REBASE_PROJECT_DIR": "/path/to/your/project"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Related Packages
|
|
112
|
+
|
|
113
|
+
- `@rebasepro/client` — Used internally for data and admin API calls
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Model Context Protocol Server for Rebase — exposes schema, DB, document, and user management tools to AI assistants.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
13
13
|
"dotenv": "^16.6.1",
|
|
14
|
-
"@rebasepro/client": "0.
|
|
14
|
+
"@rebasepro/client": "0.5.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@types/node": "^20.19.41",
|