docs: Document context servers (#21170)

This PR adds documentation for context servers.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-11-25 11:05:14 -05:00 committed by GitHub
parent b83f104f6e
commit 385c447bbe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 116 additions and 10 deletions

View file

@ -15,3 +15,5 @@ This section covers various aspects of the Assistant:
- [Using Commands](./commands.md): Explore slash commands that enhance the Assistant's capabilities and future extensibility.
- [Prompting & Prompt Library](./prompting.md): Learn how to write and save prompts, how to use the Prompt Library, and how to edit prompt templates.
- [Context Servers](./context-servers.md): Learn about context servers that enhance the Assistant's capabilities via the [Model Context Protocol](./model-context-protocol.md).

View file

@ -0,0 +1,49 @@
# Context Servers
Context servers are a mechanism for pulling context into the Assistant from an external source. They are powered by the [Model Context Protocol](./model-context-protocol.md).
Currently Zed supports context servers providing [slash commands](./commands.md) for use in the Assistant.
## Installation
Context servers can be installed via [extensions](../extensions/context-servers.md).
If you don't already have a context server, check out one of these:
- [Postgres Context Server](https://github.com/zed-extensions/postgres-context-server)
## Configuration
Context servers may require some configuration in order to run or to change their behavior.
You can configure each context server using the `context_servers` setting in your `settings.json`:
```json
{
"context_servers": {
"postgres-context-server": {
"settings": {
"database_url": "postgresql://postgres@localhost/my_database"
}
}
}
```
If desired, you may also provide a custom command to execute a context server:
```json
{
"context_servers": {
"my-context-server": {
"command": {
"path": "/path/to/my-context-server",
"args": ["run"],
"env": {}
},
"settings": {
"enable_something": true
}
}
}
}
```

View file

@ -0,0 +1,21 @@
# Model Context Protocol
Zed uses the [Model Context Protocol](https://modelcontextprotocol.io/) to interact with [context servers](./context-server.md):
> The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.
Check out the [Anthropic news post](https://www.anthropic.com/news/model-context-protocol) and the [Zed blog post](https://zed.dev/blog/mcp) for an introduction to MCP.
## Try it out
Want to try it for yourself?
The following context servers are available today as Zed extensions:
- [Postgres Context Server](https://github.com/zed-extensions/postgres-context-server)
## Bring your own context server
If there's an existing context server you'd like to bring to Zed, check out the [context server extension docs](../extensions/context-servers.md) for how to make it available as an extension.
If you are interested in building your own context server, check out the [Model Context Protocol docs](https://modelcontextprotocol.io/introduction#get-started-with-mcp) to get started.