Skip to content

feat: implement MVP for MCP Resources and Prompts#43

Merged
doITmagic merged 3 commits intodevfrom
feature/mcp-resources-prompts-mvp
Mar 15, 2026
Merged

feat: implement MVP for MCP Resources and Prompts#43
doITmagic merged 3 commits intodevfrom
feature/mcp-resources-prompts-mvp

Conversation

@doITmagic
Copy link
Owner

Description

Extends RagCode MCP to support two additional MCP specification primitives: Resources and Prompts. Previously, the server exposed only Tools.

  • ragcode://status/indexing resource returns the current indexing progress for the active workspace.
  • System Diagnostics prompt generates a diagnostic analysis request pre-populated with the detected workspace path.
    Workspace detection uses the existing DetectContext logic (via X-Workspace-Root headers injected by daemon middleware), ensuring 100% compatibility with existing tools. Status retrieval is fully thread-safe.

Fixes #98

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • I have performed a self-review of my own code
  • I have formatted my code with go fmt ./...
  • I have run tests go test ./... and they pass
  • I have verified integration with Ollama/Qdrant (if applicable)
  • I have updated the documentation accordingly

- 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)
Copilot AI review requested due to automatic review settings March 15, 2026 17:49
@doITmagic doITmagic self-assigned this Mar 15, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/indexing MCP 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 .gitignore entries.

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
@doITmagic doITmagic merged commit a976a84 into dev Mar 15, 2026
3 checks passed
@doITmagic doITmagic deleted the feature/mcp-resources-prompts-mvp branch March 15, 2026 20:15
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.

2 participants