Skip to main content
Glama

Mavis MCP Server

将 Mavis 作为 MCP Server 暴露给 Claude Code / Agent SDK / 任何 MCP 客户端调用。

快速开始

1. 添加到 Claude Code

# 方法一:直接配置(全局)
claude mcp add mavis --type stdio -- node /Users/cunning/.mavis/agents/mavis-mcp-server/src/index.js

# 方法二:手动配置项目
# 将以下内容添加到项目根目录的 .mcp.json 文件

在项目 .mcp.json 中添加:

{
  "mcpServers": {
    "mavis": {
      "type": "stdio",
      "command": "node",
      "args": ["/Users/cunning/.mavis/agents/mavis-mcp-server/src/index.js"]
    }
  }
}

2. 用 Agent SDK 调用

import { query } from "@anthropic-ai/claude-agent-sdk";

for await (const message of query({
  prompt: "用 mavis_spawn_worker 启动一个 coder agent,帮我审查 /path/to/project 的代码安全",
  options: {
    mcpServers: {
      mavis: {
        command: "node",
        args: ["/Users/cunning/.mavis/agents/mavis-mcp-server/src/index.js"]
      }
    }
  }
})) {
  console.log(message);
}

Related MCP server: OpenClaw MCP Server

可用工具(22个)

Session 管理

Tool

说明

mavis_session_list

列出所有会话

mavis_session_info

获取会话详情

mavis_session_messages

获取会话消息历史

mavis_session_new

创建新会话(spawn agent)

mavis_session_abort

中止运行中的会话

mavis_session_rotate

轮换当前会话

mavis_session_diff

查看会话的文件变更

通信

Tool

说明

mavis_comm_send

向会话发送消息/命令

mavis_comm_peers

列出所有可达会话

Team 编排

Tool

说明

mavis_team_plan

多 Agent 并行任务规划执行

Agent 管理

Tool

说明

mavis_agent_list

列出所有可用 Agent

mavis_agent_info

获取 Agent 详情

mavis_spawn_worker

启动单次验证/审查 Agent

Memory

Tool

说明

mavis_memory_append

追加记忆条目

mavis_memory_search

搜索记忆

Cron 调度

Tool

说明

mavis_cron_create

创建定时任务

mavis_cron_list

列出定时任务

mavis_cron_delete

删除定时任务

其他

Tool

说明

mavis_skill_list / mavis_skill_info

技能管理

mavis_hook_list

Hook 管理

mavis_config_show

查看配置

mavis_mcp_list / mavis_mcp_call

MCP 服务器管理

mavis_status

守护进程状态

mavis_usage

Token 使用统计

使用示例

在 Claude Code 中使用

你:我需要审查这个代码库的安全性,让 Mavis agent 来做
Claude Code:调用 mavis_team_plan,描述任务,Mavis 自动编排 coder + verifier agent 协作完成

用 mavis_session_new 启动任务

{
  "name": "mavis_session_new",
  "arguments": {
    "agent": "coder",
    "prompt": "审查 /path/to/project/src 的 SQL 注入风险",
    "title": "安全审查任务",
    "workspace": "/path/to/project"
  }
}

本地开发

cd /Users/cunning/.mavis/agents/mavis-mcp-server

# 安装
npm install

# 测试 MCP server
node scripts/test-client.js

# 启动 server(stdio 模式)
node src/index.js

架构说明

Claude Code / Agent SDK (MCP Client)
         │
         ▼ stdio JSON-RPC
  ┌─────────────────────────┐
  │   mavis-mcp-server     │
  │   (Node.js stdio transport)
  │                         │
  │   22 MCP tools         │
  │        │                │
  │        ▼ spawn / IPC    │
  └────────┬────────────────┘
           │
           ▼ exec mavis CLI
      Mavis Daemon
      (port 15321)
           │
           ▼
      Mavis Agents
      (mavis, coder, verifier, general)

文件结构

mavis-mcp-server/
├── package.json
├── src/
│   └── index.js       # MCP Server 实现(22个工具)
└── scripts/
    └── test-client.js # 测试客户端

Available Tools

26 tools
mavis_agent_infoB

Get detailed info about a specific agent (skills, system prompt, etc.)

Inputs: agentName (required).

mavis_agent_listA

List all available Mavis agents (built-in and custom).

Inputs: no named parameters.

mavis_comm_peersB

List all reachable (active) sessions in the Mavis network.

Inputs: agent, sessionId.

mavis_comm_sendC

Send a message or command to a running session (prompt/abort/kill/summarize/fork/spawn).

Inputs: to (required), command (required), content, from.

mavis_config_showA

Show current Mavis daemon configuration (models, provider, nexus settings).

Inputs: no named parameters.

mavis_cron_createB

Create a scheduled cron job (self-reminder, recurring task, etc.)

Inputs: agentName (required), cronName (required), schedule (required), prompt (required), +4 more.

mavis_cron_deleteB

Delete a cron job.

Inputs: agentName (required), cronName (required).

mavis_cron_listB

List all scheduled cron jobs for an agent.

Inputs: agentName.

mavis_hook_listA

List all registered Mavis hooks (pre/post execution triggers).

Inputs: no named parameters.

mavis_mcp_callB

Call a specific tool on an MCP server. Useful for delegating to Playwright, Matrix, or other MCP tools from within Mavis.

Inputs: server (required), tool (required), args.

mavis_mcp_listA

List all registered MCP servers and their available tools.

Inputs: no named parameters.

mavis_memory_appendB

Append a new entry to Mavis memory (user, agent, or project level).

Inputs: scope (required), content (required), agentName, topic.

mavis_session_abortB

Abort a running session.

Inputs: sessionId (required).

mavis_session_diffA

Show file changes (git diff) made by a session.

Inputs: sessionId (required).

mavis_session_infoB

Get detailed info about a specific session (status, workspace, model, etc.)

Inputs: sessionId (required).

mavis_session_listB

List Mavis sessions. Returns session IDs, titles, and last-updated timestamps.

Inputs: agentId, limit, includeArchived.

mavis_session_messagesB

Get the message history (conversation transcript) of a session.

Inputs: sessionId (required), limit.

mavis_session_newA

Create a new standalone Mavis session (use --from root for isolated, independent session). For child sessions linked to a parent, use mavis_spawn_worker instead.

Inputs: agent (required), prompt, title, workspace, +1 more.

mavis_session_rotateA

Rotate the current session — archives the old session and creates a fresh one with a handoff prompt.

Inputs: no named parameters.

mavis_skill_infoB

Get detailed info about a specific skill (description, triggers, commands).

Inputs: skillName (required), agentName.

mavis_skill_listA

List all installed Mavis skills (global and agent-specific).

Inputs: no named parameters.

mavis_spawn_workerA

Spawn a single-shot worker/verifier agent as a child session. Use for code review, test, verify tasks. The agent runs independently and reports back. For complex multi-agent tasks, use mavis_team_plan instead.

Inputs: agent (required), prompt (required), workspace, parentSession.

mavis_statusA

Check Mavis daemon status (running, port, version).

Inputs: no named parameters.

mavis_team_planA

List team plans or get status of a specific plan. Use team plan status <id> to view details. Create plans via YAML files with team plan run <yaml> (not exposed here — use mavis_session_new for one-off tasks).

Inputs: planId.

mavis_usageC

Inspect token usage by session, agent, or globally.

Inputs: sessionId, agentName, from, to, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 26 tools

    Disambiguation5/5

    Each tool targets a distinct resource and action, with clear domain prefixes like session, agent, memory. Even the session tools (new, list, info, messages, abort, rotate, diff) have well-defined purposes, and potential overlaps like session_new vs spawn_worker are clarified in descriptions.

    Naming Consistency5/5

    All tools follow a consistent 'mavis_<domain>_<verb>_<noun>' pattern, using snake_case throughout. Verbs like list, info, create, delete, search, append are uniformly applied across domains.

    Tool Count4/5

    26 tools is somewhat high but justified by the comprehensive scope covering agents, sessions, memory, skills, communication, MCP, cron, hooks, and team plans. Each tool serves a distinct purpose, and no obvious redundancy exists.

    Completeness4/5

    The tool surface covers most lifecycle operations for agents, sessions, memory, and skills. Notable gaps include lack of agent creation/deletion and team plan creation (only status/list), but core workflows are well-supported.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers