feat: implement MVP for MCP Resources and Prompts#43
Merged
Conversation
- Add internal/service/resources package exposing ragcode://status/indexing - Add internal/service/prompts package exposing System Diagnostics prompt - Wire both into internal/daemon/run.go after tools registration - Both use eng.DetectContext(ctx, "") identical to existing tools - BuildIndexingProgress is thread-safe (sync.Mutex + deep-copy)
There was a problem hiding this comment.
Pull request overview
Adds MCP Resources and Prompts support to RagCode MCP, extending the server beyond Tools to expose indexing status via a resource URI and provide a diagnostics prompt that auto-detects the active workspace.
Changes:
- Add
ragcode://status/indexingMCP resource that returns indexing status/progress as JSON. - Add “System Diagnostics” MCP prompt that generates a pre-filled troubleshooting request for the detected workspace.
- Wire new resources/prompts registration into the daemon startup; update
.gitignoreentries.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| internal/service/resources/resources.go | Registers the indexing-status MCP resource and marshals progress to JSON. |
| internal/service/prompts/prompts.go | Registers the “System Diagnostics” MCP prompt using detected workspace context. |
| internal/daemon/run.go | Registers the new resources/prompts with the MCP server during daemon init. |
| .gitignore | Ignores .agent/ and .trello.json. |
You can also share your feedback on Copilot code review. Take the survey.
- Fix unused parameter: rename 'request' to '_' in prompts handler - Fix compilation: replace undefined tools.BuildIndexingProgress with eng.GetIndexStatus - Remove unused tools import from resources.go - Translate all inline comments from Romanian to English for consistency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Extends RagCode MCP to support two additional MCP specification primitives: Resources and Prompts. Previously, the server exposed only
Tools.ragcode://status/indexingresource returns the current indexing progress for the active workspace.System Diagnosticsprompt generates a diagnostic analysis request pre-populated with the detected workspace path.Workspace detection uses the existing
DetectContextlogic (viaX-Workspace-Rootheaders injected by daemon middleware), ensuring 100% compatibility with existing tools. Status retrieval is fully thread-safe.Fixes #98
Type of change
Checklist:
go fmt ./...go test ./...and they pass