Overview
In addition to tools (callable functions), Nectr’s MCP server exposes resources — URI-addressable data streams that external agents can subscribe to. Resources are useful for long-lived connections where clients want to pull data periodically without calling a tool. Current Resources:nectr://repos/{repo}/reviews— Recent reviews for a repository serialized as JSON
app/mcp/server.py:245
What is an MCP Resource?
An MCP resource is a URI pattern that maps to a data stream. Unlike tools (which are called with arguments and return a response), resources are subscribed to and return a stream of data. Analogy:- Tools = REST API endpoints (
POST /api/reviews) - Resources = WebSocket streams or Server-Sent Events (
GET /api/reviews/stream)
Available Resources
nectr://repos//reviews
Returns recent reviews for a repository as a JSON string. URI Pattern:Parameters
Full repository name (e.g.,
"acme/backend"). Extracted from the URI path.Response
Returns a JSON string (not a parsed object) containing an array of review objects:Implementation
File:app/mcp/server.py:245
app/mcp/server.py:33
Usage
Accessing Resources from Claude Desktop
Claude Desktop automatically discovers MCP resources. Ask:“Show me the reviews resource for acme/backend”Claude will call the resource URI and display the JSON response.
Accessing Resources via MCP Inspector
Accessing Resources via HTTP (Custom Client)
Correct approach:Tools vs. Resources
| Feature | Tools | Resources |
|---|---|---|
| Call pattern | tools/call with arguments | resources/read with URI |
| Response format | Parsed JSON (dict/list) | JSON string |
| Use case | One-off queries (“get PR verdict”) | Streaming data (“subscribe to reviews”) |
| Caching | No built-in caching | Can cache by URI |
| Example | get_recent_reviews(repo, limit) | nectr://repos/{repo}/reviews |
- You need to pass complex arguments
- You want a parsed response
- You’re calling from an MCP client that doesn’t support resources
- You want to subscribe to a data stream
- You need a stable URI for caching
- You’re building a dashboard that polls for updates
Adding New Resources
To add a new resource to Nectr’s MCP server:Troubleshooting
Error: Resource not found
Error: Resource not found
Cause: URI pattern does not match any registered resource.Fix:
- Check URI format:
nectr://repos/{owner}/{repo}/reviews(no trailing slash) - Verify resource is registered in
app/mcp/server.py - Restart Nectr to reload resources
Empty response
Empty response
Cause: Database is empty or no reviews match the repo.Fix:
- Run a review to populate the database
- Check logs:
docker logs nectr-backend - Verify
repoformat:owner/repo(not justrepo)
JSON parse error
JSON parse error
Cause: Resource returns a JSON string, not a parsed object.Fix:
- Wrap response in
json.loads(...)if using a custom client - MCP clients (Claude Desktop, MCP Inspector) parse automatically
Next Steps
MCP Tools Reference
Browse all available MCP tools
MCP Server Setup
Configure and deploy Nectr’s MCP server
MCP Protocol
Understand how MCP works in Nectr