Skip to content

Commit a26cb96

Browse files
committed
docs: clarify uvx and token setup
1 parent 51813fa commit a26cb96

3 files changed

Lines changed: 136 additions & 66 deletions

File tree

README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,19 @@ send_message(
9595

9696
### Quick Install with uvx (Recommended)
9797

98-
Install directly from PyPI:
98+
Use the published PyPI package by default:
9999

100100
```bash
101101
uvx pararam-nexus-mcp
102102
```
103103

104-
Or install from GitHub:
104+
For unreleased development snapshots, you can run directly from GitHub:
105105

106106
```bash
107107
uvx --from git+https://github.com/ivolnistov/pararam-nexus-mcp pararam-nexus-mcp
108108
```
109109

110-
Or clone to a specific directory (e.g., `~/.mcp/`):
110+
For local development, clone the repository and install dependencies:
111111

112112
```bash
113113
git clone https://github.com/ivolnistov/pararam-nexus-mcp.git ~/.mcp/pararam-nexus-mcp
@@ -163,6 +163,13 @@ user lookups, global search, and file ops are excluded.
163163
PARARAM_USER_TOKEN=your_service_token
164164
```
165165

166+
To get a service token in Pararam:
167+
168+
1. Open the Pararam **Info Chat** bot documentation.
169+
2. In **User Tokens**, run **Create new token** (`bot://cmd_create_user_token?title=Create+new+token&conf=True`).
170+
3. InfoBot will reply with `New user token - ...`.
171+
4. Copy that value into `PARARAM_USER_TOKEN` and store it as a secret.
172+
166173
Tools available in limited mode:
167174

168175
- **Chats**`get_chat`, `create_private_chat`, `create_group_chat`,
@@ -171,10 +178,6 @@ Tools available in limited mode:
171178
`get_reply_thread`, `get_replies_to_post`, `send_message`,
172179
`edit_post`, `delete_post`
173180

174-
> `search_chats` is **not** exposed in limited mode — the underlying
175-
> `/core/chat/search` endpoint requires a `session_id` field that service
176-
> tokens don't provide. Will be re-added once the mechanism is documented.
177-
178181
## MCP Client Configuration
179182

180183
### Claude Code (CLI)
@@ -330,16 +333,19 @@ docker run -i --rm \
330333
```
331334

332335
**Environment variables:**
333-
- `PARARAM_LOGIN` (required): Your pararam.io login
334-
- `PARARAM_PASSWORD` (required): Your pararam.io password
335-
- `PARARAM_2FA_KEY` (optional): Your 2FA secret key for TOTP authentication
336+
- `PARARAM_LOGIN` (full mode): Your pararam.io login
337+
- `PARARAM_PASSWORD` (full mode): Your pararam.io password
338+
- `PARARAM_2FA_KEY` (optional): Your 2FA secret key for TOTP authentication in full mode
339+
- `PARARAM_USER_TOKEN` (limited mode): Service token sent as `X-UserToken`
340+
341+
Set either `PARARAM_LOGIN`/`PARARAM_PASSWORD` or `PARARAM_USER_TOKEN`, not both.
336342

337343
## Usage
338344

339345
### If installed with uvx:
340346

341347
```bash
342-
uvx --from git+https://github.com/ivolnistov/pararam-nexus-mcp pararam-nexus-mcp
348+
uvx pararam-nexus-mcp
343349
```
344350

345351
### If cloned locally:

docs/INSTALLATION.md

Lines changed: 119 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,88 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
2222
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
2323
```
2424

25-
### 2. Clone the Repository
25+
### 2. Choose Authentication Mode
26+
27+
The server starts in one of two modes depending on which environment variables
28+
you provide.
29+
30+
#### Full mode: login + password (+ optional 2FA)
31+
32+
Full mode registers all tools and persists cookies between runs:
2633

2734
```bash
28-
git clone <repository-url>
29-
cd pararam-nexus-mcp
35+
PARARAM_LOGIN=your_email@example.com \
36+
PARARAM_PASSWORD=your_password \
37+
PARARAM_2FA_KEY=your_2fa_key \
38+
uvx pararam-nexus-mcp
3039
```
3140

32-
### 3. Install Dependencies
41+
#### Limited mode: `X-UserToken` service token
42+
43+
Limited mode uses `PARARAM_USER_TOKEN` instead of login/password. It registers
44+
only chat, message, post, replies, edit, and delete tools. User lookups, global
45+
search, and file operations are excluded.
3346

3447
```bash
35-
uv sync --dev
48+
PARARAM_USER_TOKEN=your_service_token \
49+
uvx pararam-nexus-mcp
3650
```
3751

38-
This will:
39-
- Create a virtual environment
40-
- Install all required dependencies
41-
- Install development dependencies (linters, type checkers, test tools)
52+
`PARARAM_USER_TOKEN` is mutually exclusive with `PARARAM_LOGIN` and
53+
`PARARAM_PASSWORD`.
4254

43-
### 4. Configure Environment Variables
55+
To get a user token:
4456

45-
Create a `.env` file in the project root:
57+
1. Open the Pararam **Info Chat** bot documentation.
58+
2. In **User Tokens**, run **Create new token** (`bot://cmd_create_user_token?title=Create+new+token&conf=True`).
59+
3. InfoBot will reply with `New user token - ...`.
60+
4. Copy that value into `PARARAM_USER_TOKEN` and store it as a secret.
61+
62+
You can also run **Get user tokens** (`bot://cmd_get_user_tokens?title=Get+user+tokens&conf=True`)
63+
to view the tokens created under your account.
64+
65+
Tools available in limited mode:
66+
67+
- **Chats**: `get_chat`, `create_private_chat`, `create_group_chat`,
68+
`create_thread_chat`
69+
- **Posts**: `get_chat_messages`, `get_message_from_url`,
70+
`get_reply_thread`, `get_replies_to_post`, `send_message`,
71+
`edit_post`, `delete_post`
72+
73+
### 3. Verify Package Startup
74+
75+
Run the server once to verify `uvx` can install and start the published package:
4676

4777
```bash
48-
cp .env.example .env
78+
PARARAM_LOGIN=your_email@example.com \
79+
PARARAM_PASSWORD=your_password \
80+
PARARAM_2FA_KEY=your_2fa_key \
81+
uvx pararam-nexus-mcp
4982
```
5083

51-
Edit the `.env` file with your credentials:
84+
Press Ctrl-C to stop the server.
85+
86+
Use environment variables for credentials. Full mode:
5287

5388
```env
54-
# Required: Your pararam.io credentials
89+
# Required in full mode: your pararam.io credentials
5590
PARARAM_LOGIN=your_email@example.com
5691
PARARAM_PASSWORD=your_password
5792
5893
# Optional: Two-factor authentication key
5994
PARARAM_2FA_KEY=your_2fa_secret_key
95+
```
6096

97+
Limited mode:
98+
99+
```env
100+
# Required in limited mode; do not set login/password with it
101+
PARARAM_USER_TOKEN=your_service_token
102+
```
103+
104+
Common options:
105+
106+
```env
61107
# Optional: Debug mode (set to true for detailed logging)
62108
MCP_DEBUG=false
63109
```
@@ -73,23 +119,6 @@ If you have two-factor authentication enabled on pararam.io:
73119

74120
**Note:** The 2FA key is the secret used to generate the 6-digit codes, not the codes themselves.
75121

76-
### 5. Verify Installation
77-
78-
Run the server to verify everything is set up correctly:
79-
80-
```bash
81-
uv run pararam-nexus-mcp
82-
```
83-
84-
You should see output similar to:
85-
86-
```
87-
2025-10-15 12:00:00 - pararam_nexus_mcp.server - INFO - Starting Pararam Nexus MCP
88-
2025-10-15 12:00:00 - pararam_nexus_mcp.server - INFO - Registered tools: search_messages, get_chat_messages, send_message, search_chats, build_conversation_thread, upload_file_to_chat, search_users, get_user_info, get_user_team_status
89-
```
90-
91-
Press Ctrl-C to stop the server.
92-
93122
## Configuring Claude Desktop
94123

95124
To use Pararam Nexus MCP with Claude Desktop, you need to add it to your MCP configuration.
@@ -106,17 +135,14 @@ The configuration file is located at:
106135

107136
Edit the configuration file and add the Pararam Nexus MCP server:
108137

138+
Full mode:
139+
109140
```json
110141
{
111142
"mcpServers": {
112143
"pararam-nexus": {
113-
"command": "uv",
114-
"args": [
115-
"--directory",
116-
"/absolute/path/to/pararam-nexus-mcp",
117-
"run",
118-
"pararam-nexus-mcp"
119-
],
144+
"command": "uvx",
145+
"args": ["pararam-nexus-mcp"],
120146
"env": {
121147
"PARARAM_LOGIN": "your_email@example.com",
122148
"PARARAM_PASSWORD": "your_password",
@@ -127,7 +153,21 @@ Edit the configuration file and add the Pararam Nexus MCP server:
127153
}
128154
```
129155

130-
**Important:** Replace `/absolute/path/to/pararam-nexus-mcp` with the actual absolute path to your project directory.
156+
Limited mode:
157+
158+
```json
159+
{
160+
"mcpServers": {
161+
"pararam-nexus": {
162+
"command": "uvx",
163+
"args": ["pararam-nexus-mcp"],
164+
"env": {
165+
"PARARAM_USER_TOKEN": "your_service_token"
166+
}
167+
}
168+
}
169+
}
170+
```
131171

132172
### 3. Restart Claude Desktop
133173

@@ -149,37 +189,64 @@ All configuration is done through environment variables:
149189

150190
| Variable | Required | Default | Description |
151191
|----------|----------|---------|-------------|
152-
| `PARARAM_LOGIN` | Yes | - | Your pararam.io email/username |
153-
| `PARARAM_PASSWORD` | Yes | - | Your pararam.io password |
154-
| `PARARAM_2FA_KEY` | No | - | TOTP secret key for 2FA |
192+
| `PARARAM_LOGIN` | Full mode | - | Your pararam.io email/username |
193+
| `PARARAM_PASSWORD` | Full mode | - | Your pararam.io password |
194+
| `PARARAM_2FA_KEY` | No | - | TOTP secret key for 2FA in full mode |
195+
| `PARARAM_USER_TOKEN` | Limited mode | - | Service token sent as `X-UserToken` |
155196
| `MCP_DEBUG` | No | `false` | Enable debug logging |
156197
| `DEBUG` | No | `false` | Alternative debug flag |
157198

199+
Set either `PARARAM_LOGIN`/`PARARAM_PASSWORD` or `PARARAM_USER_TOKEN`, not both.
200+
158201
### Cookie Storage
159202

160-
The MCP server automatically manages authentication sessions using cookies stored in:
203+
In full mode, the MCP server automatically manages authentication sessions using cookies stored in:
161204

162205
```
163206
~/.pararam_cookies.json
164207
```
165208

166209
This file is automatically created and maintained. You don't need to manage it manually.
210+
Limited mode does not use cookie storage.
167211

168212
**Security Note:** This file contains sensitive session data. Keep it secure and don't commit it to version control.
169213

170214
## Development Setup
171215

172216
If you want to contribute or develop the project:
173217

174-
### 1. Install Pre-commit Hooks
218+
### 1. Clone the Repository
219+
220+
```bash
221+
git clone <repository-url>
222+
cd pararam-nexus-mcp
223+
uv sync --dev
224+
```
225+
226+
This will:
227+
- Create a virtual environment
228+
- Install all required dependencies
229+
- Install development dependencies (linters, type checkers, test tools)
230+
231+
### 2. Configure Local Environment
232+
233+
Create a `.env` file in the project root:
234+
235+
```bash
236+
cp .env.example .env
237+
```
238+
239+
Edit `.env` with your credentials.
240+
241+
### 3. Install Pre-commit Hooks
175242

176243
```bash
177244
uv run pre-commit install
178245
```
179246

180247
This will automatically run linters and formatters before each commit.
181248

182-
### 2. Run Tests
249+
### 4. Run Tests
183250

184251
```bash
185252
# Run all tests
@@ -192,7 +259,7 @@ uv run pytest --cov=src/pararam_nexus_mcp --cov-report=html
192259
open htmlcov/index.html
193260
```
194261

195-
### 3. Run Linters
262+
### 5. Run Linters
196263

197264
```bash
198265
# Check code style
@@ -205,7 +272,7 @@ uv run ruff format src/
205272
uv run mypy src/pararam_nexus_mcp
206273
```
207274

208-
### 4. Debug Mode
275+
### 6. Debug Mode
209276

210277
Enable debug mode for detailed logging:
211278

@@ -241,16 +308,17 @@ In debug mode, you'll see:
241308
**Problem:** Import errors when running the server
242309

243310
**Solutions:**
244-
1. Ensure you're using `uv run` to execute commands
245-
2. Verify dependencies are installed: `uv sync`
246-
3. Check Python version: `python --version` (must be 3.11+)
311+
1. For normal usage, run the package with `uvx pararam-nexus-mcp`
312+
2. For local development, ensure dependencies are installed: `uv sync`
313+
3. For local development commands, use `uv run`
314+
4. Check Python version: `python --version` (must be 3.11+)
247315

248316
### Claude Desktop Can't Find MCP Server
249317

250318
**Problem:** MCP tools don't appear in Claude Desktop
251319

252320
**Solutions:**
253-
1. Verify the path in `claude_desktop_config.json` is absolute, not relative
321+
1. Verify `claude_desktop_config.json` uses `"command": "uvx"` and `"args": ["pararam-nexus-mcp"]`
254322
2. Ensure environment variables are set in the config file
255323
3. Check Claude Desktop logs for errors:
256324
- macOS: `~/Library/Logs/Claude/mcp*.log`

packages/pararam-nexus-mcp/src/pararam_nexus_mcp/server.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
LIMITED_MODE_TOOLS: frozenset[str] = frozenset(
2424
{
2525
# Chat operations
26-
# NOTE: 'search_chats' is intentionally NOT in the limited allow-list.
27-
# The /core/chat/search endpoint demands a `session_id` field whose
28-
# source is undocumented for service tokens; the call 400s without it.
29-
# Re-add once the team documents the session_id mechanism.
3026
'get_chat',
3127
'create_private_chat',
3228
'create_group_chat',

0 commit comments

Comments
 (0)