# context_store: Refactor state management \(\#29910\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 9cb5ffac253d1fe174866b7d9cd2c0fd19c92e9d

Requested commit: 9cb5ffac253d1fe174866b7d9cd2c0fd19c92e9d

Commit: 9cb5ffac253d1fe174866b7d9cd2c0fd19c92e9d

Tree: da190e44f0a8ff52cbc17c09ab898ee28341867e

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
context_store: Refactor state management (#29910)

Because we instantiated `ContextServerManager` both in `agent` and
`assistant-context-editor`, and these two entities track the running MCP
servers separately, we were effectively running every MCP server twice.

This PR moves the `ContextServerManager` into the project crate (now
called `ContextServerStore`). The store can be accessed via a project
instance. This ensures that we only instantiate one `ContextServerStore`
per project.

Also, this PR adds a bunch of tests to ensure that the
`ContextServerStore` behaves correctly (Previously there were none).

Closes #28714
Closes #29530

Release Notes:

- N/A
```

## Parents

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

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