Skip to content

Add context action for rich single-call resource fetching#71

Merged
titouanmathis merged 2 commits intomainfrom
feature/69-context-action
Feb 27, 2026
Merged

Add context action for rich single-call resource fetching#71
titouanmathis merged 2 commits intomainfrom
feature/69-context-action

Conversation

@titouanmathis
Copy link
Contributor

Implements #69 — adds a context action to servers and sites resources.

Changes

Core

  • Added context to ACTIONS constant

MCP

  • New handleServerContext() — fetches server + 6 sub-resources in parallel
  • New handleSiteContext() — fetches site + 4 sub-resources in parallel (deployments limited to last 5)
  • Wired into existing handleServers and handleSites handlers
  • Added context to READ_ACTIONS
  • Updated help and schema handlers
  • Comprehensive test coverage

Usage

{"resource": "servers", "action": "context", "id": "725393"}

Returns:

{
  "server": { ... },
  "sites": [ ... ],
  "databases": [ ... ],
  "database_users": [ ... ],
  "daemons": [ ... ],
  "firewall_rules": [ ... ],
  "scheduled_jobs": [ ... ]
}

Closes #69

Add a context action to servers and sites resources that fetches all
related sub-resources in parallel via Promise.all, returning a
comprehensive snapshot in a single MCP call.

- Server context: server + sites + databases + db users + daemons + firewall rules + scheduled jobs
- Site context: site + deployments (last 5) + certificates + redirect rules + security rules

Closes #69

Co-authored-by: Claude <claude@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.82%. Comparing base (d3c0f6f) to head (6e58afd).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #71   +/-   ##
=======================================
  Coverage   99.82%   99.82%           
=======================================
  Files         218      219    +1     
  Lines        3462     3487   +25     
  Branches      799      807    +8     
=======================================
+ Hits         3456     3481   +25     
  Misses          6        6           
Flag Coverage Δ
unittests 99.82% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Add test for non-array deployments data to cover the else branch
in handleSiteContext.

Co-authored-by: Claude <claude@anthropic.com>
@titouanmathis titouanmathis merged commit c58145e into main Feb 27, 2026
8 checks passed
@titouanmathis titouanmathis deleted the feature/69-context-action branch February 27, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add context action for rich single-call resource fetching

1 participant