Overview
In addition to callable tools, Nectr’s MCP server exposes resources — streaming data endpoints that external agents can subscribe to for bulk data access. Resources use URI patterns and return serialized JSON strings, making them ideal for:- Bulk data export
- Real-time monitoring dashboards
- Data synchronization with external systems
- AI context augmentation
Resources are read-only. To modify Nectr data, use the REST API endpoints instead.
reviews_resource
Stream recent reviews for a repository as serialized JSON.URI Pattern
Repository owner (GitHub username or organization)
Repository name
Example URIs
Returns
A JSON string containing an array of review objects (same schema asget_recent_reviews tool).
Workflow run ID from the database
Full repository name (reconstructed as
owner/repo)GitHub pull request number
AI verdict:
APPROVED, CHANGES_REQUESTED, COMMENT, or UNKNOWNPlain-English review summary
ISO 8601 timestamp when the review was created
Workflow status:
completed, failed, processing, or pendingExample
Parsed Response (Pretty)
When parsed from thetext field:
Implementation
The resource is registered using FastMCP’s@mcp.resource() decorator:
The
{repo} parameter in the URI pattern expects the full repository name in the format owner/repo. The FastMCP framework automatically extracts this from the URI path.Data Limit
The resource returns the 20 most recent reviews for the repository, ordered bycreated_at DESC.
To fetch more reviews, use the get_recent_reviews tool with a custom limit parameter (up to 50).
Error Handling
If the database query fails:_query_db_reviews()logs a warning- Returns an empty list
[] - Resource returns
"[]"as the JSON string
Use Cases
Real-Time Monitoring Dashboard
Subscribe to the reviews resource and update a dashboard whenever new reviews are posted:Data Export
Export all reviews for a repository to a JSON file:AI Context Augmentation
Provide recent reviews as context to an AI agent:Slack Bot
Post a summary of recent reviews to Slack every morning:Comparison: Resources vs Tools
| Feature | Resources | Tools |
|---|---|---|
| Purpose | Bulk data streaming | Specific queries |
| URI | Custom scheme (e.g., nectr://) | Tool name (e.g., get_recent_reviews) |
| Parameters | Embedded in URI path | Passed as arguments |
| Return Type | Serialized JSON string | Structured dict/list |
| Limit | Fixed (20 reviews) | Configurable (up to 50) |
| Best For | Monitoring, export, sync | Single queries, filtering |
Future Resources (Roadmap)
Planned additional resources:nectr://repos/{owner}/{repo}/contributors— Top contributors with statsnectr://repos/{owner}/{repo}/health— Repository health metricsnectr://repos/{owner}/{repo}/prs/{pr_number}— Single PR review detailsnectr://repos/{owner}/{repo}/memories— Project patterns and memories
Want to request a new resource? Open an issue on GitHub.
MCP Resource Protocol
Nectr follows the MCP resource protocol specification:- Registration — Resources are registered with URI patterns during server initialization
- Discovery — Clients can list available resources via
resources/list - Subscription — Clients can subscribe to resources for real-time updates (SSE)
- Reading — Clients can read resource contents via
resources/read(JSON-RPC)