155 lines
5.5 KiB
Markdown
155 lines
5.5 KiB
Markdown
---
|
|
sidebar_label: Continue
|
|
slug: /continue
|
|
---
|
|
|
|
# Integrate OceanBase MCP Server with Continue
|
|
|
|
[MCP (Model Context Protocol)](https://modelcontextprotocol.io/introduction) is an open-source protocol released by Anthropic in November 2024. It enables large language models to interact with external tools or data sources. With MCP, users do not need to manually copy and execute the output of large models; instead, the models can directly instruct tools to perform specific actions (Actions).
|
|
|
|
[MCP Server](https://github.com/oceanbase/mcp-oceanbase/tree/main/src/oceanbase_mcp_server) provides the capability for large models to interact with seekdb through the MCP protocol, allowing the execution of SQL statements. With the right client, you can quickly build a project prototype, and it is open-source on GitHub.
|
|
|
|
[Continue](https://continue.dev) is an IDE extension that integrates with the MCP Server, supporting Visual Studio Code and IntelliJ IDEA.
|
|
|
|
This topic will guide you on how to integrate Continue with the OceanBase MCP Server to quickly build backend applications.
|
|
|
|
## Prerequisites
|
|
|
|
* You have deployed seekdb.
|
|
|
|
* You have installed [Python 3.11 or later](https://www.python.org/downloads/) and the corresponding [pip](https://pip.pypa.io/en/stable/installation/). If your machine has a low Python version, you can use Miniconda to create a new Python 3.11 or later environment. For more information, see [Miniconda installation guide](https://docs.anaconda.com/miniconda/install/).
|
|
|
|
* Install [Git](https://git-scm.com//downloads) based on your operating system.
|
|
|
|
* Install uv, a Python package manager. After the installation, run the `uv --version` command to verify the installation:
|
|
|
|
```shell
|
|
pip install uv
|
|
uv --version
|
|
```
|
|
|
|
* Install the Continue extension in Visual Studio Code or IntelliJ IDEA. The extension name is `Continue`.
|
|
|
|

|
|
|
|
* After the installation is complete, click `Add Models` to configure the large model API for Continue. The API configuration is as follows:
|
|
|
|

|
|
|
|
* The configuration file is as follows:
|
|
|
|
```json
|
|
name: Local Assistant
|
|
version: 1.0.0
|
|
schema: v1
|
|
models:
|
|
# Model name
|
|
- name: DeepSeek-R1-671B
|
|
# Model provider
|
|
provider: deepseek
|
|
# Model type
|
|
model: DeepSeek-R1-671B
|
|
# URL address for accessing the model
|
|
apiBase: *********
|
|
# API key for accessing the model
|
|
apiKey: ********
|
|
# Context provider
|
|
context:
|
|
- provider: code
|
|
- provider: docs
|
|
- provider: diff
|
|
- provider: terminal
|
|
- provider: problems
|
|
- provider: folder
|
|
- provider: codebase
|
|
```
|
|
|
|
## Step 1: Obtain the database connection information
|
|
|
|
Contact your seekdb deployment engineer or administrator to obtain the database connection string. For example:
|
|
|
|
```sql
|
|
obclient -h$host -P$port -u$user_name -p$password -D$database_name
|
|
```
|
|
|
|
**Parameters:**
|
|
|
|
* `$host`: The IP address for connecting to seekdb.
|
|
* `$port`: The port number for connecting to seekdb. Default is `2881`.
|
|
* `$database_name`: The name of the database to access.
|
|
|
|
:::tip
|
|
The connected user must have <code>CREATE</code>, <code>INSERT</code>, <code>DROP</code>, and <code>SELECT</code> privileges on the database.
|
|
:::
|
|
|
|
* `$user_name`: The username for connecting to the database.
|
|
* `$password`: The password for the account.
|
|
|
|
## Step 2: Configure the OceanBase MCP Server
|
|
|
|
### Clone the OceanBase MCP Server repository
|
|
|
|
Run the following command to download the source code to your local device:
|
|
|
|
```shell
|
|
git clone https://github.com/oceanbase/mcp-oceanbase.git
|
|
```
|
|
|
|
Go to the source code directory:
|
|
|
|
```shell
|
|
cd mcp-oceanbase
|
|
```
|
|
|
|
### Install dependencies
|
|
|
|
Run the following command in the `mcp-oceanbase` directory to create a virtual environment and install dependencies:
|
|
|
|
```shell
|
|
uv venv
|
|
source .venv/bin/activate
|
|
uv pip install .
|
|
```
|
|
|
|
### Add and configure MCP servers
|
|
|
|
1. Click the button in the upper-right corner of the menu bar to open the MCP panel.
|
|
|
|

|
|
|
|
2. Click Add `MCP Servers`.
|
|
|
|
:::tip
|
|
MCP can be used only in the Continue Agent mode.
|
|
:::
|
|
|
|

|
|
|
|
3. Fill in the configuration file and click OK.
|
|
|
|
Replace `/path/to/your/mcp-oceanbase/src/oceanbase_mcp_server` with the absolute path of the `oceanbase_mcp_server` folder. Replace `OB_HOST`, `OB_PORT`, `OB_USER`, `OB_PASSWORD`, and `OB_DATABASE` with the corresponding information of your database:
|
|
|
|
```json
|
|
name: SeekDB
|
|
version: 0.0.1
|
|
schema: v1
|
|
mcpServers:
|
|
- name: SeekDB
|
|
command: uv
|
|
args:
|
|
- --directory
|
|
- /path/to/your/mcp-oceanbase/src/oceanbase_mcp_server
|
|
- run
|
|
- oceanbase_mcp_server
|
|
env:
|
|
OB_HOST: "****"
|
|
OB_PORT: "***"
|
|
OB_USER: "***"
|
|
OB_PASSWORD: "***"
|
|
OB_DATABASE: "***"
|
|
```
|
|
|
|
4. If the configuration is successful, the following message is displayed:
|
|
|
|

|