feat: serve collar tools over mcp #12
No reviewers
Labels
No labels
needs/docs
needs/research
needs/upstream
type/bug
type/external
type/feature
type/refactor
urgency
high
urgency
immediate
urgency
low
urgency
medium
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ScottyLabs/collar!12
Loading…
Reference in a new issue
No description provided.
Delete branch "krishsax/mcp-server"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds
collar mcp, a Model Context Protocol server over stdio, so clients that cannot run shell commands (Claude Desktop, claude.ai connectors, IDE assistants) can use Collar.--json, and returns its stdout. Tools therefore share the CLI's validation, host-bound credentials, field selection, and error behavior, and child output never mixes with the protocol stream.status,pr_list,pr_view,pr_diff,pr_checks,issue_list,issue_view,actions_list,actions_jobs,actions_logs,kennel_status,kennel_logs,kennel_preview,docs_search,docs_view,repo_view, andapi_get(always--method=GET).--allow-writesaddspr_comment,pr_review,issue_create, andissue_comment. Write tools are neither listed nor callable without it, carryreadOnlyHint: false, and are never retried.--host,-R,--config,--cache-dir,--no-config) are forwarded;-Rbeforemcpsets the default repository and a tool'srepoargument overrides it.--flag=valueand positionals after--, so remote or model-supplied text cannot become an option. Arguments are type-checked against each tool's schema, and unknown arguments are rejected.isError: truewith stderr and any JSON stdout, sopr_checksstill reports the failing statuses. Output over 256 KiB is truncated with a note.serde_json, keeping the binary blocking and synchronous.Docs: new "Connect an MCP client" section in
docs/agents.md; the command reference is regenerated. The skill remains the recommended path for agents that can run commands.Not included: long-running waits (
kennel wait,actions watch), which would block the stdio loop and are better added later with progress notifications.Validation
cargo clippy --all-targets -- -D warningsandtreefmtpass.src/mcp.rscover argument boundaries, validation, write opt-in, protocol errors, and truncation.tests/cases/mcp.rsrunscollar mcpagainst the fixture server: initialize, notification handling, tool listing without writes, apr_viewcall with field selection, a rejected write call, and an error result that does not echo secrets.pr_list,pr_checks,docs_search).clitest binary aborts with "failed to initiate panic, error 5" on any test that panics, onmainas well. Running each test in its own process: 144 of 146 pass. The two failures are existingenvironmenttests that compare/varagainst/private/vartemp paths. Thecargo-testhook was skipped for this commit for that reason.Kennel Deployments
Last updated for commit
bfe9879.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.