# Model Context Protocol

Baz offers code review according to your organization's configurations via the **Model Context Protocol (MCP)**—the open protocol that lets AI-native IDEs and CLIs like Cursor, Claude Code / Desktop and VS Code communicate with external AI servers.

By connecting to Baz’s MCP server, you can access high-signal, context-aware code reviews directly inside your editor. This guide explains how to configure Baz as an MCP server, how it works, and what you can expect from the integration.

### What Is the Model Context Protocol?

MCP is a protocol for connecting LLMs to tools, which allows the LLM greater functionality and accuracy. Baz MCP enables:

* AI code review directly in your IDE
* Rich feedback based on file usage, history, and repo structure
* Secure, on-demand analysis of your codebase
* Review that is based on your organization's presets and configurations

You are in full control of when and how Baz connects—nothing is behind the scenes. You configure your tools explicitly using the instructions below.

{% embed url="<https://www.youtube.com/watch?v=_ry0exhkIr8>" %}
Code Review in your IDE with the Baz MCP
{% endembed %}

### Connecting Baz as a Remote MCP Server

Baz exposes an MCP server that you can connect to from any MCP-enabled IDE / app / CLI. Once connected, Baz will analyze your codebase and provide context-aware reviews directly in your editor.

#### Server URL

```
https://baz.co/mcp
```

#### IDE Configuration Examples

**Claude Desktop**

```json
{
  "mcpServers": {
    "baz": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://baz.co/mcp"
      ]
    },
    "git": {
      "command": "uvx",
      "args": ["mcp-server-git"]
    }
  }
}
```

**Claude Code**

```shell
claude mcp add --transport http baz-http https://baz.co/mcp
```

**Cursor**

One click install: [![Install MCP Server](https://cursor.com/deeplink/mcp-install-light.svg)](https://cursor.com/en-US/install-mcp?name=baz\&config=eyJ1cmwiOiJodHRwczovL2Jhei5jby9tY3AifQ%3D%3D)&#x20;

To configure manually:

```json
{
  "mcpServers": {
    "baz": {
      "url": "https://baz.co/mcp"
    }
  }
}
```

**VS Code**

```json
{
  "mcp": {
    "servers": {
      "baz": {
        "type": "http",
        "url": "https://baz.co/mcp"
      }
    }
  }
}
```

{% embed url="<https://youtu.be/Ovn3thsqx7I?si=RZc1dAHFbf89SVYB>" %}
Baz on VSCODE
{% endembed %}

**Windsurf**

```json
{
  "mcpServers": {
    "baz": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://baz.co/mcp"
      ]
    }
  }
}
```

{% embed url="<https://youtu.be/ImCAXmjithM?si=ylB49KQzkepHm2Ej>" %}
Baz on Windsurf
{% endembed %}

### Troubleshooting

#### Clear your `~/.mcp-auth` directory

`mcp-remote` stores all credentials inside `~/.mcp-auth` (or wherever your `MCP_REMOTE_CONFIG_DIR` points to). If you're seeing connection or auth issues, try:

```shell
rm -rf ~/.mcp-auth
```

Then restart your MCP client.

#### Resetting Tools in VS Code

If you update Baz’s tool signature (parameters, description, etc.), MCP caches may need to be reset:

1. Open the Command Palette (`Cmd+Shift+P` on Mac)
2. Run: `MCP: Reset cached tools`

### Leveraging Advanced Customizations

By integrating with Baz, you can manage your review configurations centrally in one place - <https://baz.co>. This allows for cross-org alignment and enforcement on review principles, coding standards and conventions. Sign up free for a 14 day trial at <https://baz.co>.

### Summary

You can connect Baz to any MCP-compatible IDE in seconds using the `https://baz.co/mcp` endpoint. Once connected, Baz enhances your AI workflow by delivering context-aware, structured code reviews inside your editor.

## FAQ

<details>

<summary>What is the Model Context Protocol (MCP)?</summary>

MCP is an open protocol that lets AI-enabled editors or CLIs (e.g. Cursor, Claude Code, VS Code) communicate with external AI servers. Baz uses MCP to deliver context-aware reviews directly in the editor.

</details>

<details>

<summary>How do I connect my IDE to Baz via MCP?</summary>

You configure Baz as a remote MCP server, and then set up your editor (VS Code, Claude, etc.) to communicate via that endpoint.

</details>

<details>

<summary>What should I do if the MCP connection fails?</summary>

Common troubleshooting steps: clear your local \~/.mcp-auth directory, reset cached tools in VS Code (via “MCP: Reset cached tools”), and confirm the configured transport or command is correct.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.baz.co/code-review/model-context-protocol.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
