When large language models first arrived, the only way to converse with them about a codebase was to copy/paste chunks of code into a text interface. The Zed editor already gives you quick ways to get code into a conversation with a LLM (and we're working on even faster tools), but what about all the parts of your project that live outside the codebase?
Most projects have tons of valuable context that can't be found anywhere in their source code, such as:
- Stack traces recorded in production
- Database schemas or queries
- Analytics and telemetry
Until today, the fastest way to add context from one of these sources to a LLM conversation was to copy/paste like we did in the Dark Ages. Not anymore!
As of today, you can now install extensions from the Zed Extension Store which add custom slash commands in the assistant panel that can pull in context from any data source the extension author has implemented. For example, once you've installed an extension for accessing context from a database, you can use a slash-command in the middle of your conversation to specify a query to run. The database's response from that query will be injected directly into your conversation with the LLM, right where you put the slash-command.
You not only don't need to leave the editor, you don't even need leave the panel!
Here's an example of using a Zed extension for PostgreSQL to instantly inform the model about our entire database schema, so when we ask it to write a query for us, it knows exactly what tables and columns exist, and what their types are.
These new extensions are built using the Model Context Protocol, a new protocol we've collaborated with Anthropic to bring to Zed. MCP is not coupled to Zed or to Anthropic; since it's a protocol and not a library, anyone can use it without depending on any of our code. You can read Anthropic's MCP announcement post to learn more about it.
MCP follows in the footsteps of the wildly successful Language Server Protocol, which has unlocked a vibrant ecosystem of language-specific tools by letting authors implement their tooling once, rather than once for every different editor. We're excited for the MCP's potential to do the same thing for LLM context, by letting context server authors make one implementation for a particular data source (database, analytics, production logs, etc.) instead of one implementation per editor.
Saving you the time of copy/pasting context is just the tip of the iceberg of what MCP extensions can enable in the future. Tool use, where the model can invoke the context server autonomously (or with confirmation), is a natural next step. Zed is an open-source editor, and we're very open to contributions in this area.
We'll be diving deeper into Zed extensibility in the coming months, especially at the intersection of code and AI. As exciting new tools arrive to help programmers everywhere amplify their own creativity and problem-solving abilities, we're excited to be building an editor that helps you get the most out of them!