Add mcp command for stdio MCP server mode with deploy tool endpoint#90
Draft
Add mcp command for stdio MCP server mode with deploy tool endpoint#90
mcp command for stdio MCP server mode with deploy tool endpoint#90Conversation
- Add io.modelcontextprotocol.sdk:mcp:0.9.0 dependency to deploy4j-cli/pom.xml - Create McpCliCommand that starts deploy4j in stdio MCP server mode - Expose the deploy command as an MCP tool endpoint - Register McpCliCommand as a subcommand in Deploy4jApplicationCommand Co-authored-by: teggr <837787+teggr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add mcp command for server mode implementation
Add Feb 24, 2026
mcp command for stdio MCP server mode with deploy tool endpoint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds MCP (Model Context Protocol) server support to the deploy4j CLI, enabling AI agent harnesses to invoke deploy4j operations via the standardized MCP stdio transport.
Changes
McpCliCommand— picocli subcommanddeploy4j mcpthat starts an MCP sync server over stdio usingio.modelcontextprotocol.sdk:mcp:0.9.0deployMCP tool — exposes the existing deploy logic as an MCP tool endpoint; accepts an optionalskipPullboolean parameter, returns success/error text contentSystem.inin aFilterInputStreamthat counts down aCountDownLatchon EOF, blocking the main thread until the client closes the connection, then cleanly closes the serverio.modelcontextprotocol.sdk:mcp:0.9.0todeploy4j-cli/pom.xmlMcpCliCommandadded to the subcommand list inDeploy4jApplicationCommandUsage
# Start deploy4j as an MCP server (AI agent connects via stdio) deploy4j mcp -c config/deploy.yml -d stagingThe agent can then call the
deploytool:{ "name": "deploy", "arguments": { "skipPull": false } }This is the first tool endpoint; remaining CLI commands (
redeploy,rollback, etc.) can be added as follow-on MCP tools using the same pattern.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
central.sonatype.com/usr/bin/curl curl -s REDACTED(dns block)modelcontextprotocol.github.io/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)modelcontextprotocol.io/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original 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.