Couchbase Query Assistant
STDIOMCP server implementing natural language queries on Couchbase Capella clusters.
MCP server implementing natural language queries on Couchbase Capella clusters.
The Model Context Protocol (MCP) is a protocol for handling interactions between large language models (LLMs) and external systems. This repository implements a Couchbase MCP Server using the Couchbase Node.js SDK, enabling MCP clients (e.g., Claude Desktop) to perform natural language queries on Couchbase Capella clusters.
With this server you can use commands like:
Show me the results of SELECT * FROM my_bucket LIMIT 10
Execute this query: SELECT name, age FROM users WHERE active = true
Get me the latest 5 documents from my_bucket
Summarize the latest 5 orders from the orders bucket for me
The following screenshot shows the MCP server in action with the Claude Desktop client. The user issues a general request in plain English and the MCP server translates it into a SQL++ query that is executed against the Couchbase Capella cluster. The results are then returned to the user in a readable format.
git clone [email protected]:hummusonrails/couchbase-mcp-server.git cd couchbase-mcp-server npm install
.env
file in the root directory and add your Couchbase connection string, username, and password:COUCHBASE_CONNECTION_STRING=couchbases://your-cluster.cloud.couchbase.com COUCHBASE_USERNAME=your_username COUCHBASE_PASSWORD=your_password
Refer to the .env.sample
file for the required environment variables.
npm run build
npx couchbase-mcp-server
[!NOTE] The MCP server uses the StdioServerTransport, so it communicates over standard input/output. Ensure that your MCP client (e.g., Claude Desktop) is configured to use a local MCP server. Follow the Claude Desktop documentation to set up the MCP client to connect to the local server.
query-couchbase
To work on the project locally:
npm install npm run build
Launch your MCP client (e.g., Claude Desktop) configured to connect and invoke the tool using a sample query.
All logging messages are sent to stderr
to ensure that stdout
only contains MCP protocol JSON. Check your logs for detailed connection and error messages.
Contributions are welcome! Please feel free to submit a pull request or open an issue with your suggestions. For any changes, ensure you follow the project’s code style.
This project is licensed under the MIT License. See the LICENSE file for details.