connect-prepr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseConnect to the Prepr MCP server
连接到 Prepr MCP 服务器
Add the Prepr MCP server () to the user's agent, get it
authorized, and prove it works with one read-only call.
https://mcp.prepr.ioFirst run the check. If Prepr tools
are already present, say so, name the environment, and stop.
将 Prepr MCP 服务器()添加到用户的 Agent,完成授权,并通过一次只读调用验证其正常工作。
https://mcp.prepr.io先运行检查。如果已经存在 Prepr 工具,请说明这一点,指出环境名称,然后停止。
Step 1: Detect the client
第 1 步:检测客户端
Use the agent you are running in when you know it. Otherwise look for
or , , , , and
in the project. If more than one client is in use, ask which
ones to configure. If nothing points to a client, ask.
.claude/.mcp.json.cursor/.codex/.vscode/opencode.jsonThen look for an existing entry in every place the client reads:
prepr- Claude Code: the project , and
.mcp.json(local and user scopes inclaude mcp get preprtake precedence over the project file).~/.claude.json - VS Code: and
.vscode/mcp.json..mcp.json - Cursor: . Codex:
.cursor/mcp.json. OpenCode:.codex/config.toml.opencode.json
如果已知当前运行的 Agent,则直接使用。否则,在项目中查找 或 、、、 和 。如果有多个客户端正在使用,请询问用户要配置哪些客户端。如果没有任何线索表明正在使用哪个客户端,则询问用户。
.claude/.mcp.json.cursor/.codex/.vscode/opencode.json然后,在客户端读取的所有位置查找现有的 条目:
prepr- Claude Code:项目级 ,以及
.mcp.json(claude mcp get prepr中本地和用户作用域的配置优先于项目文件)。~/.claude.json - VS Code:和
.vscode/mcp.json。.mcp.json - Cursor:。Codex:
.cursor/mcp.json。OpenCode:.codex/config.toml。opencode.json
Step 2: Choose the auth route
第 2 步:选择认证方式
- OAuth (default): Claude Code, Claude Desktop, Cursor, Codex, OpenCode, VS Code, ChatGPT. The user signs in to Prepr in the browser and picks an environment. Their Prepr role permissions apply.
- Token: GitHub Copilot CLI, or any client where the user says OAuth is not available. Tokens are issued by Prepr Support.
Recommend picking a Scratch environment for a first try. Writes go to
whatever environment is chosen when signing in, and a Scratch environment
makes it safe to see what the skills do.
- OAuth(默认):Claude Code、Claude Desktop、Cursor、Codex、OpenCode、VS Code、ChatGPT。用户会在浏览器中登录 Prepr 并选择一个环境。用户的 Prepr 角色权限将生效。
- Token:GitHub Copilot CLI,或任何用户表示无法使用 OAuth 的客户端。Token 由 Prepr Support 签发。
建议首次尝试时选择 Scratch 环境。写入操作会作用于登录时选择的环境,而 Scratch 环境可以让你安全地了解各项 skill 的行为。
Step 3: Write the config
第 3 步:写入配置
Use the snippet for the client from clients.md. A
project-root serves Claude Code and VS Code at once for OAuth; see
the note at the top of clients.md. Copilot CLI is token-only and gets its own
entry named .
.mcp.jsonprepr-token- Merge into the existing file. Keep other servers exactly as they are.
- If an existing HTTP entry is present (for example with the old
preprURL), update it in place in the file where it lives, even if that is not the file you would pick for a new entry: URL, headers, and the client's required/mcp. Never leave two"type"entries that the same client reads.prepr - If the existing entry is a stdio or entry (a
mcp-remoteinstead of acommand), replace the whole entry, and only after the user agrees. Otherwise print the snippet.url - If an existing entry holds a literal token, never print it: mask it as
in anything you show. Replace it with the env-var reference and advise the user to rotate the token, since it has been stored in a file.
Bearer **** - If the file cannot be edited safely (JSON with comments, or an entry in a shape you do not recognise), do not touch it. Print the snippet and tell the user where it goes.
- Write project-level files directly. Never write a user-level file that would hold a token; give the user the command from clients.md instead (Copilot CLI).
- Claude Desktop and ChatGPT have no file. Give the steps from clients.md.
使用 clients.md 中对应客户端的配置片段。对于 OAuth,项目根目录下的 可同时用于 Claude Code 和 VS Code;请参阅 clients.md 顶部的说明。Copilot CLI 仅支持 Token,并使用名为 的独立条目。
.mcp.jsonprepr-token- 合并到现有文件中。其他服务器配置必须保持原样。
- 如果已经存在 HTTP 条目(例如使用旧版
preprURL),即使该文件不是你原本会为新条目选择的文件,也要直接在其中就地更新该条目,包括 URL、headers 和客户端要求的/mcp。绝不能留下同一客户端会读取的两个"type"条目。prepr - 如果现有条目是 stdio 或 条目(即使用
mcp-remote而不是command),只有在用户同意后才能替换整个条目;否则,打印配置片段。url - 如果现有条目包含明文 token,绝不要打印出来:展示时必须将其遮盖为 。将其替换为环境变量引用,并建议用户轮换 token,因为它已被存储在文件中。
Bearer **** - 如果无法安全编辑文件(例如 JSON 包含注释,或条目结构无法识别),不要修改该文件。打印配置片段,并告知用户应将其放在哪里。
- 直接写入项目级文件。绝不要写入会保存 token 的用户级文件;应改为提供 clients.md 中的命令(Copilot CLI)。
- Claude Desktop 和 ChatGPT 没有对应文件。请提供 clients.md 中的操作步骤。
Step 4: Token route only
第 4 步:仅适用于 Token 认证
- The config references in the client's own syntax. Never ask for the token, never write it into any file, never echo it.
PREPR_MCP_TOKEN - Tell the user how to get one: email support@prepr.io and name the Prepr environment it is for.
- Tell them to set it in their shell profile (for example
in
export PREPR_MCP_TOKEN=...) and restart the client. Not in a committed file. VS Code is the exception: it prompts for the token and stores it itself.~/.zshrc
- 配置应使用客户端自身的语法引用 。绝不要要求用户提供 token,绝不要将其写入任何文件,也绝不要回显它。
PREPR_MCP_TOKEN - 告知用户如何获取 token:发送邮件至 support@prepr.io,并注明 token 所对应的 Prepr 环境。
- 告知用户在 shell 配置文件中设置它(例如在 中执行
~/.zshrc),然后重启客户端。不要将其放入会提交到版本控制的文件。VS Code 是例外:它会提示用户输入 token,并由其自行存储。export PREPR_MCP_TOKEN=...
Step 5: Authorize and verify
第 5 步:授权并验证
- Give the one authorize step for the client (from the check). Mention that OAuth asks them to pick an environment, and that changing environment later means authorizing again.
- Ask the user to say when they are done. Some clients need a restart or a reload to pick up the new server.
- Call for the environment's name and domain, then
get_initial_context(first page only, read-only). Report the environment and how many models it has. If the tools are still missing, go back to the check and report which state you are in.list_schema - If the project's front end has its own Prepr GraphQL URL or token (for
example in ), check that it reads the same environment as MCP: compare one item's id through both. A different environment means schema and content changes made through MCP will not show in the app or in its generated types. Never print the token while you check.
.env
- 提供检查中针对该客户端的单个授权步骤。说明 OAuth 会要求用户选择一个环境,并且以后切换环境时需要重新授权。
- 请用户完成后告知你。部分客户端需要重启或重新加载才能识别新服务器。
- 调用 获取环境名称和域名,然后调用
get_initial_context(仅第一页,只读)。报告环境及其模型数量。如果工具仍然缺失,请返回检查并报告当前所处的状态。list_schema - 如果项目的前端拥有自己的 Prepr GraphQL URL 或 token(例如位于 中),请确认它与 MCP 读取的是同一环境:通过两种方式比较某个 item 的 id。环境不同意味着通过 MCP 进行的 schema 和内容更改不会显示在应用或其生成的类型中。检查期间绝不要打印 token。
.env
Step 6: Allow read-only tools (Claude Code)
第 6 步:允许只读工具(Claude Code)
Each Prepr tool asks for permission the first time, which blocks the checks
above in a non-interactive session. Offer to allow the read-only tools in the
project's under :
, ,
, ,
, . Write this only after the
user agrees, merge with existing entries, and never allow write tools or a
wildcard: every write must keep asking.
.claude/settings.jsonpermissions.allowmcp__prepr__get_initial_contextmcp__prepr__list_schemamcp__prepr__get_schema_entitymcp__prepr__query_itemsmcp__prepr__get_itemmcp__prepr__list_locales每个 Prepr 工具首次使用时都会请求权限,这会在非交互式会话中阻塞上述检查。可以提议在项目的 中,通过 允许以下只读工具:、、、、、。只有在用户同意后才能写入,必须与现有条目合并,并且绝不能允许写工具或通配符:每次写入都必须继续请求确认。
.claude/settings.jsonpermissions.allowmcp__prepr__get_initial_contextmcp__prepr__list_schemamcp__prepr__get_schema_entitymcp__prepr__query_itemsmcp__prepr__get_itemmcp__prepr__list_localesStep 7: Mention the environment AI context
第 7 步:提及环境 AI 上下文
get_initial_contextget_initial_contextStep 8: Recommend a safety setting
第 8 步:建议采用安全设置
Tell the user once: for production, an administrator can switch off schema
writes and deletes for all MCP requests under
Settings → Integrations → MCP Server, while keeping them on in development.
请告知用户一次:在生产环境中,管理员可以在 Settings → Integrations → MCP Server 下关闭所有 MCP 请求的 schema 写入和删除功能,同时在开发环境中保持这些功能开启。
What's next
接下来
Offer the next step that fits: design a content model (),
review the existing schema (), keep the schema in Git
(), or work with content ().
design-schemareview-schemasync-schemamanage-content主动提供符合需求的下一步:设计内容模型()、审查现有 schema()、将 schema 保留在 Git 中(),或处理内容()。
design-schemareview-schemasync-schemamanage-content