Cover image
Try Now
2025-03-11

PowerTools para LiveBook.dev - Edición de código AI, servidores MCP y ejecución de LiveBooks desde el CLI

3 years

Works with Finder

3

Github Watches

4

Github Forks

62

Github Stars

LivebookTools

Livebook Tools is a CLI tool to give you superpowers while working with .livemd files.
Its primary features are:

  • BYOE (Bring Your Own Editor) - Sync your .livemd files to an open Livebook session so you can edit them in your AI powered code editor, like Cursor.
  • MCP Server - A simple model context protocol server for connecting AI coding agents to your Livebook sessions. More on this below.
  • Run Livebooks from the CLI - Convert your .livemd files to Elixir scripts and run them top to bottom as if they were a .exs script. Useful if you want to turn a livebook into a cron job.

Installation

Livebook Tools is an Elixir escript.
To install it, you can use the mix escript.install command.

mix escript.install github thmsmlr/livebook_tools

Once installed, ensure that the escript directory is on your path.

# for normal elixir users
export PATH="$HOME/.mix/escripts:$PATH"

# for asdf elixir users
for escripts_dir in $(find "${ASDF_DATA_DIR:-$HOME/.asdf}/installs/elixir" -type d -name "escripts" 2>/dev/null); do
  export PATH="$escripts_dir:$PATH"
done

Running Livebook

In order for Livebook tools to work properly, it needs to be able to connect to a running Livebook server using distributed Elixir.
To do this will depend on how you are running Livebook.
In its simplest form, all you need to do is add the two environment variables to your ~/.bashrc or ~/.zshrc file.

export LIVEBOOK_NODE="livebook@127.0.0.1"
export LIVEBOOK_COOKIE="secret"

Then when you run the Livebook tools or Livebook, both programs will discover these values and make sure that they can connect to each other. If you're running using Livebook Desktop, then you may need to add these values to the ~/.livebookdesktop.sh file as well. For more information on Livebook Desktop, check out the Livebook HexDocs.

Setting up MCP Server

The MCP Server is a simple model context protocol server that allows you to connect AI coding agents to your Livebook sessions.
I have personally tested the implementation with Cursor, though it should work with any AI code editor that supports the MCP protocol. The MCP server runs via STDIO, so all you have to do is tell Cursor to connect via the command and it'll auto discover the tools and connect them to it's coding agent. For more information on MCP works with Cursor, check out the Cursor MCP docs.

Cursor Create MCP Server Cursor MCP Server Connected

Useful Tips

Sometimes you want to customize how the code runs, whether it's running in Livebook or via the command line using livebook_tools run <file>. There are some easy code snippets that you can use to detect whether you're running in a live book or on the command line,

# Detect if we're running in a livebook
is_livebook = !String.ends_with?(__ENV__.file, ".exs")

# If we're running in a livebook, argv doesn't really make sense, so we'll just return an empty list
argv = if is_livebook, do: [], else: System.argv()

# Parse command line arguments
# We'll use OptionParser to handle both flags and positional arguments
{parsed_opts, positional_args, invalid_opts} =
  OptionParser.parse(
    argv,
    strict: [
      dry_run: :boolean,
      limit: :integer
    ],
    aliases: [
      d: :dry_run,
      l: :limit
    ]
  )

# Extract options with default values, in livebook it'll just use the default values
dry_run = Keyword.get(parsed_opts, :dry_run, false)
limit = Keyword.get(parsed_opts, :limit, 10)

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • https://tovuti.be
  • Oede knorrepot die vasthoudt an de goeie ouwe tied van 't boerenleven

  • ANGEL LEON
  • A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Gil kaminski
  • Make sure you are post-ready before you post on social media

  • INFOLAB OPERATIONS 2
  • A medical specialist offering assistance grounded in clinical guidelines. Disclaimer: This is intended for research and is NOT safe for clinical use!

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • OffchainLabs
  • Implementación de la prueba de estaca Ethereum

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

  • zhaoyunxing92
  • 本项目是一个钉钉 MCP (Protocolo del conector de mensajes )服务 , 提供了与钉钉企业应用交互的 API 接口。项目基于 Go 语言开发 支持员工信息查询和消息发送等功能。 支持员工信息查询和消息发送等功能。

  • pontusab
  • La comunidad de cursor y windsurf, encontrar reglas y MCP

    Reviews

    2 (1)
    Avatar
    user_5nI63jU0
    2025-04-15

    As an avid user of MCP Server for Autonomous Development Agents, I am incredibly impressed by its efficiency and scalability. This tool by Bufigol has significantly streamlined our development processes, enabling our agents to operate independently and seamlessly. Highly recommend for anyone looking to enhance their AI capabilities!