Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

batuta mcp

Run Batuta as an MCP (Model Context Protocol) server for AI tool integration.

Synopsis

batuta mcp [TRANSPORT]

Description

The MCP server exposes Batuta’s HuggingFace integration as tools that AI assistants (Claude, etc.) can invoke via JSON-RPC 2.0 over stdio. This enables AI-assisted model discovery and management.

Transport Modes

TransportDescription
stdio (default)JSON-RPC 2.0 over stdin/stdout

Available Tools

ToolDescription
hf_searchSearch HuggingFace Hub for models, datasets, or spaces
hf_infoGet metadata about a specific repository
hf_pullDownload a model or dataset from HuggingFace
hf_pushUpload artifacts to HuggingFace Hub

Examples

Start MCP Server

$ batuta mcp

# Server listens on stdin for JSON-RPC 2.0 messages

JSON-RPC Initialize

{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"capabilities":{}}}

List Available Tools

{"jsonrpc":"2.0","id":2,"method":"tools/list"}

Claude Desktop Integration

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "batuta": {
      "command": "batuta",
      "args": ["mcp"]
    }
  }
}

See Also


Previous: batuta bug-hunter Next: batuta serve