slima-mcp 0.1.15 → 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 CHANGED
@@ -51,34 +51,49 @@ Connect your Slima books to **any MCP-compatible AI tool** - one server, all pla
51
51
 
52
52
  ## Quick Start
53
53
 
54
- ### 1. Install
54
+ **Pick the path that matches how you use AI:**
55
55
 
56
- ```bash
57
- npm install -g slima-mcp
58
- ```
56
+ - ⭐ Use **claude.ai / ChatGPT in a web browser** → [Recommended: web connector](#recommended-claudeai--chatgpt-web-auto-updating) *(one-time setup, auto-updates forever)*
57
+ - Use **Claude Desktop / Cursor / Gemini CLI locally** → [Local install with `npx`](#local-claude-desktop--cursor--gemini-cli)
58
+ - Running in air-gapped / enterprise environments → [Self-host](#self-host-advanced)
59
59
 
60
- Or run directly with npx:
60
+ ### Recommended: claude.ai / ChatGPT Web (auto-updating)
61
61
 
62
- ```bash
63
- npx slima-mcp
64
- ```
62
+ If you chat with Claude or ChatGPT in a browser, this is the easiest and most future-proof option. **Configure once and you will automatically get every Slima MCP update** — no upgrade commands, no config edits.
65
63
 
66
- ### 2. Get Your API Token
64
+ **MCP URL:** `https://mcp.slima.ai/mcp`
67
65
 
68
- ```bash
69
- slima-mcp auth
70
- ```
66
+ #### claude.ai (Pro / Max / Team / Enterprise)
67
+
68
+ 1. Sign in at [claude.ai](https://claude.ai).
69
+ 2. Open **Settings → Connectors** (or **Integrations** depending on your plan).
70
+ 3. Click **Add custom connector**.
71
+ 4. Fill in:
72
+ - **Name:** `Slima`
73
+ - **URL:** `https://mcp.slima.ai/mcp`
74
+ 5. Click **Connect** → you will be redirected to slima.ai to approve → return to claude.ai.
75
+ 6. The Slima tools icon appears in your chat input. You're done.
76
+
77
+ #### ChatGPT (Plus / Pro, Developer Mode)
78
+
79
+ 1. Sign in at [chatgpt.com](https://chatgpt.com).
80
+ 2. Open **Settings → Connectors → Advanced** and toggle **Developer Mode** on (2025.10+).
81
+ 3. Back in **Connectors**, click **Create → Custom MCP Server**.
82
+ 4. Fill in:
83
+ - **Name:** `Slima`
84
+ - **Server URL:** `https://mcp.slima.ai/mcp`
85
+ - **Authentication:** OAuth
86
+ 5. Click **Create** → approve the OAuth flow.
87
+
88
+ After setup, Slima features roll out automatically on your next conversation. No restarts, no reinstalls.
71
89
 
72
- This will open your browser to authenticate with Slima. Your token will be saved automatically.
90
+ ---
73
91
 
74
- **Or manually:**
75
- 1. Go to [Slima Settings](https://app.slima.ai/settings/api-tokens)
76
- 2. Click "Generate API Token"
77
- 3. Copy the token
92
+ ### Local: Claude Desktop / Cursor / Gemini CLI
78
93
 
79
- ### 3. Configure Your AI Tool
94
+ Use this if you want offline-friendly operation, faster startup, or you need to run MCP alongside other stdio servers.
80
95
 
81
- If you used `slima-mcp auth`, the token is saved automatically. Just add:
96
+ **Recommended config** — pinned to the major version so you pick up new features automatically but never break on a `1.0` release:
82
97
 
83
98
  #### Claude Desktop
84
99
 
@@ -89,24 +104,28 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) o
89
104
  "mcpServers": {
90
105
  "slima": {
91
106
  "command": "npx",
92
- "args": ["-y", "slima-mcp"]
107
+ "args": ["-y", "slima-mcp@0"],
108
+ "env": {
109
+ "SLIMA_API_TOKEN": "slima_your_token_here"
110
+ }
93
111
  }
94
112
  }
95
113
  }
96
114
  ```
97
115
 
98
- That's it! No environment variables needed.
116
+ Get your token from [Slima Settings](https://app.slima.ai/settings/api-tokens) or run `npx slima-mcp@0 auth` once to save it to disk.
99
117
 
100
118
  #### Cursor
101
119
 
102
- Add to Cursor's MCP configuration:
103
-
104
120
  ```json
105
121
  {
106
122
  "mcpServers": {
107
123
  "slima": {
108
124
  "command": "npx",
109
- "args": ["-y", "slima-mcp"]
125
+ "args": ["-y", "slima-mcp@0"],
126
+ "env": {
127
+ "SLIMA_API_TOKEN": "slima_your_token_here"
128
+ }
110
129
  }
111
130
  }
112
131
  }
@@ -115,75 +134,63 @@ Add to Cursor's MCP configuration:
115
134
  #### Gemini CLI
116
135
 
117
136
  ```bash
118
- gemini mcp add slima --command "npx -y slima-mcp"
137
+ gemini mcp add slima --command "npx -y slima-mcp@0"
119
138
  ```
120
139
 
121
- <details>
122
- <summary>Alternative: Using environment variables</summary>
140
+ > **Why `slima-mcp@0` instead of `slima-mcp` / `slima-mcp@latest`?** Using `@0` pins to the current major version — npx still fetches new `0.x.y` releases automatically (so you get features + bug fixes), but when we ship `1.0.0` with breaking changes you won't silently pick it up without updating your config. We'll announce the `@1` switch in the release notes.
123
141
 
124
- If you prefer to use environment variables instead of `slima-mcp auth`:
142
+ #### Migrating from a global install
125
143
 
126
- ```json
127
- {
128
- "mcpServers": {
129
- "slima": {
130
- "command": "npx",
131
- "args": ["-y", "slima-mcp"],
132
- "env": {
133
- "SLIMA_API_TOKEN": "slima_your_token_here"
134
- }
135
- }
136
- }
137
- }
144
+ If you already installed globally with `npm install -g slima-mcp`:
145
+
146
+ ```bash
147
+ # Remove the old global install (optional but cleaner)
148
+ npm uninstall -g slima-mcp
149
+
150
+ # Change your config `command` from "slima-mcp" to the npx form above, and restart the client.
138
151
  ```
139
152
 
140
- Get your token from [Slima Settings](https://app.slima.ai/settings/api-tokens).
153
+ Or, if you want to stay on a global install, remember to periodically run:
154
+
155
+ ```bash
156
+ npm install -g slima-mcp@latest
157
+ ```
141
158
 
142
- </details>
159
+ Otherwise your local client will drift from the MCP tools/schema the Slima backend exposes.
143
160
 
144
- ### 4. Restart Your AI Tool
161
+ ### Self-host (advanced)
145
162
 
146
- After saving the configuration, restart the application to load Slima MCP.
163
+ You can also clone this repo and deploy the Cloudflare Worker yourself. See `wrangler.toml` + `npm run deploy:worker`. Not required for normal use.
147
164
 
148
165
  ---
149
166
 
150
- ## Web Applications (Remote MCP)
167
+ ## Remote MCP Security
151
168
 
152
- For web-based AI tools like Claude.ai and ChatGPT, use our hosted Remote MCP Server.
169
+ The hosted Remote MCP Server at `https://mcp.slima.ai/mcp` uses:
153
170
 
154
- ### One-Click Connection
171
+ - **OAuth 2.0 + PKCE** for authentication — no tokens copy-pasted.
172
+ - **No secrets stored server-side** — credentials never leave Slima's auth server.
173
+ - **Session-based**: OAuth tokens are stored in Cloudflare KV, scoped per session.
174
+ - **Revocable anytime** from [Slima Settings](https://app.slima.ai/settings/api-tokens).
155
175
 
156
- 1. In your AI tool, add a new MCP server
157
- 2. Enter the URL: `https://mcp.slima.ai/mcp`
158
- 3. Click "Connect" - you'll be redirected to Slima
159
- 4. Log in (or sign up) and click "Allow"
160
- 5. Done! No token copying needed
176
+ ---
161
177
 
162
- ### How It Works
178
+ ## Book Types: Writing Studio vs Script Studio
163
179
 
164
- ```
165
- ┌─────────────────────────────────────────────────────────┐
166
- │ Claude.ai / ChatGPT Web │
167
- │ │
168
- │ 1. Click "Connect MCP Server" │
169
- │ 2. Enter: https://mcp.slima.ai/mcp │
170
- │ ↓ │
171
- │ 3. Redirect to Slima login │
172
- │ ↓ │
173
- │ 4. Approve authorization │
174
- │ ↓ │
175
- │ 5. Automatically connected! │
176
- │ │
177
- │ No API tokens. No configuration. Just works. │
178
- └─────────────────────────────────────────────────────────┘
179
- ```
180
+ Slima books come in two flavors, distinguished by the `book_type` field. MCP behaves slightly differently for each:
181
+
182
+ | | 📖 Writing Studio (`book_type: "book"`) | 📝 Script Studio (`book_type: "script"`) |
183
+ |---|---|---|
184
+ | **Creation via MCP** | ✅ `create_book` works | ❌ use the Slima app UI |
185
+ | **Read** (any file) | ✅ | ✅ |
186
+ | **Write / Edit / Delete** | ✅ any path | ✅ only under `.script_studio/planning/**/*` |
187
+ | Structured files (`series.json`, `*.character`, `*.scene`, `*.storyline`, `*.note`, `*.location`, `season.json`, `episode.json`) | n/a | ❌ read-only via MCP — edits must go through the Script Studio UI |
188
+ | `analyze_chapter` (AI Beta Reader) | ✅ | ❌ not yet supported on structured scenes |
189
+ | `search_content` | all files | structured files excluded by default; pass `include_structured: true` to include them |
180
190
 
181
- ### Security
191
+ For per-book details, ask your AI client to read the resource `slima://books/{book_token}/schema` — it returns a JSON spec of exactly which paths are writable/read-only for that specific book.
182
192
 
183
- - **OAuth 2.0 + PKCE**: Industry-standard secure authentication
184
- - **No Secrets Stored**: The server never stores your credentials
185
- - **Session-Based**: Your token is stored securely in Cloudflare KV
186
- - **Revocable**: Revoke access anytime from [Slima Settings](https://app.slima.ai/settings/api-tokens)
193
+ `list_books` tags every book with its studio icon (📝 / 📖) so you (and the AI) can tell them apart at a glance.
187
194
 
188
195
  ---
189
196