Repository navigation
Support an opt-in read-only MCP server via cmd2[mcp] - #1866
Open
tleonhardt wants to merge 2 commits into
Open
tleonhardt wants to merge 2 commits into
tleonhardt wants to merge 2 commits into
Conversation
Let Cmd own listener startup, shutdown, and snapshot refresh at its command and prompt boundaries. Keep the SDK optional and make the fleet console a consumer of the supported API. Exercise default installations and real MCP clients separately in CI.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## mcp-server-example #1866 +/- ##
======================================================
+ Coverage 99.76% 99.79% +0.02%
======================================================
Files 23 25 +2
Lines 6801 7730 +929
======================================================
+ Hits 6785 7714 +929
Misses 16 16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
This branch has not been deployed
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.
Alternative solution for #1852. #1855 demonstrates read-only MCP discovery through a reusable example mixin. This PR promotes the same three tools to a supported, opt-in
Cmdfeature. Applications installcmd2[mcp]and select a port, and the Fleet console demonstrates the public API.This PR targets #1855’s
mcp-server-examplebranch so the diff shows what official support adds. The adoption and maintenance tradeoffs are summarized in the issue discussion.Usage
Install
cmd2[mcp]and select a port when constructing the application.A client can then connect to
http://127.0.0.1:8765/mcp. Port0requests an available port. The defaultNoneleaves MCP disabled, with no SDK import, snapshot work, or listener.Behavior
mcp_start()andmcp_stop()and inspectmcp_urlormcp_status().Verification
make checkandmake docs-testpassed.