Skip to content

Commit 7803d48

Browse files
authored
docs: improve connector onboarding steps
Improve connector docs with clearer onboarding and validation steps. Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
1 parent 7a7bc31 commit 7803d48

16 files changed

Lines changed: 249 additions & 67 deletions

docs/connectors/bigquery.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,28 @@ BigQuery uses **Application Default Credentials (ADC)** — there is no token in
2323
TOML; the credentials must be visible to the **server process**. Three common
2424
paths:
2525

26-
1. **Service account JSON** (production): create a service account with
27-
`roles/bigquery.dataViewer` on the target datasets, then point the server at
28-
it:
26+
1. **Service account JSON** (production): in Google Cloud Console, open
27+
*IAM & Admin → Service Accounts***Create service account**. Name it
28+
`mfs-bigquery-reader`, grant `roles/bigquery.dataViewer` on the target
29+
datasets or project, then open the service account's *Keys* tab →
30+
**Add key → Create new key → JSON**. Store the downloaded JSON outside the
31+
repo and point the server at it:
2932

3033
```bash
3134
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/sa.json
3235
mfs-server run
3336
```
3437

35-
2. **`gcloud auth application-default login`** (dev / single-user) — writes
36-
`~/.config/gcloud/application_default_credentials.json`.
38+
2. **`gcloud auth application-default login`** (dev / single-user): run it as
39+
the same OS user that starts `mfs-server`. It opens a browser consent flow and
40+
writes `~/.config/gcloud/application_default_credentials.json`.
3741

3842
3. **Workload Identity** on GKE / Cloud Run — ADC is automatic.
3943

40-
Make sure the **BigQuery API** is enabled on the project.
44+
Before any of those, open *APIs & Services → Library → BigQuery API* and enable
45+
it on the project. If the connector can authenticate but cannot list a dataset,
46+
check the dataset IAM page first; the service account needs read access to every
47+
dataset listed in `datasets`.
4148

4249
![Google Cloud BigQuery API page](https://github.com/user-attachments/assets/fd034ea0-4607-4e74-b65a-106460830889)
4350

@@ -58,6 +65,13 @@ text_fields = ["title", "body_markdown"]
5865
locator_fields = ["article_id"]
5966
```
6067

68+
Save the file as `bigquery.toml`, then probe before the first index:
69+
70+
```bash
71+
mfs connector probe bigquery://analytics --config ./bigquery.toml
72+
mfs add bigquery://analytics --config ./bigquery.toml
73+
```
74+
6175
## Sync and freshness
6276

6377
The connector uses the table's `modified` time as its cursor; deletions are caught
@@ -67,8 +81,6 @@ tables.
6781
## Search and browse
6882
6983
```bash
70-
mfs add bigquery://analytics --config ./bigquery.toml
71-
7284
mfs search "refund event" bigquery://analytics/events/tables/user_events/rows.jsonl
7385
mfs search "email column" bigquery://analytics --kind schema_summary
7486
mfs cat bigquery://analytics/kb/tables/articles/rows.jsonl --locator '{"article_id":"a-123"}'
@@ -80,3 +92,5 @@ mfs cat bigquery://analytics/kb/tables/articles/rows.jsonl --locator '{"article_
8092
- BigQuery has no primary key for most tables — choose stable `locator_fields`
8193
explicitly.
8294
- Rows need `text_fields` to be searchable.
95+
- User ADC from `gcloud` is convenient for local testing; service accounts or
96+
workload identity are easier to operate in long-running deployments.

docs/connectors/discord.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ guild_id = "987654321098765432"
6060
max_read_rows = 50000
6161
```
6262

63+
Save the file as `discord.toml`, then probe and index:
64+
65+
```bash
66+
mfs connector probe discord://community --config ./discord.toml
67+
mfs add discord://community --config ./discord.toml
68+
```
69+
6370
## Sync and freshness
6471

6572
The connector tracks the latest `message_id` per channel as its cursor;
@@ -68,8 +75,6 @@ re-syncs fetch only newer messages. Deletion detection is `never`.
6875
## Search and browse
6976

7077
```bash
71-
mfs add discord://community --config ./discord.toml
72-
7378
mfs search "deploy failed" discord://community
7479
mfs ls discord://community/channels/general__987654321
7580
mfs cat discord://community/channels/general__987654321/messages.jsonl --locator '{"id":"1234567890123456789"}'

docs/connectors/feishu.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ Add the connector — the wizard runs a one-time browser authorization inline:
5555
mfs-server connector add feishu://workspace
5656
```
5757

58-
Open the printed URL and approve. **This consent must be done by a person and
59-
can't be automated** — it's the OAuth user-authorization step. After that the
58+
The wizard prompts for App ID, App Secret, region, and auth mode, writes the TOML
59+
under `$MFS_HOME/connectors/`, and registers the connector against the local
60+
server. Open the printed URL and approve. **This consent must be done by a person
61+
and can't be automated** — it's the OAuth user-authorization step. After that the
6062
token refreshes automatically while the connector is actively synced (each sync
6163
renews it). If it goes unused for several days the authorization expires; the next
6264
use reports that re-authorization is needed. To re-authorize, have a person
@@ -88,6 +90,15 @@ docs_folder_token = "fldcn..." # optional: limit docs to one shared folder
8890
max_read_rows = 50000
8991
```
9092

93+
Tenant mode does not need browser consent. You can use the same
94+
`mfs-server connector add feishu://workspace` wizard and choose `tenant`, or save
95+
the TOML yourself and run:
96+
97+
```bash
98+
mfs connector probe feishu://workspace --config ./feishu.toml
99+
mfs add feishu://workspace --config ./feishu.toml
100+
```
101+
91102
## Sync and freshness
92103

93104
The connector uses the message `create_time` as its cursor; deletion detection is

docs/connectors/gdrive.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,31 @@ Google Drive uses a **user OAuth token JSON** — the `token.json` from Google's
2121
OAuth flow, containing `refresh_token` / `client_id` / `client_secret`.
2222
Service-account keys are **not** supported.
2323

24-
1. GCP Console → *APIs & Services → Library* → enable **Google Drive API**.
25-
2. *Credentials → Create Credentials → OAuth client ID**Desktop app*
26-
**Download JSON** (the client credentials).
27-
3. Run Google's OAuth flow once on a machine with a browser (e.g.
28-
`InstalledAppFlow.run_local_server`) requesting scope
29-
`https://www.googleapis.com/auth/drive.readonly`. This writes `token.json`.
30-
4. Copy `token.json` to the server and reference it from the TOML.
24+
1. <https://console.cloud.google.com> → pick or create a project. If this is
25+
the first OAuth client in the project, finish the OAuth consent screen first
26+
and add the authorizing Google account as a test user when the app is in
27+
testing.
28+
2. *APIs & Services → Library → Google Drive API***Enable**.
29+
3. *APIs & Services → Credentials → Create Credentials → OAuth client ID*
30+
choose **Desktop app****Create****Download JSON**. Save it locally as
31+
`client_secret.json`.
32+
4. On a workstation with a browser, run the consent flow once:
33+
34+
```bash
35+
uv run --with google-auth-oauthlib python - <<'PY'
36+
from pathlib import Path
37+
from google_auth_oauthlib.flow import InstalledAppFlow
38+
39+
scopes = ["https://www.googleapis.com/auth/drive.readonly"]
40+
flow = InstalledAppFlow.from_client_secrets_file("client_secret.json", scopes)
41+
creds = flow.run_local_server(port=0)
42+
Path("token.json").write_text(creds.to_json())
43+
PY
44+
```
45+
46+
5. Copy `token.json` to a path the **server process** can read, for example
47+
`/home/x/.mfs/gdrive-token.json`, and reference that absolute path from the
48+
TOML.
3149
3250
![Google Cloud Drive API page](https://github.com/user-attachments/assets/523b9021-f809-4b1f-a1ad-16703739c409)
3351
@@ -45,6 +63,14 @@ anything explicitly shared with them. If you also use [`gmail`](gmail.md), reque
4563
token = "file:/home/x/.mfs/gdrive-token.json"
4664
```
4765
66+
Save the file as `gdrive.toml`, then probe from the same environment that can
67+
reach the MFS server:
68+
69+
```bash
70+
mfs connector probe gdrive://engineering --config ./gdrive.toml
71+
mfs add gdrive://engineering --config ./gdrive.toml
72+
```
73+
4874
## Sync and freshness
4975
5076
The connector uses each file's `modifiedTime` as its cursor; deletions are caught
@@ -60,8 +86,6 @@ indexes only files modified on or after that date. Older files are left untouche
6086
## Search and browse
6187
6288
```bash
63-
mfs add gdrive://engineering --config ./gdrive.toml
64-
6589
mfs search "roadmap" gdrive://engineering/Product/
6690
mfs cat gdrive://engineering/Product/Roadmap.txt --range 1:80
6791
mfs export gdrive://engineering/Product/Design.pdf /tmp/design.pdf

docs/connectors/gmail.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,31 @@ Gmail uses a **user OAuth token JSON** — the `token.json` from Google's OAuth
2424
flow, containing `refresh_token` / `client_id` / `client_secret`. Service-account
2525
keys are **not** supported.
2626

27-
1. <https://console.cloud.google.com> → pick or create a project.
27+
1. <https://console.cloud.google.com> → pick or create a project. If this is
28+
the first OAuth client in the project, finish the OAuth consent screen first
29+
and add the authorizing Google account as a test user when the app is in
30+
testing.
2831
2. *APIs & Services → Library → Gmail API***Enable**.
29-
3. *Credentials → Create Credentials → OAuth client ID**Desktop app*
30-
**Download JSON** (the client credentials, not the token yet).
31-
4. Run Google's OAuth flow once on a machine with a browser (e.g.
32-
`InstalledAppFlow.run_local_server`) requesting scope
33-
`https://www.googleapis.com/auth/gmail.readonly`. This writes `token.json`.
34-
5. Copy `token.json` to the server and reference it from the TOML.
32+
3. *APIs & Services → Credentials → Create Credentials → OAuth client ID*
33+
choose **Desktop app****Create****Download JSON**. Save it locally as
34+
`client_secret.json`.
35+
4. On a workstation with a browser, run the consent flow once:
36+
37+
```bash
38+
uv run --with google-auth-oauthlib python - <<'PY'
39+
from pathlib import Path
40+
from google_auth_oauthlib.flow import InstalledAppFlow
41+
42+
scopes = ["https://www.googleapis.com/auth/gmail.readonly"]
43+
flow = InstalledAppFlow.from_client_secrets_file("client_secret.json", scopes)
44+
creds = flow.run_local_server(port=0)
45+
Path("token.json").write_text(creds.to_json())
46+
PY
47+
```
48+
49+
5. Copy `token.json` to a path the **server process** can read, for example
50+
`/home/x/.mfs/gmail-token.json`, and reference that absolute path from the
51+
TOML.
3552
3653
![Google Cloud Gmail API page](https://github.com/user-attachments/assets/8a2b96ab-8ea6-4442-9e25-f186c879dd14)
3754
@@ -55,6 +72,13 @@ max_read_rows = 5000
5572
bare access-token string or inline token JSON, but the file reference is the
5673
common form.
5774
75+
Save the file as `gmail.toml`, then probe and index:
76+
77+
```bash
78+
mfs connector probe gmail://work --config ./gmail.toml
79+
mfs add gmail://work --config ./gmail.toml
80+
```
81+
5882
## Sync and freshness
5983
6084
The connector uses Gmail's `historyId` as its cursor for incremental re-sync.
@@ -63,8 +87,6 @@ Deletion detection is `never` — removed mail isn't retroactively pruned.
6387
## Search and browse
6488
6589
```bash
66-
mfs add gmail://work --config ./gmail.toml
67-
6890
mfs search "contract renewal" gmail://work/labels/INBOX__CATEGORY_PERSONAL/messages.jsonl
6991
mfs cat gmail://work/labels/INBOX__CATEGORY_PERSONAL/messages.jsonl --locator '{"threadId":"THREAD_ID","id":"MESSAGE_ID"}'
7092
```

docs/connectors/hubspot.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ locator_fields = ["id"]
5454
If `object_types` is omitted, the connector probes the common objects and silently
5555
drops the ones the portal rejects (a 403 on Service Hub tickets, say).
5656

57+
Save the file as `hubspot.toml`, then probe and index:
58+
59+
```bash
60+
mfs connector probe hubspot://acme --config ./hubspot.toml
61+
mfs add hubspot://acme --config ./hubspot.toml
62+
```
63+
5764
## Sync and freshness
5865

5966
The connector uses each object's `hs_lastmodifieddate` as its cursor for
@@ -62,8 +69,6 @@ incremental re-sync; deletions are caught by `full_scan`.
6269
## Search and browse
6370

6471
```bash
65-
mfs add hubspot://acme --config ./hubspot.toml
66-
6772
mfs search "customer health" hubspot://acme/contacts/records.jsonl
6873
mfs cat hubspot://acme/contacts/records.jsonl --locator '{"id":"12345"}'
6974
```

docs/connectors/jira.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ projects = ["ENG", "OPS"] # empty = all visible projects
4848
max_read_rows = 50000
4949
```
5050

51+
Save the file as `jira.toml`, then probe and index:
52+
53+
```bash
54+
mfs connector probe jira://acme --config ./jira.toml
55+
mfs add jira://acme --config ./jira.toml
56+
```
57+
5158
## Sync and freshness
5259

5360
The connector uses the issue `updated` timestamp as its cursor; Cloud retrieval
@@ -56,8 +63,6 @@ pages through `enhanced_jql`. Deletions are caught by `full_scan`.
5663
## Search and browse
5764

5865
```bash
59-
mfs add jira://acme --config ./jira.toml
60-
6166
mfs search "SSO regression" jira://acme/projects/ENG/issues.jsonl
6267
mfs cat jira://acme/projects/ENG/issues.jsonl --locator '{"key":"ENG-1234"}'
6368
```

docs/connectors/linear.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ api_key = "env:LINEAR_API_KEY"
4242
teams = ["ENG"] # empty = all visible teams
4343
```
4444

45+
Save the file as `linear.toml`, then probe and index:
46+
47+
```bash
48+
mfs connector probe linear://workspace --config ./linear.toml
49+
mfs add linear://workspace --config ./linear.toml
50+
```
51+
4552
## Sync and freshness
4653

4754
The connector uses the issue `updatedAt` field as its cursor for incremental
@@ -50,8 +57,6 @@ re-sync; deletions are caught by `full_scan`.
5057
## Search and browse
5158

5259
```bash
53-
mfs add linear://workspace --config ./linear.toml
54-
5560
mfs search "billing migration" linear://workspace/teams/ENG/issues.jsonl
5661
mfs cat linear://workspace/teams/ENG/issues.jsonl --locator '{"identifier":"ENG-42"}'
5762
```

docs/connectors/mongo.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,20 @@ mongodb+srv://user:pass@cluster.mongodb.net/?retryWrites=true
2727
```
2828

2929
For Atlas, copy the SRV URI from *Database → Connect → Drivers* and substitute
30-
the real password. A read-only user is enough — the connector only runs `find()`.
31-
Probe before MFS sees it:
30+
the real password. Before copying it, open *Database Access → Add New Database
31+
User*, create a user with the built-in **read** role on the target database, then
32+
open *Network Access* and allow the egress IP of the machine or container running
33+
`mfs-server`. A read-only user is enough — the connector only runs `find()`.
34+
35+
Probe from the server host before MFS sees it:
3236

3337
```bash
3438
mongosh "$MONGO_URI" --eval "db.adminCommand({ping: 1})"
3539
```
3640

41+
If the password contains `@`, `:`, `/`, or other URL characters, percent-encode
42+
it before putting it in the URI.
43+
3744
## Configuration
3845

3946
```toml
@@ -52,6 +59,14 @@ metadata_fields = ["status"]
5259
`text_fields` supports nested paths like `messages[].body` to pull text out of
5360
arrays of subdocuments.
5461

62+
Keep the URI in the server environment, then probe and index:
63+
64+
```bash
65+
export MONGO_URI='mongodb+srv://mfs_reader:<password>@cluster.mongodb.net/'
66+
mfs connector probe mongo://prod-cluster --config ./mongo.toml
67+
mfs add mongo://prod-cluster --config ./mongo.toml
68+
```
69+
5570
## Sync and freshness
5671

5772
With `cursor_field` set (`updatedAt` or `_id`), re-syncs pull only documents
@@ -60,9 +75,6 @@ changed since the last run; deletions are caught by `full_scan`.
6075
## Search and browse
6176

6277
```bash
63-
mfs connector probe mongo://prod-cluster --config ./mongo.toml
64-
mfs add mongo://prod-cluster --config ./mongo.toml
65-
6678
mfs search "refund escalation" mongo://prod-cluster/support_threads/documents.jsonl
6779
mfs cat mongo://prod-cluster/support_threads/documents.jsonl --locator '{"_id":"65a3..."}'
6880
```

0 commit comments

Comments
 (0)