to move · Enter to open · Esc to close Something not working? Troubleshooting
    On this page

    MCP Server

    Suvadu includes a built-in Model Context Protocol (MCP) server that exposes 21 tools, 8 resources, and 5 prompts, letting connected AI clients query your local shell-history database, replay captured sessions, summarize agent sessions, analyze failures, and request project context.

    What Is MCP?

    The Model Context Protocol (MCP) is an open standard for AI agents to access external tools and data sources. Instead of the agent guessing or asking you for information, it can directly query structured data through MCP tools. Suvadu's MCP server gives AI agents direct access to your shell history, so they can understand what happened in your terminal without you having to explain it.

    Starting the MCP Server

    suv mcp-serve

    This starts the MCP server using JSON-RPC over stdin/stdout. The server does not open a network port; it returns requested data to the connected client through standard I/O. That client may send returned history to its AI provider under its own settings.

    Auto-Configuration

    The MCP server is automatically configured when you run any of these commands:

    • suv init claude-code — adds Suvadu as an MCP server in Claude Code's configuration
    • suv init cursor — adds Suvadu as an MCP server in Cursor's configuration
    • suv init codex — adds Suvadu as an MCP server in Codex's configuration
    • suv init opencode — adds Suvadu as a local MCP server under opencode.jsonc's mcp key

    Restart the client after setup so it loads the server and available capabilities. Client trust and tool-permission settings still apply.

    Available Tools

    The MCP server exposes 21 tools by default. These query history, sessions, and active skills, or assess command text. Enabling propose_skill and/or save_session_summary adds one more tool each, up to 23; disabled tools are omitted from the list.

    # Tool Description
    1 search_commands Search history by text, directory, executor, and date range. Returns matching commands with metadata.
    2 recent_commands Get the most recent commands in a directory. Useful for understanding what just happened.
    3 command_status Check if a specific command has been run before and what happened — exit code, when, where, and how often.
    4 get_prompts Browse prompt context captured by supported integrations and the commands associated with it.
    5 session_history Get the full command history of a specific session, in chronological order.
    6 get_stats Retrieve aggregate statistics: command counts, success rates, top commands, activity patterns.
    7 list_sessions Browse recent sessions with their metadata: start time, command count, directory, executor.
    8 what_changed Find file-modifying operations that ran recently — writes, deletes, moves, installs, and config changes.
    9 what_failed Find commands that failed (non-zero exit code) and, when available, which prompt caused them.
    10 suggest_next Predict the next commands you're likely to run, based on frecency (frequency + recency) analysis.
    11 assess_risk Pre-execution safety check. Pass a command and get its risk level before running it.
    12 find_agent_session Search past AI agent sessions by prompt text, directory, executor, or date range. Returns session summaries with command counts, success rates, and resume commands.
    13 replay_agent_session Get the full chronological timeline of a specific agent session with prompts interleaved between commands.
    14 learn_from_failures Analyze recurring command failures. Shows commands with high failure rates and agent vs human comparison.
    15 project_context Get a project briefing: common commands, build/test/lint patterns, failure rates, and agent activity.

    Skills Tools

    ToolArgumentsBehavior
    list_skillsOptional scope or directoryList active skills; an explicit scope filters exactly.
    get_skillRequired name; optional scope or directoryRead the full body. Prefer the supplied scope, then global, then the most recently updated active match in any scope.
    search_skillsRequired query; optional scopeSearch active skills by name, description, and triggers.
    propose_skill (optional)Required name and body; optional description, triggers, scope, source_agentCreate a pending proposal. A human must approve it before discovery or sync.

    These tools do not infer the client's working directory. Use global or an absolute project path for scope, and check the returned scope when calling get_skill. See Shared Skills for the interactive manager and native sync.

    Session Tools

    ToolArgumentsBehavior
    list_agent_sessionsOptional limit, offsetList locally captured AI sessions from any agent, with capture coverage and recorded token usage (unknown usage is not zero). Follow next_offset for more results.
    get_agent_sessionRequired session_id; optional limit, event_offset, command_offset (or a shared legacy offset)Read a captured session's independently paginated events and correlated commands, plus coverage, usage, current revision, and any saved summary checkpoints.
    resolve_current_agent_sessionOptional session_id, native_id, agent, cwdResolve "this/current session" conservatively — an explicit ID first, then the agent's native session ID, then an unambiguous recent session in the directory. Returns candidates instead of guessing when ambiguous; the in-progress turn may not be captured yet.
    save_session_summary (optional)Required session_id, source_revision, text, agent, model, source_ids; optional base_summary_idStore a summary the requesting agent generated, only when you explicitly asked it to save. Requires the current source revision and cited event/command IDs as evidence; pass base_summary_id to safely extend a prior checkpoint, or omit it for a full rebuild.

    Any connected agent can summarize any session it can read — Suvadu never generates the summary text or calls a model itself. save_session_summary is off by default. To let an agent persist a summary after you ask it to, set allow_session_summaries = true in the [mcp] section of config.toml and restart the client; this option is not in suv settings in 0.4.1 (see Configuration). Browse saved summaries interactively in suv sessions (press s on an AI session).

    Resources

    In addition to tools, the MCP server provides 8 resources that a compatible client can list and read. Whether a resource is read automatically or added to model context depends on the client:

    Resource URI Description
    suvadu://history/recent Your last 20 commands with exit codes, timestamps, and directories
    suvadu://failures/recent Recent failed commands, including associated prompt context when available
    suvadu://stats/today Today's shell statistics: command count, success rate, active directories
    suvadu://risk/summary Risk assessment summary of recent agent commands
    suvadu://agents/activity Per-agent breakdown of recent activity: which agents ran what, and how it went
    suvadu://agents/sessions Summary of the 5 most recent AI agent sessions with prompts and command counts
    suvadu://context/project Project briefing: common commands, failure rates, and agent activity for the current directory

    The eighth resource, suvadu://skills/index, lists active skills and their descriptions, scopes, and triggers. Like the other resources, it is available for clients to read; automatic context loading depends on the client.

    Reusable MCP Prompts

    Version 0.4.0 added three parameterized prompts; 0.4.1 adds two more for session summaries. Clients with MCP prompt support can surface these as user-selected actions, often slash commands:

    PromptArgumentsRequest
    project_briefingNoneUse project context and failure analysis to get oriented.
    check_recent_failuresOptional days (default 7)Summarize recurring failures and compare agent versus human activity.
    assess_command_riskRequired commandAsk for a risk assessment before running the command.
    summarize_agent_sessionRequired session_idSummarize a specific captured agent session, with source citations.
    summarize_current_sessionNoneResolve, summarize, and optionally save the current agent session, safely extending its latest checkpoint when possible.

    Prompts expand into requests naming the relevant tools; the connected model still needs to call those tools. The initialize response also guides clients to use project context, failure learning, risk checks, and skills discovery proactively. Client behavior determines whether that guidance is followed.

    Configuration

    Configure the MCP server by editing the [mcp] section of the global config.toml. Some of these options are also available in suv settings (MCP tab):

    PlatformConfig file
    macOS~/Library/Application Support/tech.appachi.suvadu/config.toml
    Linux~/.config/suvadu/config.toml (or $XDG_CONFIG_HOME/suvadu/config.toml)
    [mcp]
    disabled_tools = ["assess_risk"]    # Hide tools from agents
    disabled_resources = []              # Hide resources from agents
    default_days = 14                    # Default time window (1-365)
    default_limit = 20                   # Default result limit (1-500)
    exclude_dirs = ["/secrets", "~/.ssh"] # Hide these directories (and subtrees) from every MCP tool and resource
    allow_skill_proposals = false        # Opt in to pending skill proposals
    allow_session_summaries = false      # Opt in to agents saving session-summary checkpoints

    Disabled tools and resources won't appear in the agent's tool/resource list and cannot be called. In 0.4.1 the suv settings MCP tab has toggles for 15 of the 21 default tools and 7 of the 8 resources; the session tools, the skills tools, and suvadu://skills/index can be disabled only by adding them to disabled_tools or disabled_resources in the file.

    Enabling the optional write tools: allow_session_summaries and allow_skill_proposals are off by default and are not shown in suv settings in 0.4.1 — set them in the file. Add them under your existing [mcp] header if the file already has one. allow_session_summaries = true adds save_session_summary; allow_skill_proposals = true adds propose_skill, whose proposals a human reviews in suv skills with Ctrl+P. The MCP server reads global config once at startup, so restart your AI client (or its MCP server) after editing; the tool appears the next time the client lists tools. A matching disabled_tools entry still hides it. Then explicitly ask the agent to save — enabling the tool is not itself a request to write.

    Project .suvadu.toml overlays do not configure MCP in 0.4.1.

    exclude_dirs entries match the directory itself and everything beneath it; ~ expands to your home directory. Every MCP tool and resource that returns commands or sessions enforces it, so an excluded directory's commands never reach a connected agent regardless of which tool or resource is queried.

    Example Agent Queries

    With the MCP server running, an AI agent can answer questions like these by calling the appropriate tools:

    • "What commands failed in this project recently?" — the agent calls what_failed with the project directory
    • "What's the risk of running git push --force?" — the agent calls assess_risk and gets back "Critical"
    • "Show me what changed in the last hour" — the agent calls what_changed scoped to the last hour
    • "What did previous Claude sessions do here?" — the agent calls find_agent_session with the project directory
    • "Replay the last agent session" — the agent calls replay_agent_session for a full timeline with prompts
    • "What keeps failing?" — the agent calls learn_from_failures to see recurring failures with agent vs human comparison
    • "What's the context for this project?" — the agent calls project_context for build commands, failure rates, and workflow patterns
    • "Summarize and save current session" — the agent calls resolve_current_agent_session, reads it with get_agent_session, and (if allow_session_summaries is enabled) calls save_session_summary

    Privacy and Security

    The MCP server is designed with privacy as a first principle:

    • Local process — the server runs as a local subprocess, communicating over stdin/stdout only
    • No network ports — it does not listen on any TCP/UDP ports
    • Explicit client boundary — the server returns only data requested through enabled tools or resources, but the connected client receives that data and may send it to its provider
    • Same data as the CLI — the MCP server reads from the same local SQLite database that powers suv search and all other Suvadu commands
    • Configurable access — disable individual tools and resources in config.toml (most are also toggleable in suv settings)
    • Writes off by default — the default tools only read; save_session_summary and propose_skill exist only after you opt in
    Getting started: Run suv init claude-code, suv init cursor, or suv init codex to auto-configure the MCP server for that client. See Agent Setup for the full setup guide.