Skip to content

feat(agent): MCP prompts/resources, marketplace, OAuth refresh, cred hints, per-server timeout - #79

Closed
kwent wants to merge 36 commits into
devin/1793476918-agent-polishfrom
devin/1793477450-agent-mcp-resources
Closed

kwent wants to merge 36 commits into
devin/1793476918-agent-polishfrom
devin/1793477450-agent-mcp-resources

Conversation

@kwent

@kwent kwent commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Why: rootly-ai-tui is being retired in favour of rootly agent. This ports its MCP prompts/resources, marketplace and credential-freshness behaviour (audit rows 31, 32, 33, 58, 60, 61, 65, 66, 67, 80). Stacked on #77. CLI-only, no Rails change.

What

  • Prompts/resources (31/32/33/58/65): prompts/list and resources/list are called only when the server's initialize advertises that capability (max 500 each). /server:prompt entries are added to the slash palette, and built-ins and skills win name collisions. New /prompts and /resources listings. Typing @server:uri opens a mention palette (top 8, Tab inserts). On send, up to 8 mentioned resources are read, each capped at mcp.ResourceByteCap (32 KB, UTF-8 safe), and prefixed to the message as <resource server=… uri=…>…</resource>. A visible attached: … / skipped … note is shown. /mcp rows show N tools · N resources · N prompts.
  • Marketplace (66/67): rootly mcp search [query] [--refresh] [--limit] reads the official registry https://registry.modelcontextprotocol.io/v0/servers (limit=100, metadata.nextCursor, isLatest only). It maps npm→npx -y, pypi→uvx, oci→docker run -i --rm and remotes→http/sse, and caches the index at ~/.rootly-cli/mcp-index.json. The results are merged with a curated list (Datadog, Sentry, Linear, Notion first) and env hints. In /mcp, m opens the marketplace and Enter previews the exact command or URL. Only y adds the server, to user scope, written off. Nothing runs until the user turns it on, and project trust approval is unchanged. Names that are already configured in any scope are rejected.
  • Freshness (60/61/80): a remote 401 silently refreshes the OAuth token and retries once (same origin only, replayable bodies only). Otherwise the server goes back to "needs authentication". Local tool output that looks like expired AWS SSO credentials, a 401 or a 403 shows Refresh local creds, e.g. `aws sso login` once per run, in the TUI and in -p mode. Errors from declined tools don't trigger it. The new optional per-server "timeout": <seconds> (1–600) applies to connecting and to tool calls.

Before → after: before, there were no MCP prompts or resources, no marketplace, a 401 needed a manual rootly mcp login, and every server had the fixed default timeout. After, all of the above.

Risk: risk:low. The rootly agent command is hidden and these features are additive. Marketplace installs are off by default and never auto-run.

Rollback: revert this PR.

Verification (stacked PR, so no Actions CI): go test -race ./..., make lint (0 issues), make build and git diff --check all pass locally.

Link to Devin session: https://rootly.devinenterprise.com/sessions/5e2e52b477b74d98b9ed9500fe7b4860
Open in Devin Desktop: https://rootly.devinenterprise.com/desktop/session/5e2e52b477b74d98b9ed9500fe7b4860?variant=devin
Requested by: @kwent


Devin Review

devin-ai-integration Bot and others added 12 commits October 31, 2026 20:12
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
…creds

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
… reads

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
… capped attachments

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
…e installs

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
…ched off

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin resolved all 8 findings on c281622

Fixed by Devin (8)

  • Long marketplace install commands become unusable
  • Failed reads crowd out valid resources
  • Unlisted URIs lose meaningful trailing characters
  • Configured connection timeouts are ignored
  • Partial registry indexes stay cached for days
  • Imported server names bypass marketplace duplicate checks
  • Old marketplace loads overwrite new visits
  • OAuth token refresh lacks request cancellation

View all findings in Devin Review

Devin Review

@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; no outstanding blocking issues were found.

Summary

Adds MCP prompts and resource attachments, a searchable marketplace, OAuth refresh, credential hints, and per-server timeouts.

  • The agent can run MCP prompts and attach resources to chat messages.
  • People can search the MCP marketplace and add a server from the agent.
  • Remote MCP calls can refresh a token after a 401, and local tools can show a credential hint.
  • Each MCP server can set its own timeout for connecting and making calls.

Reviews (9) · Last reviewed commit: "fix(agent): widen /mcp status column so ..." · Reviewed by Greptile

greptile-apps[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 3 commits November 1, 2026 00:21
…he request, bound resource reads, never cache partial registry indexes, reject imported names in marketplace adds

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
…ed resource mentions with a note

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 8 commits November 1, 2026 00:33
…nto devin/1793477450-agent-mcp-resources

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>

# Conflicts:
#	internal/agent/mcp_page.go
#	internal/agent/tui.go
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
…lost auth

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
…iding names

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
devin-ai-integration Bot and others added 2 commits November 2, 2026 14:28
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@greptileai review

devin-ai-integration Bot and others added 6 commits November 2, 2026 14:38
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
…ent-mcp-resources

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@greptileai review

greptile-apps[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits November 2, 2026 14:54
…ent-mcp-resources; Ctrl+C cancels pending MCP prompt/resource loads

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@greptileai review

greptile-apps[bot]

This comment was marked as resolved.

… palette

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@greptileai review

1 similar comment
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@greptileai review

…sions or bindings

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@greptileai review

1 similar comment
@devin-ai-integration

Copy link
Copy Markdown
Contributor

@greptileai review

Co-Authored-By: Quentin Rousseau <quentin@rootly.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 @greptileai review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Completed the targeted real-terminal retest on final head c2816227f7be8cffe92775a6b041ac1bf91d30d2, against real Rails 7d689c64c3bdfbcae683410f913c3f57cbe57e62 on localhost:3000, the real LLM, and official MCP servers in isolated HOME.

Passed on c281622:

  • At 139 columns, the /mcp list—not the details view—shows the complete ✔ 22 tools · 11 resources · 4 prompts status. Filesystem still shows 14 tools.
  • /prompts lists all four everything-server prompts.
  • An @everything:demo://resource/static/document/e2e-note.txt send prints attached:. The real answer contains amber-summit-263 and Monday, neither supplied in the question.
  • Marketplace preview shows npx -y @modelcontextprotocol/server-filesystem ${PWD}, USER scope, and the switched-off warning. y adds the server as ○ off; the disabled state persists on disk and the client process PID set stays unchanged. No separate user-scope trust dialog is expected.

c281622 targeted terminal retest — full-frame, idle time removed

🔴 Before — ea13384, 139 columns 🟢 After — c281622, 139 columns
Previously clipped capability status Full capability status in the list
Regression — prompts, c281622 Regression — attached and grounded, c281622
Four discovered prompts Attached runbook and real model answer
Regression — exact preview, c281622 Regression — USER/off, c281622
Exact command and off-until-enabled warning Added to USER scope switched off

Reused evidence from ea13384—not rerun on c281622: live registry search/refresh and shell-quoted add output; exact expired-credentials hint once across two real reads; resource listing, prompt invocation, mention palette/Tab insertion; Ctrl+C cancellation of a blocked resource with no canceled turn sent; Enter not adding from preview; space enabling the server and causing its first new process. The only intervening change is status-column sizing.

Reused ea13384 — live search Reused ea13384 — one-time credentials hint
Registry search and quoted install command, ea13384 Expired-credentials hint, ea13384
Reused ea13384 — cancellation/no send Reused ea13384 — explicit enable
Blocked resource canceled without sending, ea13384 Marketplace server enabled explicitly, ea13384

Coverage boundary: OAuth/401 refresh/discovery was not E2E-tested. Whitespace/control prompt-name filtering, resource cap/skipped-note cases, project trust, skill/resume/binding-switch races, print-mode credential hint, and measured slow-tool timeout remain untested.

A desktop runtime reset required service recovery and the approved tmux/X11 capture fallback; the new recording contains the fresh final-head sequence. Isolated configuration/state were restored byte-for-byte; real ~/.rootly-cli/mcp.json stayed untouched. No implementation changes or GitHub posting.

Devin session

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Folded into #74, which now carries the whole rootly agent stack as one PR into master (merge, no rewrite: every commit from this branch is in #74's history). Closing in favour of #74.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant