*magenta-tools.txt*      Tools and MCP support for magenta.nvim

==============================================================================
CONTENTS                                             *magenta-tools-contents*

    1. Available Tools ......................... |magenta-available-tools|
    2. MCP Support ............................. |magenta-mcp|

==============================================================================
AVAILABLE TOOLS                                      *magenta-available-tools*

Tools available to the LLM agent:

File Operations:~

  - `get_file` - Get file contents (text, images, PDFs)
  - `edl` - Edit Description Language for programmatic file edits (create, select, replace, insert, delete)
  - `list_directory` - List files in a directory (respects .gitignore)
  - `docs` - Search neovim help tags across runtime help files

Editor Integration:~
  - `list_buffers` - List current open buffers
  - `diagnostics` - Get LSP diagnostics
  - `find_references` - Find LSP references for a symbol
  - `hover` - Get LSP hover info for a symbol

Execution:~
  - `bash_command` - Run shell commands (with permission system)

Agent Coordination:~
  - `spawn_subagents` - Delegate tasks to subagents
  - `yield_to_parent` - Return results to parent agent

See https://github.com/dlants/magenta.nvim/tree/main/node/core/src/tools for
the most up-to-date list.

For detailed documentation on specific tools and features:
  See |magenta-edl| for the Edit Description Language
  See |magenta-subagents| for sub-agent types and workflows
  See |magenta-docker| for dev container setup
  See |magenta-permissions| for sandbox configuration
  See |magenta-security| for the overall security model


==============================================================================
MCP SUPPORT                                                    *magenta-mcp*

Magenta supports MCP (Model Context Protocol) servers through two
transport methods:

Standard I/O (stdio):~
>lua
    mcpServers = {
      fetch = {
        command = "uvx",
        args = { "mcp-server-fetch" },
        env = {
          CUSTOM_VAR = "value"
        }
      }
    }
<

Streamable HTTP:~
>lua
    mcpServers = {
      httpServer = {
        url = "http://localhost:8000/mcp",
        requestInit = {
          headers = {
            Authorization = "Bearer your-token-here",
          },
        },
      }
    }
<

Magenta automatically handles protocol fallback for HTTP servers,
attempting streamable HTTP first, then falling back to SSE transport.

MCPHub Support:~

Configure Magenta to connect to MCPHub.nvim:
>lua
    mcpServers = {
      mcphub = {
        url = "http://localhost:37373/mcp"
      }
    }
<

Project-specific MCP servers:~

Add MCP servers in `.magenta/options.json`:
>json
    {
      "mcpServers": {
        "postgres": {
          "command": "mcp-server-postgres",
          "args": ["--connection-string", "postgresql://localhost/mydb"]
        },
        "filesystem": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
        }
      }
    }
<

vim:tw=78:ts=8:noet:ft=help:norl:
