> For the complete documentation index, see [llms.txt](https://docs.tabnine.com/main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tabnine.com/main/getting-started/tabnine-plugin-for-opencode/mcp-servers.md).

# MCP Servers

The Tabnine plugin for opencode ships with two built-in Tabnine MCP servers and lets you add your own. This guide covers:

* The built-in **Remote Codebase Search** and **Coaching Guidelines** servers
* Viewing and disabling MCP servers
* Adding your own MCP servers
* How your organization's MCP governance applies

{% hint style="info" %}
**Looking for MCP in your IDE?** This page covers the `tabnine` CLI. For MCP servers with Tabnine Agent in your IDE, see [Understanding MCP Servers](https://docs.tabnine.com/main/getting-started/tabnine-agent/mcp-intro-and-setup).
{% endhint %}

### Built-in Tabnine MCP servers

Two Tabnine-hosted MCP servers are registered automatically, with no configuration needed:

* **`tabnine-context`** – Remote Codebase Search. The agent is steered to prefer these tools for codebase-wide questions.
* **`tabnine-coaching`** – Coaching Guidelines.

Both are remote (HTTP) servers authenticated with your Tabnine sign-in, and they stay authenticated for the life of the session. Each server registers only when your Tabnine deployment supports it (Coaching Guidelines additionally depends on your account's features), so you may see one, both, or neither depending on your setup.

You need to be signed in for the built-in servers to register. If you sign in during a running session, they come online without a restart. See [Signing In and Working with Models](/main/getting-started/tabnine-plugin-for-opencode/sign-in-and-models.md).

<figure><img src="https://3436682446-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY2qxVf5VTm3fmwP4B4Gx%2Fuploads%2F30REDqNhtQ9uGK2S9oFD%2Fopencode-coaching-findings.png?alt=media&amp;token=aa788757-9461-40f8-9ca3-0ab543105c54" alt="Output from &#x60;tabnine-coaching&#x60;: violations of the organization&#x27;s own standards, graded by severity and attributed to the rule that produced them"><figcaption><p>Output from <code>tabnine-coaching</code> : violations of the organization's own standards, graded by severity and attributed to the rule that produced them</p></figcaption></figure>

### See your connected servers

Run the `/mcps` command inside the TUI to open the MCP dialog. The built-in Tabnine servers appear there live, alongside any servers you added yourself.

{% hint style="info" %}
**Your existing opencode configuration also applies.** `tabnine` reads your standard opencode config (for example `~/.config/opencode/opencode.json`) in addition to its own Tabnine config directory at `~/.tabnine/opencode/config/opencode.json`. MCP servers and other settings you already use with opencode work here too, so you may see your own servers in the `/mcps` dialog next to the built-in Tabnine ones. Where the same setting is defined in both places, the Tabnine config directory takes precedence.
{% endhint %}

### Turn the built-in servers off

The built-in servers are on by default.

{% stepper %}
{% step %}

#### Disable a server for a single run

Set the matching environment variable to `0` or `false` before launching:

```bash
# Disable Remote Codebase Search for this run
TABNINE_ENABLE_REMOTE_CODE_SEARCH=0 tabnine

# Disable Coaching Guidelines for this run
TABNINE_ENABLE_COACHING=0 tabnine
```

{% endstep %}

{% step %}

#### Disable a server permanently

Set a plugin option instead. Edit `~/.tabnine/opencode/config/opencode.json` and turn the Tabnine plugin's string entry in the `plugin` array into a two-element tuple: the plugin specifier followed by an options object.

```json
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    [
      "file:///Users/you/.tabnine/opencode/plugin",
      {
        "enableRemoteCodeSearch": false,
        "enableCoaching": false
      }
    ]
  ]
}
```

Replace **/Users/you** with your home directory, and keep any `host` option the installer already wrote in that object. A boolean plugin option takes precedence over the matching environment variable; when neither is set, the server is enabled.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
**Added the plugin to your own opencode too?** Set the same options on the plugin's tuple in `~/.config/opencode/opencode.json` instead.
{% endhint %}

### Allow the Tabnine tools under strict permissions

The built-in servers expose tools under the keys `tabnine_context_*` and `tabnine_coaching_*`. If you run opencode with deny-by-default permissions, allow them explicitly in your opencode config (for the Tabnine install: `~/.tabnine/opencode/config/opencode.json`):

```json
{
  "permission": {
    "tabnine_context_*": "allow",
    "tabnine_coaching_*": "allow"
  }
}
```

### Add your own MCP servers

You can connect your own MCP servers, both local (stdio) and remote (network) transports, by adding them to your opencode configuration. They then show up in the `/mcps` dialog next to the built-in Tabnine servers.

Add a top-level [`mcp`](https://opencode.ai/docs/config/) map to an opencode config file. To make a server available everywhere, use the Tabnine config at `~/.tabnine/opencode/config/opencode.json`; to scope it to one repository, put it in an `opencode.json` in that project's root instead. Each entry maps a server name to its configuration, with `type` selecting the transport:

```json
{
  "mcp": {
    "my-local-tools": {
      "type": "local",
      "command": ["npx", "-y", "@modelcontextprotocol/server-filesystem", "/Users/you/projects"],
      "environment": { "MY_VAR": "value" },
      "enabled": true
    },
    "my-remote-tools": {
      "type": "remote",
      "url": "https://example.com/mcp",
      "headers": { "Authorization": "Bearer <token>" },
      "enabled": true
    }
  }
}
```

* **`type: "local"`** – runs the server as a subprocess. `command` is required: an array containing the command and its arguments. Optional fields: `cwd`, `environment` (a string map), `enabled`, `timeout` (ms).
* **`type: "remote"`** – connects over the network. `url` is required. Optional fields: `headers` (a string map), `oauth`, `enabled`, `timeout` (ms).

The built-in Tabnine servers are registered at runtime and never appear in this map. The transport types and their fields are defined by opencode.

**opencode reference:** MCP servers are a standard opencode feature; see the opencode [MCP servers docs](https://opencode.ai/docs/mcp-servers/) for transports and the full schema, and the [Config docs](https://opencode.ai/docs/config/) for where the `mcp` key lives.

{% hint style="info" %}
**Your organization governs MCP servers.** Any MCP server you add is subject to your organization's MCP governance policy: a blocked server is removed and a toast tells you why, and a re-allowed server reconnects automatically. The built-in Tabnine servers are exempt and are never blocked. Administrators configure policy modes and allowlists in [MCP Governance](/main/administering-tabnine/managing-your-team/settings/mcp-governance.md).
{% endhint %}

### If a server is blocked by your organization

When your organization's policy blocks a server you configured, the CLI shows a toast:

> MCP server "\<name>" was blocked by your organization: \<reason>

The reason states what the policy objected to. For example: "All MCP servers are blocked by your organization.", "Only remote MCP servers are allowed by your organization.", or "This MCP server is not in the allowlist." A blocked server is removed for the session, so it won't reconnect until the policy allows it.

Policy is re-checked every 5 minutes while the CLI runs, so an admin change takes effect without a restart. When a server becomes allowed again, you'll see:

> MCP server "\<name>" is now allowed by your organization and has been connected.

If you believe a server was blocked in error, contact your organization's Tabnine admin.

Next, see [Scripts and CI](/main/getting-started/tabnine-plugin-for-opencode/scripts-and-ci.md) to run `tabnine` non-interactively, or [Troubleshooting](/main/getting-started/tabnine-plugin-for-opencode/troubleshooting.md) for common fixes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.tabnine.com/main/getting-started/tabnine-plugin-for-opencode/mcp-servers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
