Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model context protocol prompt fix and roots #4533

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

alexsmirnov
Copy link

Description

[ What changed? Feel free to be brief. ]
The fix updates prompt ( slash command ) obtained from MCP to properly include prompt context into model call.
Without it, all @... context resources stripped out from user message. The code based on /review and custom prompt command code. Noisy comments reflect my investigation into how it works. To confirm correctness, it also includes unit test that repeated all combinations that I collected from debug sessions.

The second change is support for MCP roots feature https://modelcontextprotocol.io/docs/concepts/roots.
Client reports workspace directories as response to request from server. I found it necessary to provide workspace specific resources and tools.
I do not dare to include my project https://github.com/alexsmirnov/mcp-server-continue as reference to documentation, it's too early stage. But it supports all features.

Checklist

  • [] The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screenshots

[ For visual changes, include screenshots. ]

Testing instructions

with https://github.com/alexsmirnov/mcp-server-continue and uv https://github.com/astral-sh/uv
config.json:

{
"experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "uv",
          "args": [
            "run",
            "--project",
            "<absolute path project folder>/mcp-server-continue",
            "mcps"
          ]
        }
      }
    ]
  }
}

slash command /echo with @some.file , or any other resource
[ For new or modified features, provide step-by-step testing instructions to validate the intended behavior of the change, including any relevant tests to run. ]

Copy link

netlify bot commented Mar 7, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit dbd232a
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/67cb696efff3f90008d3ee0b

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.

1 participant