Boost productivity with LivebookTools CLI for `.livemd` files, Livebook integration, MCP server, and command-line execution
LivebookTools MCP Server is an advanced command-line tool designed to enhance the interaction between AI coding agents and their development environments, particularly within the Livebook ecosystem. By acting as a bridge via the Model Context Protocol (MCP), it facilitates seamless integration of AI applications such as Cursor into Livebook sessions. This MCP server allows developers to leverage AI-powered code assistants while maintaining full control over their project workflows.
The LivebookTools MCP Server introduces several key features that significantly enhance the capabilities of AI coding agents:
.livemd
files to an open Livebook session for editing with sophisticated AI support..livemd
documents into executable Elixir scripts, allowing them to run code snippets directly from the command line.By integrating these features through the MCP protocol, LivebookTools facilitates a dynamic workflow where AI coding agents can efficiently assist developers without disrupting their existing development practices.
The architecture of the LivebookTools MCP Server is designed to ensure robust and seamless integration with various AI applications:
The MCP protocol implementation involves several steps:
LIVEBOOK_NODE
and LIVEBOOK_COOKIE
environment variables.To use the LivebookTools MCP Server, follow these steps:
mix escript.install github thmsmlr/livebook_tools
~/.bashrc
or ~/.zshrc
.
export LIVEBOOK_NODE="[email protected]"
export LIVEBOOK_COOKIE="secret"
export PATH="$HOME/.mix/escripts:$PATH"
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
Once set, you can run livebooks directly from the command line or within the Livebook session.
AI developers often require quick, iterative data exploration tools to test hypotheses. The MCP Server can be used with Cursor during this phase by configuring the server to connect to specific databases or APIs. This setup enables real-time analysis and visualization of data directly within Livebook.
is_livebook = !String.ends_with?(__ENV__.file, ".exs")
argv = if is_livebook, do: [], else: System.argv()
{parsed_opts, positional_args, invalid_opts} =
OptionParser.parse(
argv,
strict: [dry_run: :boolean, limit: :integer],
aliases: [d: :dry_run, l: :limit]
)
In CI/CD pipelines, AI applications may need to execute tests or run code snippets automatically. The LivebookTools MCP Server can be configured to trigger livebooks through the command line, ensuring that runs can occur seamlessly without human intervention.
The LivebookTools MCP Server is compatible with multiple MCP clients, including:
For the most up-to-date MCP client compatibility matrix:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ✅ | Full Support |
Cursor | ❌ | ✅ | ❌ | Tools Only |
The server's performance is optimized for both large-scale projects and smaller, more focused development tasks. The configuration uses a combination of Elixir's distributed capabilities and STDIO to ensure efficient data processing.
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
graph TD
A[Client] --> B[MCP Server]
B --> C[Data Source]
C --> D[Tool/Environment]
E[LIVEBOOK_NODE] --> F[MCP Protocol Header]
F --> G[LIVEBOOK_COOKIE]
style A fill:#e1f5fe
style C fill:#e8f5e8
style E fill:#e1f5fe
For advanced users, the MCP Server can be configured via environment variables and JSON configuration files. To secure sensitive data, it is recommended to use API keys instead of hardcoding credentials in your scripts.
{
"mcpServers": {
"[server-name]": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-[name]"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
Q: How do I troubleshoot connection issues?
A: Ensure that LIVEBOOK_NODE
and LIVEBOOK_COOKIE
are correctly set in your environment variables or configuration file.
Q: Can I use different MCP clients together?
A: Yes, the server is designed to support multiple MCP clients simultaneously, ensuring a flexible integration model.
Q: How does the LivebookTools MCP Server handle data privacy?
A: The server uses secure protocols and API keys to ensure that no sensitive information is exposed during communication.
Q: Is there a limit to the number of livebooks or scripts I can run concurrently?
A: There are currently no explicit limits, but performance may be affected by running too many instances simultaneously.
Q: How do I update the LivebookTools MCP Server with new features or bug fixes?
A: Check for updates in the GitHub repository and install the latest version using mix escript.install
.
Contributions to the LivebookTools project are welcome. To contribute, follow these guidelines:
For more information on Model Context Protocol (MCP) and its applications, visit:
By leveraging the LivebookTools MCP Server, developers can significantly enhance their AI workflows, benefitting from real-time coding assistance while maintaining full control over their project environments.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration