@rebasepro/mcp-server 0.6.1 → 0.7.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 CHANGED
@@ -16,7 +16,15 @@ npx rebase-mcp
16
16
 
17
17
  ## What This Package Does
18
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.
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 tools and exposes collection definitions and generated schemas as MCP resources. It has native support for managing multiple local and remote projects.
20
+
21
+ ## Multi-Project Support
22
+
23
+ The MCP server supports managing multiple Rebase projects simultaneously. This is ideal when working in an IDE with multiple open workspaces or when interacting with both local development servers and remote staging/production environments.
24
+
25
+ - **Registry**: Project configurations are stored in `~/.rebase/projects.json`.
26
+ - **Auto-Discovery**: If `rebase dev` is running locally, the MCP server automatically discovers the active development port and service key from `.rebase/state.json` inside the project directory, giving you **zero-config local development**.
27
+ - **Default Project**: If no project registry exists, a default project named `default` is created using `REBASE_PROJECT_DIR` (or current working directory), `REBASE_BASE_URL`, and `REBASE_API_TOKEN`.
20
28
 
21
29
  ## Configuration
22
30
 
@@ -24,17 +32,32 @@ The server reads configuration from environment variables and `.env` files:
24
32
 
25
33
  | Variable | Default | Description |
26
34
  |---|---|---|
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 |
35
+ | `REBASE_PROJECT_DIR` | `process.cwd()` | Project root directory (fallback if no registry) |
36
+ | `REBASE_BASE_URL` | `http://localhost:3001` | Rebase backend URL (fallback if no registry) |
37
+ | `REBASE_API_TOKEN` / `REBASE_TOKEN` | (empty) | Auth token for API calls (fallback if no registry) |
30
38
 
31
39
  The server attempts to load `.env` from `$REBASE_PROJECT_DIR/.env` or `$REBASE_PROJECT_DIR/app/.env`.
32
40
 
41
+ ---
42
+
33
43
  ## Tools
34
44
 
45
+ ### Project Management Tools (6) [NEW]
46
+
47
+ Manage multiple local projects or remote environments.
48
+
49
+ | Tool | Required Args | Description |
50
+ |---|---|---|
51
+ | `rebase_project_list` | (none) | List all registered projects and show which one is currently active |
52
+ | `rebase_project_switch` | `name` | Switch the active project to another registered project |
53
+ | `rebase_project_add` | `name` | Register a new project (requires `baseUrl` and optional `projectDir`, `token`/`serviceKey`) |
54
+ | `rebase_project_remove` | `name` | Remove a project from the registry (cannot remove the default project) |
55
+ | `rebase_project_current` | (none) | Show details of the active project (name, directory, base URL, auth token status) |
56
+ | `rebase_project_status` | (none) | Perform a health check on the active project's backend URL |
57
+
35
58
  ### CLI Tools (6)
36
59
 
37
- Spawn `npx rebase <command>` in the project directory.
60
+ Spawn `npx rebase <command>` in the active project directory.
38
61
 
39
62
  | Tool | Description |
40
63
  |---|---|
@@ -47,7 +70,7 @@ Spawn `npx rebase <command>` in the project directory.
47
70
 
48
71
  ### Data Tools (5)
49
72
 
50
- CRUD operations via `@rebasepro/client`.
73
+ CRUD operations via `@rebasepro/client` on the active project.
51
74
 
52
75
  | Tool | Required Args | Description |
53
76
  |---|---|---|
@@ -57,7 +80,7 @@ CRUD operations via `@rebasepro/client`.
57
80
  | `update_document` | `collection`, `id`, `data` | Update existing document |
58
81
  | `delete_document` | `collection`, `id` | Delete a document |
59
82
 
60
- ### Admin Tools (5)
83
+ ### Admin Tools (6)
61
84
 
62
85
  User and role management.
63
86
 
@@ -68,6 +91,10 @@ User and role management.
68
91
  | `update_user` | `userId` | Update user (optional: `email`, `displayName`, `roles`) |
69
92
  | `delete_user` | `userId` | Delete a user |
70
93
  | `list_roles` | (none) | List all defined roles |
94
+ | `rebase_auth_reset_password` | `email` | Reset a user's password using the admin API (optional: `password`) |
95
+
96
+ > [!NOTE]
97
+ > `rebase_auth_reset_password` now calls the running admin endpoint instead of performing direct database queries. This makes it compatible with both local development and remote servers.
71
98
 
72
99
  ### Dev Server Tools (3)
73
100
 
@@ -79,6 +106,8 @@ Manage the local development server.
79
106
  | `rebase_dev_logs` | Read recent output (default: 50 lines, max buffer: 500) |
80
107
  | `rebase_dev_stop` | Send SIGTERM to the dev server process |
81
108
 
109
+ ---
110
+
82
111
  ## Resources
83
112
 
84
113
  The server exposes MCP resources for AI context:
@@ -88,7 +117,7 @@ The server exposes MCP resources for AI context:
88
117
  | `rebase://collections/{name}` | TypeScript source of a collection definition |
89
118
  | `rebase://schema` | Generated Drizzle schema (`schema.generated.ts`) |
90
119
 
91
- Collection files are discovered from `app/config/collections/`, `config/collections/`, or `collections/` under the project directory.
120
+ Collection files are discovered from `app/config/collections/`, `config/collections/`, or `collections/` under the active project directory.
92
121
 
93
122
  ## Quick Start
94
123
 
@@ -111,3 +140,4 @@ Add to your AI assistant's MCP config (e.g. `.gemini/settings.json`):
111
140
  ## Related Packages
112
141
 
113
142
  - `@rebasepro/client` — Used internally for data and admin API calls
143
+
package/bin/rebase-mcp.js CHANGED
File without changes
package/dist/index.d.ts CHANGED
@@ -15,6 +15,18 @@ export declare function getRunCommand(pm: PackageManager): {
15
15
  command: string;
16
16
  args: string[];
17
17
  };
18
+ /** Configuration for a single Rebase project. */
19
+ export interface ProjectConfig {
20
+ name: string;
21
+ /** Absolute path to the project directory (for local projects). */
22
+ projectDir?: string;
23
+ /** Backend URL (e.g. http://localhost:3001 or https://staging.myapp.com). */
24
+ baseUrl: string;
25
+ /** Auth token — a service key, API key, or JWT. */
26
+ token: string;
27
+ /** ISO timestamp when the project was registered. */
28
+ addedAt: string;
29
+ }
18
30
  export declare const server: Server<{
19
31
  method: string;
20
32
  params?: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.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