Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7b95a54
feat(memory-mcp): 用户级 token 存储与 HTTP API
ArvinQi Nov 9, 2026
df6a8b0
feat(memory-mcp): MCP 鉴权与工具面按 review 重做
ArvinQi Nov 9, 2026
da016b8
docs(memory-mcp): 更新接入文档与 CHANGELOG
ArvinQi Nov 9, 2026
3683574
feat(memory-mcp): vendor DSH 原生记忆插件 octop-memory-native(开源版)
ArvinQi Nov 9, 2026
f00ab5c
feat(memory-mcp): 本地终端接入——安装器 + hooks + transcript 导入
ArvinQi Nov 9, 2026
e55d3b7
docs(memory-mcp): 补充终端接入、DSH 原生插件与安装器说明
ArvinQi Nov 9, 2026
74d2160
test(memory-mcp): 脱敏断言的禁用词只保留废弃身份头
ArvinQi Nov 9, 2026
2deedab
docs(memory-mcp): 安装器注释去掉内网措辞
ArvinQi Nov 9, 2026
f4f9149
feat(dashboard): 记忆页新增「MCP 接入」token 管理
ArvinQi Nov 9, 2026
b8b0c2b
feat(memory-mcp): token 绑定单一专家,免 agent 头 + 切换专家 API
ArvinQi Nov 10, 2026
dc1d666
feat(dashboard): token 绑定/切换上报专家
ArvinQi Nov 10, 2026
235eb84
feat(memory-mcp): 安装器与 hooks 只带 token(不再传专家 ID)
ArvinQi Nov 10, 2026
da39471
docs(memory-mcp): 安装与配置指引 + Dashboard 展示 curl 一键命令
ArvinQi Nov 10, 2026
039dec9
fix(memory-mcp): Claude Code hook 改用 matcher 组形态
ArvinQi Nov 10, 2026
564ddc3
feat(dashboard): 安装命令紧贴 Token,并提供复制 Token / 复制命令
ArvinQi Nov 10, 2026
a7eed59
feat(memory-mcp): token 接入端统计 + 按接入端启用/禁用
ArvinQi Nov 10, 2026
a2f56ed
feat(dashboard): MCP 接入 tab 前移 + 接入说明链接 + 行内「接入命令」
ArvinQi Nov 10, 2026
fb04c96
feat(dashboard): 生成窗口固定为「Token + 一键安装命令」两段
ArvinQi Nov 10, 2026
17e9b9d
style(dashboard): 接入端开关补列标题,行内操作改紧凑链接按钮
ArvinQi Nov 10, 2026
515372a
style(dashboard): 行内操作改为图标按钮(接入命令/切换专家/撤销),操作列收窄到 132px
ArvinQi Nov 10, 2026
95ea788
fix(memory-mcp): 来源用 token 名、挂载只看显式开关、transcript 统一走 runtime.capture
ArvinQi Nov 10, 2026
734db49
style(dashboard): 接入端开关固定 44px(min-width + max-width),避免被压缩或撑开列宽
ArvinQi Nov 10, 2026
0b4dfd1
refactor(memory-mcp): 客户端侧代码拆出本 PR,服务端只留 MCP + token + UI
ArvinQi Nov 10, 2026
8726b70
docs(memory-mcp): 指向 DSH 原生插件的独立仓库
ArvinQi Nov 10, 2026
9058aa6
feat(dashboard): 专家记忆抽屉顶部显示 MCP 接入地址与鉴权说明
ArvinQi Nov 10, 2026
2cd7891
docs(memory-mcp): DSH 插件更名为 dsh-octop-memory
ArvinQi Nov 10, 2026
f01f8fc
feat(dashboard): 专家记忆抽屉改用「AI 终端接入」Tab(去掉顶部提示条)
ArvinQi Nov 10, 2026
b401735
style(dashboard): 接入 tab 改名为「终端接入」
ArvinQi Nov 10, 2026
a0fcda0
feat(dashboard,docs): 恢复一行接入命令(sh/ps1),文档补客户端插件安装
ArvinQi Nov 10, 2026
62f985b
style(dashboard): Token 弹窗加宽并改为分类 Tab(一键安装/Windows/手动配置),突出先保存 Token
ArvinQi Nov 11, 2026
cb21de3
style(dashboard): 终端接入页去掉顶部客户端配置提示(避免只提 MCP、漏掉 hooks)
ArvinQi Nov 11, 2026
f19a402
feat(dashboard): 终端接入页接入 AI 安装入口(复制含 token 的 AI 指令)
ArvinQi Nov 12, 2026
2f2407f
feat(dashboard): 「终端接入」从记忆面板独立为设置菜单页
ArvinQi Nov 13, 2026
fc34e74
style(dashboard): 终端接入操作列恢复文字按钮(接入配置/切换专家/撤销)
ArvinQi Nov 13, 2026
223eb6c
style(dashboard): 终端接入操作列对齐内部版本(图标 + 文字,宽 276,scroll.x 1120)
ArvinQi Nov 13, 2026
e81dff3
fix(memory-mcp): 事件批次超限显式报错 + 重试幂等
ArvinQi Nov 17, 2026
3464517
Merge upstream develop into feat/memory-mcp-extension-develop
ArvinQi Nov 17, 2026
51bea3b
refactor(memory-mcp): touch 节流 + 复用统一专家权限检查
ArvinQi Nov 17, 2026
20ffc01
fix(memory-mcp): greenfield(尚未绑定 DB)时跳过挂载,不让启动崩溃
ArvinQi Nov 17, 2026
1328a71
fix(memory-mcp): 复审 2 项阻塞 + 4 项非阻塞
ArvinQi Nov 17, 2026
4424fc1
Merge branch 'develop' into feat/memory-mcp-extension-develop
Bosheng0422 Nov 17, 2026
f258a5b
Merge branch 'develop' into feat/memory-mcp-extension-develop
Bosheng0422 Nov 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
## [1.0.3b7] - 2026-11-17

### 新增
- 专家记忆新增 MCP Server(`/mcp/memory`):外部 Agent / Bot 用用户级 token 检索、写入、采集专家记忆;token 可按客户端命名、限定专家范围并单独吊销,外部写入默认进入审核队列;并提供 Claude Code / Kiro / DSH / Codex / Cursor 一键接入(DSH 走原生插件,支持项目级安装与 Windows PowerShell);MCP token 直接绑定上报专家、可在面板切换,客户端只带 token 即可
- 工作台「云服务器」页的地域筛选器改为控制台风格下拉面板:按大区分组展示各地域并标注节点数量,只有有节点的地域才显示红点,同时记住最近访问的地域
- 托管专家可选会话模式,并能使用连接器、知识库、专家回调和已启用的插件
- 云服务器页的地域筛选改为按大区分组的下拉面板

Expand All @@ -26,6 +28,8 @@
## [1.0.3b6] - 2026-11-15

### 新增
- 专家市场默认打开「精选」,用书签标出接入市场前随安装包提供的 22 个专家模板
- 通道卡片与 `/api/health` 展示每个通道的入站、出站、重连和丢弃计数;记忆存储页显示 checkpoint 保留窗口与 VACUUM 提示
- 支持 Helm 集群部署。多实例共用一个 PostgreSQL
- 管理员可以限制创建专家时能选的存储后端
- 新增托管专家,对话可以交给后端 Agent,如 OpenCode
Expand Down
132 changes: 132 additions & 0 deletions dashboard/src/api/modules/memoryMcp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/**
* memoryMcp — user-level API tokens for the memory MCP server.
*
* Routes live under ``/api/memory-mcp/tokens`` (``octop.api.routers.memory_mcp``).
* Tokens are personal: a caller acts as the user the token was issued to, so
* ``X-Octop-User-Id`` is never trusted. Only the digest is stored server-side;
* the plaintext value is returned exactly once, at creation.
*
* Wire shapes are snake_case on purpose, mirroring the backend ``TokenOut`` /
* ``TokenCreated`` models.
*/

import { request } from "../request";

/**
* Usage of one client integration, keyed in ``MemoryMcpToken.client_stats`` by
* the ``X-Octop-Client`` value the client sends (e.g. ``claude-code``).
*/
export interface MemoryMcpClientStat {
/** ISO-8601 UTC of the first request carrying this client header. */
first_seen: string;
/** ISO-8601 UTC of the most recent such request. */
last_seen: string;
/** Requests seen with this client header. */
count: number;
}

export interface MemoryMcpToken {
/** Public id used to revoke the token. */
token_id: string;
/** Client name supplied at creation, e.g. ``codex@macbook``. */
name: string;
/** Expert (agent) allow-list; null means every expert the user can access. */
expert_ids: string[] | null;
/** Masked value safe to display, e.g. ``omcp_…abcd``. */
token_hint: string;
/** ISO-8601 UTC. */
created_at: string;
/** ISO-8601 UTC, or null when the token has never been used. */
last_used_at: string | null;
/** ISO-8601 UTC once revoked; null while the token is active. */
revoked_at: string | null;
/**
* Clients switched off for this token; null means every client may call.
* A disabled client is rejected server-side regardless of ``client_stats``.
*/
disabled_clients: string[] | null;
/**
* Per-client usage, or null until some client sends ``X-Octop-Client``.
* Requests without that header are counted only in ``last_used_at``.
*/
client_stats: Record<string, MemoryMcpClientStat> | null;
}

/** Successful create result: the token row plus its one-time plaintext. */
export interface MemoryMcpTokenCreated {
token: MemoryMcpToken;
plaintext: string;
}

export interface CreateMemoryMcpTokenBody {
name: string;
/** Omit / null to allow every expert the issuing user can access. */
expert_ids: string[] | null;
}

/**
* Partial update body for ``PATCH /memory-mcp/tokens/{token_id}``.
*
* A token bound to exactly one expert needs no ``X-Octop-Agent-Id`` on MCP
* requests (the binding decides where reports land); ``expert_ids: null``
* clears the binding, which brings the header requirement back.
*/
export interface UpdateMemoryMcpTokenBody {
/** New display name; omitted leaves it untouched. */
name?: string;
/** Exactly one id pins the expert; null means "no restriction". */
expert_ids?: string[] | null;
/** Clients switched off; an empty list is sent as null ("all allowed"). */
disabled_clients?: string[] | null;
}

export interface RevokeMemoryMcpTokenResponse {
revoked: boolean;
}

/** Backend ``TokenCreated``: a flat ``TokenOut`` plus the one-time plaintext. */
type TokenCreatedWire = MemoryMcpToken & { token: string };

function toCreated(raw: TokenCreatedWire): MemoryMcpTokenCreated {
const { token, ...row } = raw;
return { token: row, plaintext: token };
}

export const memoryMcpApi = {
list: () => request<MemoryMcpToken[]>("/memory-mcp/tokens"),

create: (body: CreateMemoryMcpTokenBody) =>
request<TokenCreatedWire>("/memory-mcp/tokens", {
method: "POST",
body: JSON.stringify(body),
}).then(toCreated),

/** Rename and/or re-bind the token's expert. Returns ``TokenOut`` (no plaintext). */
update: (tokenId: string, body: UpdateMemoryMcpTokenBody) =>
request<MemoryMcpToken>(
`/memory-mcp/tokens/${encodeURIComponent(tokenId)}`,
{
method: "PATCH",
body: JSON.stringify(body),
},
),

revoke: (tokenId: string) =>
request<RevokeMemoryMcpTokenResponse>(
`/memory-mcp/tokens/${encodeURIComponent(tokenId)}`,
{ method: "DELETE" },
),

/**
* Issue a fresh secret for an existing token; the old plaintext stops working
* immediately. Returns ``TokenOut`` plus the one-time plaintext, exactly like
* ``create``. Revoked tokens are rejected by the server (409).
*/
rotate: (tokenId: string) =>
request<TokenCreatedWire>(
`/memory-mcp/tokens/${encodeURIComponent(tokenId)}/rotate`,
{ method: "POST" },
).then(toCreated),
};

export default memoryMcpApi;
11 changes: 11 additions & 0 deletions dashboard/src/layouts/sidebarNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
GraduationCap,
Shield,
PanelsTopLeft,
KeyRound,
} from "lucide-react";
import type { OctopUser } from "../api/modules/auth";
import { navAllowed, userCan } from "../utils/permissions";
Expand Down Expand Up @@ -69,6 +70,7 @@ export const SIDEBAR_NAV_KEYS = [
"experts",
"tasks",
"token-usage",
"tokens",
"personalization",
"channels",
"connectors",
Expand Down Expand Up @@ -123,6 +125,7 @@ export function navSectionLabel(
* comes from {@link buildNavSections}.
*/
export const SIDEBAR_GROUPED_NAV_KEYS = [
"tokens",
"personalization",
"channels",
"connectors",
Expand Down Expand Up @@ -234,6 +237,14 @@ export function buildNavSections(
labelKey: "nav.bridge",
});
}
if (navAllowed(user, "tokens")) {
settingsItems.push({
key: "tokens",
path: "/tokens",
icon: <KeyRound size={iconSize} strokeWidth={iconStroke} />,
labelKey: "nav.tokens",
});
}
if (settingsItems.length > 0) {
sections.push({
id: "settings",
Expand Down
81 changes: 77 additions & 4 deletions dashboard/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@
"WEBAUTHN_LOGIN_DISABLED": "Passkey sign-in on the login page is turned off. An administrator can enable it under App settings → Passkeys."
},
"nav": {
"tokens": "Terminal access",
"chat": "Conversation",
"common": "Common",
"control": "Control",
Expand Down Expand Up @@ -953,10 +954,8 @@
"emptyHint": "No user-published templates yet. On My Experts, click the upload icon on a card to publish one.",
"by": "by {{name}}",
"install": "Install",
"installTitle": "Install \"{{name}}\"",
"installFailed": "Failed to install template",
"drawerTitle": "Publish expert template",
"drawerHint": "Only expert config markdown (SOUL, IDENTITY, …), skills, and sub-agent definitions are included. Runtime data such as memory DB, uploads, and built-in skills is excluded.",
"fieldName": "Template name",
"fieldDescription": "Description",
"fieldWelcomeZh": "Welcome message (Chinese)",
Expand Down Expand Up @@ -4007,7 +4006,6 @@
"emptyGuideStepHowDetail": "Click Add connection and enter the peer address, username, and password. Probe first to confirm the account, then save and connect. Start the link from the side that can reach the other.",
"emptyGuideStepChat": "How to chat",
"emptyGuideStepChatDetail": "After it connects, remote experts and teams show up under Cloud in the chat sidebar. The Experts tab also lists remote experts, and the Teams tab lists remote teams.",
"drawerHint": "The display name is used for chat group switching and must be unique. Probe first to verify the account; Save & connect only persists after login and the cloud-collab handshake succeed — a failure will not keep the name.",
"directionHint": "Initiate from the side that can reach the other. Typically a LAN or laptop connects out to a public/cloud Octop. Probe only checks the account; the handshake must also succeed before the row is saved.",
"sectionIdentity": "Display",
"sectionRemote": "Peer account",
Expand Down Expand Up @@ -4785,7 +4783,82 @@
"journal": "Activity",
"proactive": "Proactive care",
"settings": "Settings",
"userFile": "User profile"
"userFile": "User profile",
"mcp": "Terminal access"
},
"mcp": {
"title": "Terminal access",
"description": "External agents (Claude Code / Codex / Cursor / Kiro / DSH) use a token here to reach {{endpoint}}. A token is shown only once; create a new one if it is lost.",
"installTitle": "Client setup",
"installWithToken": "Or run this to configure the client right away:",
"copyToken": "Copy token",
"copyCommand": "Copy command",
"tokenLabel": "Token",
"installScriptLabel": "One-line install with hooks (macOS / Linux):",
"installScriptPsLabel": "Windows PowerShell:",
"commandReady": "Copy and keep the token first (it cannot be viewed again after closing). Pick one way to connect below:",
"unboundHint": "This token is not bound to exactly one expert: install scripts cannot work; use this manual config and replace <expert id>.",
"create": "Create token",
"loadFailed": "Could not load tokens.",
"empty": "No MCP tokens yet",
"emptyHint": "Create one to let an external agent access your memory.",
"columnName": "Name",
"columnHint": "Token hint",
"columnExperts": "Reporting expert",
"columnClients": "Clients",
"columnCreatedAt": "Created",
"columnLastUsedAt": "Last used",
"columnStatus": "Status",
"columnActions": "Actions",
"clientColumnName": "Client",
"clientColumnLastSeen": "Last used",
"clientColumnEnabled": "Enabled",
"clientColumnCount": "Calls",
"clientsEmpty": "No client activity yet (a client shows up after it sends X-Octop-Client).",
"clientSwitchLabel": "{{client}} access",
"clientsUpdated": "Client access updated",
"clientsUpdateFailed": "Could not update client access. Please retry.",
"docsLink": "Setup guide",
"command": "Setup command",
"commandTitle": "Regenerate the setup command",
"commandMissingWarning": "The token plaintext is shown only once, at creation, so the config cannot be rebuilt now. Regenerating invalidates the current token immediately — update every configured client.",
"commandRegenerate": "Regenerate and copy",
"commandRotated": "Regenerated: the old token no longer works. Copy the new config now and update the configured clients.",
"rotateFailed": "Could not regenerate the token. Please retry.",
"allExperts": "Any expert",
"expertCount": "{{count}} expert(s)",
"neverUsed": "Never used",
"statusActive": "Active",
"statusRevoked": "Revoked",
"revoke": "Revoke",
"revokeConfirmTitle": "Revoke this token?",
"revokeConfirmDesc": "External agents using this token lose access to memory immediately. This cannot be undone.",
"revoked": "Token revoked",
"revokeFailed": "Could not revoke the token. Please retry.",
"createTitle": "Create MCP token",
"nameLabel": "Name",
"namePlaceholder": "e.g. codex@macbook",
"nameRequired": "Please enter a name",
"nameTooLong": "Name must be at most 64 characters",
"expertsLabel": "Reporting expert",
"expertsPlaceholder": "Select an expert",
"expertsHint": "The token is bound to this expert: memory reported through it lands here.",
"expertRequired": "Please select an expert",
"expertUnrestricted": "No expert restriction (client must send X-Octop-Agent-Id)",
"switchExpert": "Switch expert",
"switchExpertTitle": "Switch reporting expert",
"switchExpertHint": "New reports through this token land on the new expert. Memory already stored is not migrated.",
"switchExpertPlaceholder": "Select an expert",
"switchExpertSuccess": "Reporting expert updated",
"switchExpertFailed": "Could not switch the expert. Please retry.",
"submit": "Create",
"createFailed": "Could not create the token. Please retry.",
"plaintextTitle": "Token created",
"plaintextWarning": "Copy and save it now. This token is shown only once and cannot be viewed again after closing.",
"copy": "Copy",
"copied": "Copied",
"copyFailed": "Copy failed. Select and copy it manually.",
"close": "Saved, close"
},
"strong": {
"contextNotice": "Strong memory is loaded once when a session starts and stays in that session's context.",
Expand Down
Loading