MCP servers in VS Code
The panel uses the same MCP servers as codity agent in the terminal: yours from ~/.codity/mcp.json, the project's from .mcp.json, and any you add for one session. This page covers managing them from VS Code. For the file format, ${VAR} references and your organization's rules, see MCP servers.
See your servers
Run Codity: MCP Servers from the Command Palette, or type /mcp in the message box. The list shows every server with where it comes from (you, the project or this session), what it connects to or runs, and its state:
| State | Meaning |
|---|---|
| Connected | Its tools, prompts and resources are available to the agent. |
| Needs sign-in | The server uses OAuth. Choose it, then Sign in. |
| Needs an OAuth client ID | The server's sign-in needs a client registered in advance; its provider's documentation says how. |
| Waiting for your approval | A project server you have not approved yet. |
| Declined | A project server you declined. You can approve it later from the list. |
| Blocked by policy | Your organization's or team's policy refuses it; the reason is shown. |
| Cannot start | Its definition can't be used, for example a ${VAR} that is not set; the reason is shown. |
| Failed | It did not start or connect; the error is shown. Retry tries again. For a remote server, Sign out forgets a saved sign-in the server no longer accepts, then retries so you can sign in again. |
| Off | Disconnected for this session. |
Choose a server to Connect, Disconnect (its tools are unavailable until you connect it again), Sign in, Sign out (forgets the sign-in saved for it) or Remove it.
Add a server
- In the server list, choose Add an MCP server....
- Choose Remote server to connect by URL, or Local command to start a program on your machine.
- Enter a name, then the URL, or the command and its arguments.
- Optionally add headers (remote) or environment variables (local), as
Name: valueorKEY=value. Use${VAR}for secrets so they stay in your environment. - Choose where to save it:
| Choice | Saved in |
|---|---|
| This session only | Nowhere; gone when the agent restarts. |
| This project | The project's .mcp.json, shared with everyone through the repository. |
| All your projects | Your own ~/.codity/mcp.json. |
If you save a header or environment value written out in full (not a ${VAR} reference) to This project, the panel warns that it would be shared through the repository and asks you to confirm with Save anyway. Removing a project or personal server asks first too, and says which file it is removed from.
The server starts as soon as it is added. A remote server that needs OAuth shows a notification with Sign in; your browser opens the provider's page, and the server connects once you finish.
Approve a project's servers
When you open a project whose .mcp.json lists servers you haven't approved, a notification says the project adds MCP servers you have not approved. Choose Review to see what each one runs or connects to and which environment variables it reads, then Approve and start, Decline or Decide later. An approval covers that exact definition: if someone changes it in the repository, you are asked again.
Use server prompts and resources
- Prompts: type
/and pick an entry marked MCP prompt, named/server:prompt. Press Enter to fill in the name and again to send. - Resources: choose + → MCP resource, then the resource. It is attached to your message as a chip, and the agent reads it with your message.
- Tools: ask for what you want; the agent calls a server's tools like its own. Tool calls follow your permissions and hooks like any other.
Policy
Your organization's and team's agent policies can allow or deny servers by name, URL or command. A refused server is listed as Blocked by policy with the policy's reason, and its tools can't be called. Switching team policy in the panel applies the new team's rules straight away. See Organization and team policy.

