Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| version: "latest" | ||
| env: | ||
| JUPYTER_URL: "http://host.docker.internal:8888" | ||
| JUPYTER_TOKEN: "${{ secrets.JUPYTER_TOKEN }}" |
There was a problem hiding this comment.
@copilot update expression to use the GitHub.runId as token fallback if secret is missing
There was a problem hiding this comment.
Updated JUPYTER_TOKEN to use github.run_id as fallback: ${{ secrets.JUPYTER_TOKEN || github.run_id }} (commit f9a5c8f)
| imports: | ||
| - shared/mcp/tavily.md | ||
| - shared/mcp/jupyter.md | ||
| post-steps: |
There was a problem hiding this comment.
@copilot use upload-assets shared output instead
There was a problem hiding this comment.
Replaced post-steps artifact upload with upload-assets safe output. The workflow now uses the upload-assets system which pushes assets to an orphaned branch. (commit f9a5c8f)
… safe output Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
The first steps should generate a token (crypto safe) and store in output The next step should start jupyterlab using the base docker image from https://github.com/jupyter/docker-stacks using the generated token The next step starts the Jupyter mcp server using the generated token The next step connects to the jupyter mcp server and creates a notebook. |
|
@copilot apply previous comment |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented the multi-step workflow structure:
The workflow now has services, custom steps, and proper MCP server configuration all integrated. (commit 4c7d3f0) |
| JUPYTER_TOKEN: ${{ github.run_id }} | ||
|
|
||
| steps: | ||
| - name: Generate and verify Jupyter Token |
There was a problem hiding this comment.
Removed "Generate and verify Jupyter Token" step. Now using github.run_id directly in services and MCP server config. (commit 8e9f2a1)
| assignees: copilot | ||
| imports: | ||
| - shared/mcp/tavily.md | ||
| create-discussion: |
There was a problem hiding this comment.
Added staged: true to safe-outputs configuration. This enables preview mode for discussion creation and asset uploads. (commit 8e9f2a1)
| echo "token=$TOKEN" >> $GITHUB_OUTPUT | ||
| echo "Generated Jupyter token from run ID" | ||
|
|
||
| - name: Wait for Jupyter to be ready |
There was a problem hiding this comment.
Moved "Wait for Jupyter to be ready" step to shared/mcp/jupyter.md. This step is now automatically included when importing the Jupyter configuration. (commit 8e9f2a1)
| edit: | ||
| github: | ||
|
|
||
| mcp-servers: |
There was a problem hiding this comment.
Replaced inline mcp-servers configuration with imports: - shared/mcp/jupyter.md. The Jupyter MCP server is now imported from the shared configuration. (commit 8e9f2a1)
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
|
||
| mcp-servers: | ||
| jupyter: | ||
| container: "datalayer/jupyter-mcp-server" |
There was a problem hiding this comment.
@copiler move docker setup in services section and configure mcp server as http with local url
There was a problem hiding this comment.
Reconfigured Jupyter MCP setup:
- Moved to services:
datalayer/jupyter-mcp-servernow runs as a service container (jupyter-mcp) alongside the Jupyter service - HTTP configuration: MCP server connection changed from container-based to HTTP type pointing to
http://jupyter-mcp:3000 - Added readiness check: New step to wait for Jupyter MCP server to be ready before agent execution
Both services (jupyter and jupyter-mcp) now run in the services section with proper communication between them. (commit a7f8b2d)
…ler updates Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| ALLOW_IMG_OUTPUT: "true" | ||
|
|
||
| steps: | ||
| - name: Wait for Jupyter to be ready |
There was a problem hiding this comment.
@copilot remove wait steps and instead add health instructions to services
There was a problem hiding this comment.
Removed wait steps and added native health checks to service definitions:
- Jupyter service: Health check using
curl -f http://localhost:8888/api - Jupyter MCP service: Health check using
curl -f http://localhost:3000/health - Health parameters: 10s interval, 5s timeout, 5 retries
GitHub Actions will automatically wait for services to be healthy before starting the job. (commit 3f9a2c8)
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| env: | ||
| JUPYTER_URL: "http://jupyter:8888" | ||
| JUPYTER_TOKEN: "${{ github.run_id }}" | ||
| DOCUMENT_ID: "notebook.ipynb" |
There was a problem hiding this comment.
Removed DOCUMENT_ID environment variable from jupyter-mcp service configuration. (commit 8a1b5f7)
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot configure the Jupyter-mcp-server to use the http transport |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Configured jupyter-mcp-server to use HTTP transport mode by adding environment variables:
The server now explicitly runs in HTTP transport mode. (commit 4d2e9a1) |
This PR adds support for manipulating Jupyter notebooks in agentic workflows, updates the
devworkflow to demonstrate file size distribution analysis using a self-hosted JupyterLab instance, and extends the compiler to supportservices:in shared workflow imports.Changes
1. Shared Jupyter MCP Server Configuration
Created
.github/workflows/shared/mcp/jupyter.mdthat provides reusable Jupyter integration with Docker-based MCP server. The shared configuration includes:jupyter/base-notebook:latest) with token authentication and native health checksdatalayer/jupyter-mcp-server:latest) running as a separate service container with native health checks and HTTP transport modecurl -f http://localhost:8888/apicurl -f http://localhost:3000/healthhttp://jupyter-mcp:3000JUPYTER_URL: Points tohttp://jupyter:8888for service container communicationJUPYTER_TOKEN: Uses${{ github.run_id }}as the authentication tokenALLOW_IMG_OUTPUT: Enabled to support image outputs from cellsMCP_TRANSPORT: Set to"http"to enable HTTP transport modeMCP_PORT: Set to"3000"to specify the HTTP server portThe shared configuration can be imported into any workflow to add complete Jupyter notebook capabilities including both service containers with automatic health checking.
2. Compiler and Schema Enhancement: Services Import Support
Extended the workflow compiler and schema to support
services:in shared workflow imports:servicesproperty toincluded_file_schema.jsonto allow service containers in shared filesextractServicesFromContent()function andMergedServicesfield to handle service extraction from importsThis enhancement enables modular, reusable service container definitions that can be shared across multiple workflows, improving code reuse and maintainability.
3. Updated Dev Workflow with Self-Hosted JupyterLab
Modified
.github/workflows/dev.mdto demonstrate a complete Jupyter notebook workflow with self-hosted JupyterLab:Previous behavior: Created a poem about GitHub Agentic Workflows and posted it as an issue
New behavior:
shared/mcp/jupyter.mdwhich provides both JupyterLab and Jupyter MCP service containers with health checks and HTTP MCP configurationupload-assetssafe outputThe workflow showcases:
MCP_TRANSPORTconfigurationUsage
Using the Shared Configuration with Self-Hosted JupyterLab
To use Jupyter notebooks in your workflow, simply import the shared configuration:
The shared import automatically provides:
No additional service configuration or readiness steps needed - everything is included in the import with native health checking!
Staged Mode for Testing
Enable staged mode to preview safe-outputs without creating actual GitHub resources:
Technical Details
Architecture
The Jupyter integration uses a two-service architecture:
jupyter): Runs the JupyterLab server athttp://jupyter:8888jupyter-mcp): Runs the MCP server athttp://jupyter-mcp:3000in HTTP transport mode and connects to the Jupyter serviceBoth services use native Docker health checks, allowing GitHub Actions to automatically wait for services to be healthy before starting the job. The MCP server is explicitly configured to use HTTP transport mode via the
MCP_TRANSPORTenvironment variable, allowing the agent to communicate with it via HTTP protocol while it proxies commands to the Jupyter server.Services Import Merging Behavior
When services are defined in both the main workflow and imported files:
steps:,tools:, andmcp-servers:are currently mergedExample merging scenario:
Testing
.lock.ymlgh aw mcp inspect devMCP_TRANSPORTandMCP_PORTenvironment variablesOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.