Temps Mcp Setup 标志

Temps Mcp Setup

组织
gotempsh
temps-mcp-setup

Configure Temps as an MCP (Model Context Protocol) server so AI assistants can interact with a Temps instance directly -- listing/inspecting projects and deployments, and (when write mode is enabled) triggering deployments with human confirmation. Use when the user wants to: (1) Set up the Temps MCP server, (2) Connect Claude Code/Desktop, Codex, Cursor, VS Code, Windsurf, or Zed to Temps, (3) Add Temps tools to an AI assistant, (4) Test the MCP wizard locally, (5) Manage multiple Temps MCP connections (dev, staging, prod, or several local dev slots) side by side. Triggers: "temps mcp", "configure temps tools", "add temps to claude", "temps ai assistant", "mcp server setup", "mcp add", "test the mcp wizard".

Add to TypingMind

概览

发布者gotempsh
代码仓库temps
技能名称temps-mcp-setup
星标数
836
复刻数
68
附带文件
仅含指令
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 gotempsh 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Temps Mcp Setup AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/gotempsh/temps/tree/main/skills/temps-mcp-setup
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/gotempsh/temps.git /tmp/temps
mkdir -p .claude/skills
cp -r /tmp/temps/skills/temps-mcp-setup .claude/skills/temps-mcp-setup
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Temps Mcp Setup,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Temps Mcp Setup。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Temps Mcp Setup 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Temps MCP Setup

Temps serves MCP (Model Context Protocol) directly from the temps binary itself (ADR-039, crates/temps-mcp-server) -- there is no separate package to install or keep up to date. The MCP endpoint calls the same service layer as the REST API, so it cannot drift from it the way the old standalone @temps-sdk/mcp npm package did (removed in PR #355 for exactly that reason -- do not reinstall it or point a client at it).

Installer wizard lives in apps/temps-cli/src/commands/mcp/ (bunx @temps-sdk/cli mcp add|remove|status).

1. Enable the MCP server (operator, one-time per instance)

Off by default (AppSettings.mcp_server.enabled = false), so a fresh install never exposes it unconfigured. Turn it on as an admin:

bash
bunx @temps-sdk/cli mcp enable

If you're not logged in yet, mcp enable offers to run the device-flow login inline (see Auth model, precisely below) -- no separate temps login step required first.

mcp enable does the same GET-modify-PUT round-trip against /api/settings the handler requires (it takes the full AppSettings object, not a partial patch), merging onto whatever is already fetched so it can never clobber another admin's settings. mcp disable reverses it.

Verify it took effect, or check status any time without re-running enable:

bash
bunx @temps-sdk/cli mcp status
# "This instance: <check> enabled (http://localhost:8080)" or "<bullet> disabled (...)"

Or probe the endpoint directly (no auth needed for this one):

bash
curl -s http://localhost:8080/mcp/tools
# {"groups":[{"key":"deployments","label":"Deployments & Projects"}, ...]}
# A 404 here means the flag is still off (or this instance predates MCP support).

2. Configure your AI client (per user, per client)

bash
bunx @temps-sdk/cli mcp add <client>

<client> is one of: claude-code, claude-desktop, codex, cursor, vscode, windsurf, zed.

Auth model, precisely: mcp add/mcp enable/mcp disable need you logged into the CLI so the wizard can mint an API key on your behalf -- that login has nothing to do with MCP itself. If you're not already logged in, these commands detect that and offer to run the device-authorization flow right there (prompts "Log in now?", then "Temps server URL", defaulting to your current config) rather than erroring out and making you run temps login as a separate step first. Under the hood it's the same flow temps login uses (/auth/cli/device/start + /auth/cli/device/poll, server-authoritative polling, no code to type, browser approval). In --yes (non-interactive) mode this inline offer is skipped -- pass --api-key or ensure a context is already logged in. What actually gets written into the AI client's config either way is a plain, long-lived Authorization: Bearer <api-key> header -- the same static-bearer-token pattern PostHog's own MCP wizard uses, and one of the two auth patterns the MCP HTTP transport spec supports (the other being full OAuth 2.1 + dynamic client registration, which most of these 7 clients don't yet implement for remote MCP servers anyway).

The wizard will:

  1. Probe /mcp/tools to confirm the instance has MCP enabled (see step 1). If it 404s, it tells you so and stops -- it will not silently write a broken config.
  2. Ask which tool groups to enable (default: all).
  3. Ask whether to enable write tools (default: no -- read-only). Write tools still require human confirmation per call even when enabled (see below).
  4. Offer to create a dedicated, scoped API key for MCP access, recommended over reusing a broader existing credential. The new key's role is role_type: 'reader' when write mode is off, 'user' when it's on (the user role carries DeploymentsWrite; reader does not).
  5. Write the client's config file (or, for Claude Code/Codex, shell out to their own claude mcp add / codex mcp add so their config format is never hand-maintained here).

Other subcommands:

bash
bunx @temps-sdk/cli mcp status         # which clients on this machine have Temps configured
bunx @temps-sdk/cli mcp remove <client>

Restart the AI client after running mcp add -- most clients only read MCP config at startup.

3. Testing the wizard locally, end-to-end

Bring up a local instance with the start-temps skill first (or reuse one you already have running), noting its slot -- every non-zero slot has its own ports, database, and login, so treat the printed web/api URLs as this instance's identity for the rest of this section.

Fastest path to a working test without the interactive prompts: mcp add --yes with an explicit --api-key, pointed at the slot's API URL via TEMPS_API_URL (or --target-context, if you've already run temps login against that instance and saved a context).

bash
# One-time per slot: enable the flag (step 1) and mint a throwaway admin key
# (or use the wizard's own key-creation step interactively instead).

TEMPS_API_URL=http://localhost:<8080+slot*10> bunx @temps-sdk/cli mcp add claude-code \
  --api-key <key> --yes

Then drive the protocol directly with curl -- this is the fastest way to verify the server side without depending on any particular AI client being installed:

bash
API=http://localhost:<8080+slot*10>
KEY=<your-api-key>

# Capability probe (no auth)
curl -s "$API/mcp/tools"

# initialize
curl -s "$API/mcp" -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'

# tools/list -- add ?write=1 to the $API/mcp URL to also see trigger_deployment/confirm_action
curl -s "$API/mcp" -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'

# tools/call
curl -s "$API/mcp" -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"list_projects","arguments":{}}}'

If list_projects returns [], there's nothing to look at yet -- create a project via the normal REST API or the web UI first (create_project is not an MCP tool; see Current Coverage below).

Testing the write flow (propose-then-confirm): call trigger_deployment on the ?write=1 connection with a real project_id/environment_id, note the _proposal_token in the response, then call confirm_action with that token within 5 minutes. Confirm it only works once -- replaying the same token must return a Proposal token not found or already used error. If you have DB access, confirm the audit row landed: SELECT * FROM audit_logs WHERE operation_type = 'MCP_DEPLOYMENT_TRIGGERED' ORDER BY id DESC LIMIT 1;.

Testing an actual AI client end-to-end: after mcp add <client> and a restart, ask it something that requires a tool call ("list my Temps projects") and confirm it actually invokes list_projects rather than hallucinating an answer -- most clients show a tool-call approval prompt or a visible "using tool" indicator you can check against the request actually hitting your instance's logs.

4. Managing multiple installations

You will commonly have more than one Temps instance you want an AI client talking to at once -- several local dev slots, or dev + staging + prod. Each is a fully independent MCP connection: a distinct URL, a distinct API key, and (for clients that support named servers) a distinct entry in that client's config.

  • Run mcp add <client> once per instance you want configured. The wizard does not currently namespace by instance -- it writes to the single temps entry key most clients use (mcpServers.temps / context_servers.temps / etc.), so adding a second instance for the same client overwrites the first entry rather than adding a second one. If you need two Temps connections live in the same client simultaneously today, hand-edit the client's config file after running the wizard once, duplicating the temps entry under a second key (e.g. temps-staging) with that instance's URL/key -- the wizard itself doesn't offer this yet.
  • bunx @temps-sdk/cli mcp status only reports whether a Temps entry exists per client, not which instance it points at -- check the URL inside the config file directly if you've hand-edited it, or bunx @temps-sdk/cli mcp remove <client> and re-run mcp add when switching which instance a client talks to.
  • Scope API keys per instance, not per person. Each mcp add run against a different instance should mint its own key on that instance (step 2.4) rather than reusing one key across instances -- keys don't work cross-instance anyway (each instance has its own user/key table), but it also keeps revocation scoped: pulling a compromised or no-longer-needed key from one instance's Settings -> API Keys doesn't touch the others.
  • Local dev slots are the common case for this repo. Each start-temps slot is already a fully separate instance (own port, own DB, own admin login) -- point TEMPS_API_URL at the specific slot you're testing (see the start-temps skill for the port formula) and mint a key on that slot. Don't reuse a key minted on slot 0 against slot 3's API URL; it will 401 (different DB, different users table).
  • Read-only vs. write connections are also separate "installations" in practice. If you want both a safe read-only Temps connection for everyday use and a write-enabled one for a specific deployment-management session, that's two mcp add runs (two keys, two config entries) rather than one -- the wizard's write-mode question is per-connection, not a runtime toggle.

Tool groups

Tools are organized into 7 groups, selectable via the wizard or the connection URL's ?groups= param:

GroupContents
deploymentsprojects, deployments, environments, presets
infrastructureservices, containers, load-balancer, scans
networkingdomains, custom-domains, dns-providers, ip-access
databackups, dsn
observabilitymonitors, incidents, errors, proxy-logs, funnels, analytics
notificationsnotifications, notification-prefs, webhooks, email-domains, email-providers
platformusers, settings, api-keys, audit, tokens, platform

Current coverage: only platform (list_projects, get_project) and deployments (list_deployments, and the write tools trigger_deployment / confirm_action) have real tools implemented so far. The other five groups exist in the taxonomy but have no tools registered yet -- tools/list omits them until they're ported from the old mcp/src/tools/*.ts reference implementations (kept on this branch for reference, not published). Notably, there is no create_project MCP tool yet -- create projects via the REST API or web UI, then use MCP to list/inspect/deploy them.

Write tools: propose-then-confirm

When a client is configured with write mode on, calling a write tool (e.g. trigger_deployment) does not execute immediately. It returns a proposal describing the intended action and a short-lived (5 minute), single-use token. The AI client shows this to you; if you approve, it calls confirm_action with that token, which is the only path that actually executes the mutation. Declining, or letting the token expire, does nothing. Every successful confirm_action write is audit-logged (MCP_DEPLOYMENT_TRIGGERED) with the calling user, IP, and user agent, same as the equivalent REST endpoint.

This means enabling write mode does not hand an AI assistant unsupervised control of your infrastructure -- every mutation still needs an explicit confirmation step in the conversation.

Authentication

Every request except GET /mcp/tools requires Authorization: Bearer <api-key>, validated by the same auth path as the REST API. A key's existing scoped permissions apply normally -- an MCP tool that needs DeploymentsWrite is rejected exactly like the equivalent REST call would be if the key lacks it. ?groups= / ?write=1 only narrow what a call could reach; they never grant permissions the key doesn't already have.

Troubleshooting

mcp add reports "this instance does not support MCP":

  • The feature flag is off -- see step 1.
  • You're pointed at the wrong TEMPS_API_URL (check bunx @temps-sdk/cli status).

Tools not appearing in the AI client after mcp add:

  • Restart the client completely.
  • Run bunx @temps-sdk/cli mcp status to confirm the config was actually written.
  • For Claude Code/Codex, run claude mcp list / codex mcp list directly to check their own registry.

Write tool calls fail with a permission error even though write mode is on:

  • ?write=1 only controls whether write tools are listed; the API key still needs the underlying permission (e.g. DeploymentsWrite) to actually call one -- that check happens at call time, the same as the equivalent REST endpoint.

A tool call returns "unknown tool":

  • Check which groups are active for this connection (?groups= in the config URL) -- a tool outside the active groups is not registered at all, not just hidden.

Local testing hits a "preview gateway: forbidden" error instead of your MCP response: unrelated to MCP -- the global temps-preview-gateway Docker container's host port mapping can coincidentally collide with a dev slot's HTTP port. Hit the machine's real LAN IP (ifconfig, not localhost/127.0.0.1) instead; the temps serve process binds 0.0.0.0, so it's reachable on any interface even when 127.0.0.1:<port> is claimed by the gateway container.

常见问题

Temps Mcp Setup AI 技能有什么作用?

Configure Temps as an MCP (Model Context Protocol) server so AI assistants can interact with a Temps instance directly -- listing/inspecting projects and deployments, and (when write mode is enabled) triggering deployments with human confirmation. Use when the user wants to: (1) Set up the Temps MCP server, (2) Connect Claude Code/Desktop, Codex, Cursor, VS Code, Windsurf, or Zed to Temps, (3) Add Temps tools to an AI assistant, (4) Test the MCP wizard locally, (5) Manage multiple Temps MCP connections (dev, staging, prod, or several local dev slots) side by side. Triggers: "temps mcp", "co...

为什么在 TypingMind 中使用 Temps Mcp Setup?

因为您只需安装一次,就能搭配任何模型使用。Temps Mcp Setup 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Temps Mcp Setup?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/gotempsh/temps/tree/main/skills/temps-mcp-setup。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Temps Mcp Setup?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Temps Mcp Setup 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Temps Mcp Setup 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Temps Mcp Setup AI 技能免费吗?

是的。gotempsh 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇