# context server: Make requests type safe \(\#32254\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/95d78ff8d573c88d51a8f77e039165c1de0ff16a)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 95d78ff8d573c88d51a8f77e039165c1de0ff16a

Requested commit: 95d78ff8d573c88d51a8f77e039165c1de0ff16a

Commit: 95d78ff8d573c88d51a8f77e039165c1de0ff16a

Tree: 454c2fbeddbc3e84221a24ff76feea14a0962092

Author: Bennet Bo Fenner

Committer: GitHub

## Message

````
context server: Make requests type safe (#32254)

This changes the context server crate so that the input/output for a
request are encoded at the type level, similar to how it is done for LSP
requests.

This also makes it easier to write tests that mock context servers, e.g.
you can write something like this now when using the `test-support`
feature of the `context-server` crate:

```rust
create_fake_transport("mcp-1", cx.background_executor())
    .on_request::<context_server::types::request::PromptsList>(|_params| {
        PromptsListResponse {
            prompts: vec![/* some prompts */],
            ..
        }
    })
```

Release Notes:

- N/A
````

## Parents

- [454adfacae1647d4a46967f18a42ed2f5f333bb9](https://git.cafe/gitcafe/zed/commit/454adfacae1647d4a46967f18a42ed2f5f333bb9?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/95d78ff8d573c88d51a8f77e039165c1de0ff16a?format=markdown)
