Skip to content
Open
9 changes: 9 additions & 0 deletions src/current/_includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@
</script>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js" integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>
<script src="{{ 'js/searchInputRendering.js' | relative_url }}"></script>
<!-- Algolia client for autocomplete -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/algoliasearch-lite.umd.min.js"></script>
<!-- Algolia Autocomplete with Kapa Integration -->
<script src="{{ 'js/algoliaAutocomplete.js' | relative_url }}"></script>

{%- comment -%} Add the Brand Website segment source and fire a page impression. {%- endcomment -%}
<script>
Expand Down Expand Up @@ -153,6 +158,10 @@
data-modal-disclaimer="This AI bot is experimental. Don't rely on it for production workloads. Always consult the official CockroachDB documentation. Interactions with this AI bot may be monitored or recorded, and your use of the AI bot is subject to the Cockroach Labs' [Terms of Use](https://www.cockroachlabs.com/website-terms-of-use/) and [Privacy policy](https://www.cockroachlabs.com/privacy/)."
data-modal-y-offset="12vh"
data-modal-z-index="1000"
data-mcp-enabled="true"
data-mcp-server-url="https://cockroachdb.mcp.kapa.ai"
data-search-mode-enabled="true"
data-modal-open-on-command-k="true"
></script>

<style>
Expand Down
55 changes: 54 additions & 1 deletion src/current/_includes/topnav.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,60 @@
<img width="16" src="{{ 'images/icon-search.svg' | relative_url }}" alt="search">
</span>
</div>
<input type="text" class="form-control border-0" placeholder="Search" aria-label="Search" aria-describedby="basic-addon1">
<input
id="search-input"
type="text"
class="form-control border-0"
placeholder="Search"
aria-label="Search"
aria-describedby="basic-addon1"
>
<div class="input-group-append">
<button
id="mcp-dropdown-toggle"
class="btn btn-outline-primary dropdown-toggle"
type="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
title="AI & MCP Tools"
>
<i class="fas fa-robot"></i> AI
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="mcp-dropdown-toggle" style="min-width: 250px;">
<h6 class="dropdown-header">AI Assistant</h6>
<button
class="dropdown-item"
type="button"
onclick="if(window.Kapa) { window.Kapa.open(); } else { alert('AI Assistant not available'); }"
>
<i class="fas fa-comments"></i> Ask AI Assistant
</button>
<div class="dropdown-divider"></div>
<h6 class="dropdown-header">MCP Integration</h6>
<button
class="dropdown-item"
type="button"
onclick="if(window.Kapa) { window.Kapa.open(); alert('Connect to MCP server at: https://cockroachdb.mcp.kapa.ai'); } else { alert('MCP not available'); }"
>
<i class="fas fa-plug"></i> Connect with MCP
</button>
<button
class="dropdown-item"
type="button"
onclick="window.open('https://docs.kapa.ai/dev/kapa-mcp', '_blank')"
>
<i class="fas fa-book"></i> MCP Documentation
</button>
<button
class="dropdown-item"
type="button"
onclick="window.open('https://www.cockroachlabs.com/docs/stable/mcp-setup', '_blank')"
>
<i class="fas fa-cog"></i> Setup Guide
</button>
</div>
</div>
</div>
<ul class="navbar-nav">
<li class="nav-item text-nowrap mb-0">
Expand Down
193 changes: 193 additions & 0 deletions src/current/docs-mcp-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
---
title: CockroachDB Docs MCP
summary: Connect to CockroachDB documentation directly from your IDE or AI assistant
toc: true
docs_area: reference
---

The CockroachDB Docs MCP (Model Context Protocol) server enables AI assistants like Claude Desktop, Cursor, and VS Code to access CockroachDB documentation directly. This allows you to get instant, context-aware answers about CockroachDB without leaving your development environment.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest making "Model Context Protocol" in parens a link to https://modelcontextprotocol.io/introduction


## Create your own MCP
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this section on building one's own MCP can be removed, it splits the focus of the page from the setup instructions for our MCP server


Want to build your own MCP server? Check out the [MCP documentation](https://modelcontextprotocol.io/introduction) to get started.

## Setup

Connect your AI assistant to CockroachDB documentation by configuring the MCP server. Choose your platform below for specific instructions.

### Cursor

1. Open Cursor Settings (⌘+,)
2. Navigate to **Models** → **Model Context Protocol**
3. Add the following configuration:

```json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as elsewhere re: the code block needs indentation for the numbered list to render properly (try 4 spaces)

{
"mcpServers": {
"cockroachdb-docs": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-everything", "https://cockroachdb.mcp.kapa.ai"]
}
}
}
```

4. Restart Cursor to apply the configuration
5. You can now ask questions about CockroachDB documentation directly in Cursor

### VS Code

1. Install the [Claude for VS Code](https://marketplace.visualstudio.com/items?itemName=Anthropic.claude) extension
2. Open VS Code Settings (⌘+,)
3. Search for "Claude MCP"
4. Add the following to your MCP configuration:

```json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this JSON block needs some indentation in order for the numbered list to render properly. Right now the numbering stops at 4 and restarts at 1 after the code block. I think 4 spaces should work

Screenshot 2025-12-18 at 11 26 48

{
"claude.mcpServers": {
"cockroachdb-docs": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-everything", "https://cockroachdb.mcp.kapa.ai"]
}
}
}
```

5. Reload VS Code window (⌘+R)
6. The CockroachDB documentation is now available through Claude in VS Code

### Claude Code

1. Open Claude Code settings
2. Navigate to MCP Servers configuration
3. Add the CockroachDB Docs server:

```json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as elsewhere re: the code block needs indentation to render properly (try 4 spaces)

{
"mcpServers": {
"cockroachdb-docs": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-everything", "https://cockroachdb.mcp.kapa.ai"]
}
}
}
```

4. Restart Claude Code
5. CockroachDB documentation is now accessible in your Claude Code environment

### ChatGPT Desktop

{{site.data.alerts.callout_info}}
MCP support for ChatGPT Desktop is coming soon. Check back for updates.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wild that they still don't have this

{{site.data.alerts.end}}

### Claude Desktop

1. Open Claude Desktop configuration file:
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
- **Linux**: `~/.config/Claude/claude_desktop_config.json`

2. Add the CockroachDB Docs MCP server to your configuration:

```json
{
"mcpServers": {
"cockroachdb-docs": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-everything", "https://cockroachdb.mcp.kapa.ai"]
}
}
}
```

3. Save the file and restart Claude Desktop
4. You can now query CockroachDB documentation directly in Claude Desktop

### Other

For other MCP-compatible clients, use the following server configuration:

**Server URL**: `https://cockroachdb.mcp.kapa.ai`

Generic configuration format:
```json
{
"servers": [{
"name": "cockroachdb-docs",
"url": "https://cockroachdb.mcp.kapa.ai"
}]
}
```

Consult your client's documentation for specific configuration instructions.

## What you can do

Once connected, you can ask your AI assistant questions about CockroachDB and get answers directly from the official documentation. Here are some example queries:

### Multi-Region Configuration
- "How do I set up a multi-region CockroachDB cluster?"
- "What are the best practices for configuring region survival goals?"
- "Show me how to implement follow-the-workload patterns"

### Performance Optimization
- "What are the recommended techniques for optimizing query performance?"
- "How do I identify and resolve hot spots in my cluster?"
- "Explain the best practices for index design in CockroachDB"

### Security Features
- "How do I configure TLS/SSL encryption for my cluster?"
- "What are the steps to implement role-based access control?"
- "Show me how to set up audit logging in CockroachDB"

### SQL Syntax and Features
- "What's the syntax for creating a changefeed?"
- "How do I use window functions in CockroachDB?"
- "Explain the differences between JSONB operators in CockroachDB"

### Troubleshooting
- "How do I diagnose and fix connection refused errors?"
- "What steps should I take when encountering transaction retry errors?"
- "How do I investigate and resolve node liveness issues?"

### Operations and Maintenance
- "What's the recommended backup strategy for production clusters?"
- "How do I perform a rolling upgrade of my cluster?"
- "Show me the best practices for monitoring CockroachDB"

## Troubleshooting

### Connection Issues
If your AI assistant cannot connect to the CockroachDB documentation:
1. Verify your internet connection
2. Check that the MCP server URL is correctly configured: `https://cockroachdb.mcp.kapa.ai`
3. Restart your AI assistant application
4. Ensure you have the latest version of your AI assistant

### No Results
If queries return no results:
1. Try rephrasing your question to be more specific
2. Include "CockroachDB" in your query for better context
3. Check the [CockroachDB documentation](https://www.cockroachlabs.com/docs/) directly to verify the information exists

### Configuration Not Working
If the configuration doesn't seem to take effect:
1. Ensure the configuration file is saved in the correct location
2. Check for JSON syntax errors in your configuration
3. Fully quit and restart your application (not just reload)
4. Verify that `npx` is available in your system PATH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest wrapping PATH in backticks for code font


## Feedback and Support

For issues or feedback about the CockroachDB Docs MCP server:
- Report documentation issues on [GitHub](https://github.com/cockroachdb/docs/issues)
- For MCP-specific problems, check [Kapa AI support](https://docs.kapa.ai)
- Join the [CockroachDB Community Slack](https://www.cockroachlabs.com/join-community/) for help

## See Also

- [CockroachDB Documentation](https://www.cockroachlabs.com/docs/)
- [Model Context Protocol](https://modelcontextprotocol.io/)
- [Kapa AI Documentation](https://docs.kapa.ai)
Loading
Loading