diff --git a/docs/en/guides/ai.mdx b/docs/en/guides/ai.mdx index 854c9f4..9d3b5e9 100644 --- a/docs/en/guides/ai.mdx +++ b/docs/en/guides/ai.mdx @@ -7,6 +7,28 @@ Vectana has an [MCP](https://modelcontextprotocol.io/) server so AI clients such The AI acts **with your permissions**. Projects you cannot see and fields you cannot change stay hidden and read-only for the AI too. +## Use it from claude.ai and the Claude apps (remote MCP) + +Vectana serves MCP at `https:///mcp`. Add it to claude.ai as a connector and you can use it from Claude on the web, desktop and mobile apps, and in projects, with nothing to install. There is no token to paste: you connect by signing in to Vectana. + +1. In claude.ai, open **Settings → Connectors** and choose **Add custom connector** +2. Enter `Vectana` as the name and `https://vectana.example.com/mcp` as the URL +3. Click **Connect**. Vectana's sign-in page opens: sign in, choose the access to grant (read and write, or read only) and click **Allow** + +Connecting adds a token such as `Claude (OAuth)` under **Settings → Personal tokens**. To disconnect, revoke that token. + +:::note +On Team and Enterprise plans, an organization owner adds the custom connector first, then each member clicks **Connect**. +::: + +Claude Code can use the remote MCP without a token too (sign in from `/mcp` the first time): + +```bash +claude mcp add --transport http vectana https://vectana.example.com/mcp +``` + +The personal token and npm package below are for AI clients without remote MCP support, or when you want to run the server locally. + ## Issue a personal token Issue one under **Personal settings → Personal tokens (AI and scripts)**. diff --git a/docs/en/self-hosting/configuration.mdx b/docs/en/self-hosting/configuration.mdx index d370fd1..13786df 100644 --- a/docs/en/self-hosting/configuration.mdx +++ b/docs/en/self-hosting/configuration.mdx @@ -13,7 +13,7 @@ Settings go in `.env`, next to `compose.yaml`. Apply changes with `docker compos | `VECTANA_VERSION` | `latest` | The image tag. Pinning a version such as `1.0.0` is recommended | | `POSTGRES_PASSWORD` | (required) | Database password | | `SECRET_KEY` | (required) | Key that signs logins. Generate it with `openssl rand -hex 32`. Changing it logs everyone out | -| `WEB_URL` | `http://localhost:8000` | Public URL, used for links in invitation and notification emails and as the GitHub / GitLab webhook address | +| `WEB_URL` | `http://localhost:8000` | Public URL, used for links in invitation and notification emails, as the GitHub / GitLab webhook address, and in the remote MCP (`/mcp`) OAuth URLs | | `GROUP_NAME` | `Vectana Group` | Group name shown in the app | ## Checks @@ -40,6 +40,15 @@ The "Ending soon" window for EOL is set in the app under [System settings](/admi See [Email](/self-hosting/mail) for details. +## Remote MCP + +In the Docker image, the app container also runs the MCP server internally and serves it at `/mcp` ([Use from AI](/guides/ai)). Nothing to configure, but set `WEB_URL` to the public URL. Behind a reverse proxy, forward `/mcp`, `/.well-known/` and `/oauth/` to the app too. + +| Variable | Default | Description | +| --- | --- | --- | +| `MCP_SCRIPT` | The MCP server in the image | Set it empty to turn off the remote MCP (`/mcp` then answers 503) | +| `MCP_PORT` | `8001` | Port the MCP server uses inside the container (`127.0.0.1` only) | + ## Other | Variable | Default | Description | diff --git a/docs/guides/ai.mdx b/docs/guides/ai.mdx index f63cc51..52c9878 100644 --- a/docs/guides/ai.mdx +++ b/docs/guides/ai.mdx @@ -7,6 +7,28 @@ Vectana には、Claude Desktop や Claude Code などの AI クライアント AI は**あなたの権限で**操作します。画面で見えないプロジェクトや、変更できない項目は、AI からも見えず変更もできません。 +## claude.ai や Claude アプリから使う(リモート MCP) + +Vectana は `https:///mcp` で MCP を提供しています。claude.ai にコネクタとして登録すると、Claude の Web・デスクトップ・モバイルアプリやプロジェクトから、何もインストールせずに使えます。トークンを貼り付ける必要はなく、Vectana へのログインで連携します。 + +1. claude.ai の「設定 → コネクタ」で「カスタムコネクタを追加」を押します +2. 名前に `Vectana`、URL に `https://vectana.example.com/mcp` を入力して追加します +3. 「連携」を押すと Vectana のログイン画面が開きます。ログインして、許可する権限(読み書き / 読み取りのみ)を選び「許可する」を押します + +連携すると、「個人設定 → 個人用トークン」に `Claude (OAuth)` のようなトークンが増えます。連携をやめるときは、そのトークンを失効させてください。 + +:::note +Team・Enterprise プランでは、組織のオーナーがカスタムコネクタを追加してから、各メンバーが「連携」します。 +::: + +Claude Code でも、トークンなしでリモート MCP を使えます(初回に `/mcp` からログインします)。 + +```bash +claude mcp add --transport http vectana https://vectana.example.com/mcp +``` + +以下の個人用トークンと npm パッケージを使う方法は、リモート MCP に対応していない AI クライアントや、手元で動かしたい場合に使います。 + ## 個人用トークンを発行する 「個人設定」の「個人用トークン(AI・スクリプト連携)」で発行します。 diff --git a/docs/self-hosting/configuration.mdx b/docs/self-hosting/configuration.mdx index 4fef72c..c6c3591 100644 --- a/docs/self-hosting/configuration.mdx +++ b/docs/self-hosting/configuration.mdx @@ -13,7 +13,7 @@ description: .env で設定できる環境変数の一覧。 | `VECTANA_VERSION` | `latest` | イメージのタグ。`1.0.0` のように固定するのがおすすめです | | `POSTGRES_PASSWORD` | (必須) | データベースのパスワード | | `SECRET_KEY` | (必須) | ログイン情報の署名に使う鍵。`openssl rand -hex 32` で作ります。変えると全員がログアウトされます | -| `WEB_URL` | `http://localhost:8000` | 公開 URL。招待メールや通知のリンク、GitHub・GitLab の Webhook の宛先に使います | +| `WEB_URL` | `http://localhost:8000` | 公開 URL。招待メールや通知のリンク、GitHub・GitLab の Webhook の宛先、リモート MCP(`/mcp`)の OAuth の URL に使います | | `GROUP_NAME` | `Vectana Group` | 画面に表示するグループ名 | ## チェック @@ -40,6 +40,15 @@ EOL の「まもなく終了」にする日数は、画面の [システム設 詳しくは [メールの設定](/self-hosting/mail) を参照してください。 +## リモート MCP + +Docker イメージでは、アプリのコンテナが MCP サーバも内部で起動し、`/mcp` で公開します([AI から操作する](/guides/ai))。設定は不要ですが、`WEB_URL` を公開 URL にしておいてください。リバースプロキシを挟む場合は、`/mcp` と `/.well-known/` と `/oauth/` もアプリに転送します。 + +| 変数 | 初期値 | 説明 | +| --- | --- | --- | +| `MCP_SCRIPT` | イメージ内の MCP サーバ | 空にするとリモート MCP を無効にします(`/mcp` は 503 を返します) | +| `MCP_PORT` | `8001` | MCP サーバがコンテナ内で使うポート(`127.0.0.1` のみ) | + ## そのほか | 変数 | 初期値 | 説明 |