Skip to content

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. ]

@netlify
Copy link

netlify bot commented Mar 7, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 868d1dc
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/67d36b5531ae9c0008da89d0

@alexsmirnov alexsmirnov force-pushed the mcp-prompt-fix-and-roots branch from dbd232a to 868d1dc Compare March 13, 2025 23:33
@sestinj
Copy link
Contributor

sestinj commented Mar 16, 2025

@alexsmirnov I'm thinking that the cleaner way to solve this replacement problem would be by handling it in resolveInput.ts, which is where we replace context providers with their content. That way all of the logic would be centralized in one place

@sestinj sestinj self-requested a review March 16, 2025 20:30
@alexsmirnov
Copy link
Author

Hi @sestinj , this is that confused me at the first place, how other prompt providers handle resources. I copied functionality from review, and custom prompts. Can you give me directions how to use resolveInput.ts ? I'll take a look on my own by the way

@sestinj
Copy link
Contributor

sestinj commented Apr 23, 2025

@alexsmirnov I'm sorry for being slow, but I finally got back around to reviewing this again. I think that the prompt fix is unfortunately just adding too much complexity for us to merge, even with the testing.

I however do think that the addition of roots is done very well. Would you be interested in opening up a fresh PR for this? I want to clean up this PR since it has gone relatively stale, but we'd be very excited to add roots!

@sestinj sestinj closed this Apr 23, 2025
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