-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat: support Model Context Protocol in VSCode extension #2132
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for slidev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I am not sure how this would be useful. If we only do the parsing, shouldn't that information already be available just by feeding the entire file to LLM? (which should be already available to the agent) |
You raise a fair point. I think as slides projects get more complex, current agent might struggle. I want to use mcp to boost the agent's processing capabilities, which fits what a VSC extension can do. I spent a few days building a demo. slidev-mcp-test-demo.movCompared to feeding the entire slides file, mcp works at the slide level for input and editing. Using an agent to generate or optimize complex slides is pretty challenging. Modifying the whole slide file at once needs stronger models. To improve results, we need to reduce complexity. Often when editing one slide, it don't need context from other slides - that's where mcp shines. By providing slide-level context, it breaks down processing tasks into simpler pieces. The agent only needs to focus on one slide at a time, which helps avoid accidentally changing unrelated code. Also, slide files have reference relationships, plus custom components, themes, layouts, etc. This is typically a multi-file project. Passing the whole file or folder to an agent might make it hard for some models to understand these references. For Cursor, you might need to manually add rules. But mcp can parse out the reference relationships between slides, identify custom components, and provide helpful context. The agent doesn't need to worry about finding slides in different entry files - it can understand the whole presentation sequentially. Additionally, mcp provides more helper info. For example, it can fetch the latest slidev features via docs, themes and addons via npm, recommend appropriate ones without requiring user input or relying on the model's own outmoded knowledge. This connects to the existing slidev ecosystem and reduces learning curve. Custom themes, components, and layouts can be accessed through mcp without adding code files to the cursor chat context. Currently, mcp has these tools:
|
🤔 As the VSCode version reaches 1.99, using the vsc LanguageModelTool to make the mcp tool might be a better way instead of an HTTP server. |
Inspired by
vite-pulgin-mcp
, I have integratedmcp
into the runtime ofslidev
. When users are using AI to assist in writing slides, they can provide more detailed information to the agent through a series ofmcp tools
: number, table of contents, formatter, headmatter, etc. By the way, it's time to make the slidev vsc extension great again.support tools
get-current-slide-no
: Get current slide number.get-current-slide
: Get current slide info.get-slide-by-no
: Get slide info by number.get-all-slides
: Get all slides info.