agent-client-kernel

agent
Security Audit
Pass
Health Pass
  • License — License: BSD-3-Clause
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 21 GitHub stars
Code Pass
  • Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Pass
  • Permissions — No dangerous permissions requested
Purpose
This tool is a Jupyter kernel that acts as a client for the Agent Client Protocol (ACP). It allows users to interact with external AI coding agents, such as OpenAI's Codex or Google Gemini, directly from within Jupyter notebooks.

Security Assessment
Overall Risk: Medium. The project successfully passed a light code scan with no dangerous patterns, hardcoded secrets, or dangerous permission requests. However, the core function of this tool is to spawn external agents and communicate with them via stdio (standard input/output). Additionally, it provides built-in magics that allow users to execute shell commands and perform file operations directly from the notebook. While the codebase itself is benign, executing external AI agents and shell commands inherently exposes your system to risks depending on the prompts used and the actions of the connected agents.

Quality Assessment
Overall Quality: Good. The repository is actively maintained (last pushed 0 days ago) and is cleanly licensed under the permissive BSD-3-Clause. It has a solid foundation of 21 GitHub stars, which indicates a small but growing community and moderate trust. The documentation is thorough, offering clear installation instructions and multiple pre-configured devcontainers for a seamless setup.

Verdict
Use with caution: The code is safe and well-documented, but only use it in trusted environments since it is designed to execute shell commands and interface with external AI agents.
SUMMARY

A Zed Agent Client Protocol (ACP) Jupyter Kernel

README.md

agent-client-kernel

A Jupyter Kernel for Zed's Agent Client Protocol (ACP) https://agentclientprotocol.com/ .

This kernel allows you to interact with external ACP agents directly from Jupyter notebooks. It acts as an ACP client that connects to coding agents like Codex, providing a seamless notebook interface for AI-powered coding assistance.

Try This Now

This deep link will create a new (free!) GitHub Codespace (it will ask you first) for running the Codex devcontainer:

Open in GitHub Codespaces

QR to this GitHub Repo (https://github.com/wiki3-ai/agent-client-kernel)

image.

About

This project implements a Jupyter kernel that serves as a client for coding agents via the Agent Client Protocol. The implementation uses MetaKernel as the base class, which provides built-in magics, shell commands, and other useful features.

The kernel spawns and communicates with external ACP agents (such as codex-acp) via stdio, allowing you to interact with AI coding assistants directly from your notebook.

Features

  • ACP Client Implementation: Full client-side ACP protocol support
  • External Agent Integration: Connects to any ACP-compatible agent
  • Multiple Agent Support: Pre-configured devcontainers for Codex, Gemini, Goose, Kimi, and Docker cagent
  • Based on MetaKernel: Built-in magics (help, shell, file operations, etc.)
  • Configurable: Easily switch between different agents via environment variables
  • Compatible with JupyterLab and Jupyter Notebook

Installation

Using Devcontainers

This project provides multiple devcontainer configurations for different ACP agents. Each devcontainer comes with JupyterLab and the agent-client-kernel pre-installed with the respective agent.

Available devcontainers:

  • .devcontainer/codex/ - OpenAI Codex with ACP adapter
  • .devcontainer/gemini/ - Google Gemini CLI (Apache 2.0)
  • .devcontainer/goose/ - Block's Goose agent (Apache 2.0)
  • .devcontainer/kimi/ - MoonshotAI's Kimi CLI (Apache 2.0)
  • .devcontainer/cagent/ - Docker's cagent (Apache 2.0)

To use a devcontainer:

  1. Open the repository in GitHub Codespaces or VS Code with Dev Containers extension
  2. When prompted, select the desired devcontainer (e.g., "Codex", "Gemini", etc.)
  3. Wait for the container to build and start
  4. JupyterLab will be available on port 8888

For Codex: After JupyterLab starts, open a Terminal and run codex. Follow prompts for API key and authorization then /quit.

Manual Installation

Alternatively, install the package, agent, and kernel:

pip install --upgrade uv jupyter-mcp-tools
git submodule update --init --recursive
pip install -e .
python -m agent_client_kernel install --user

Configuration

The kernel spawns a subprocess to run the agent which needs installation and ACP adapter.

Using Codex (Default)

  1. Install codex-acp:

    npm install -g @openai/codex@latest @zed-industries/codex-acp@latest
    
  2. Set your OpenAI API key: This can be onitted and codex will prompt for this.

    export OPENAI_API_KEY=sk-...
    
  3. Authorize Codex

    codex
    

    It will prompt you through authentication and permission to run stuff.

    I think only API auth works in Codespaces because OAuth tries to redirect thru localhost.

    This is the error you get when trying to chat with the agent then you probably missed this step.

    Error: Authentication required
    
    Make sure the ACP agent is configured correctly.
    Current agent: codex-acp
    
  4. Start Jupyter and use the "Agent Client Protocol" kernel

    start-noteboook.py
    

Using Other Agents

Set environment variables to configure a different agent:

export ACP_AGENT_COMMAND=path/to/your/agent
export ACP_AGENT_ARGS="--arg1 --arg2"

Then start Jupyter normally. The kernel will use your configured agent.

Usage

After installation, create a new notebook and select "Agent Client Protocol" as the kernel.

Type your prompts in cells and execute them to interact with the agent:

Create a Python function to calculate fibonacci numbers

The agent will respond with code, explanations, and can help with:

  • Writing code
  • Debugging
  • Code review
  • Refactoring
  • Documentation
  • And more!

Add a Jupyter MCP Service

Adding a Jupyter MCP service for accessing and editing notebooks and cells.
The Dockerfile installed the datalayer/jupyter-mcp-server https://github.com/datalayer/jupyter-mcp-server .
To add it to the agent's MCP configuration:

%agent mcp add jupyter uvx jupyter-mcp-server@latest

See examples/jupyter-mcp.ipynb.

Magic Commands

The kernel provides a unified %agent magic command for all configuration and session management:

MCP Server Configuration:

  • %agent mcp add NAME COMMAND [ARGS...] - Add an MCP server
  • %agent mcp list - List configured MCP servers
  • %agent mcp remove NAME - Remove an MCP server
  • %agent mcp clear - Remove all MCP servers

Permission Configuration:

  • %agent permissions [auto|manual|deny] - Set permission mode
  • %agent permissions list - View permission request history

Session Management:

  • %agent session new [CWD] - Create a new session
  • %agent session info - Show current session information
  • %agent session restart - Restart the current session

Agent Configuration:

  • %agent config [COMMAND [ARGS...]] - Configure the agent command
  • %agent env [KEY=VALUE] - Set agent environment variables

Use %agent without arguments to see all available subcommands.
Use %agent? for detailed help on the magic command.

See the example notebooks in examples/ for demonstrations:

  • basic_usage.ipynb - Basic agent interaction
  • configuration_demo.ipynb - Configuration and session management

Requirements

  • Python >= 3.10
  • ipykernel >= 4.0
  • jupyter-client >= 4.0
  • agent-client-protocol >= 0.4.0
  • metakernel >= 0.30.0
  • An ACP-compatible agent (e.g., codex-acp)

Uninstallation

jupyter kernelspec remove agentclient
pip uninstall agent_client_kernel

License

BSD 3-Clause License

Reviews (0)

No results found