Troubleshooting
- reference
Common issues and fixes for the Couchbase MCP Server, covering connections, transport, OAuth, and logging.
Common issues that you might run into while using the Couchbase MCP Server and their solutions.
uv/uvx Issues
If you see errors related to uv or uvx, check the following:
-
uvxnot found: Verify thatuvis on your system PATH. Install uv following the official instructions. If installed via a package manager, verify it’s on your PATH. -
Run
which uv(macOS/Linux) orwhere uv(Windows) to find the path. You may need to provide the absolute path touv/uvxin thecommandfield of your MCP client configuration. -
After updating source code, run
uv syncto update dependencies. This is only required when running from source after pulling new changes.
Connection Issues
If you see errors related to connecting to the Operational Insights cluster, check the following:
-
Check credentials: Verify that your connection string, username, password, or certificate paths are correct.
-
Cluster accessibility: Verify that the Operational Insights cluster is accessible from the machine running the MCP server.
-
Database permissions: Check that the Operational Insights user has proper permissions to access at least one database.
-
Connection string format: Use
https://for TLS-enabled clusters,http://for unencrypted local connections. -
Certificates for TLS: If you’re connecting with TLS enabled, verify that you’ve configured the certificate correctly via
CB_OPERATIONAL_INSIGHTS_CA_CERT_PATH.
Transport Mode Issues
If the MCP client is unable to communicate with the server, check the following based on your configured transport mode:
-
stdio: Verify that you’ve configured the MCP client to launch the server as a subprocess. Check the client’s server configuration for the correct command and arguments to start the server.
-
HTTP: Check that the configured port is not in use. Verify that the URL ends with
/mcp. Also check if the client configuration is set correctly. -
Port conflicts: If the default port 8001 is in use, set a different port with
CB_MCP_PORTor--port. -
Host binding: By default, the server binds to
127.0.0.1(localhost only). To allow external connections, setCB_MCP_HOST=0.0.0.0or--host.
Large Result Issues
If a query result is cut short, or your client handles a large result in an unexpected way, review the following:
-
The response has
truncated: true: The result is larger thanCB_MCP_OPERATIONAL_INSIGHTS_QUERY_RESULT_MAX_SIZE. The remaining rows are not available by calling the tool again. Narrow the statement, raise the limit up to 4 MB, or export the result with thecopy_to_*arguments. -
The message says the result is not empty: The limit is smaller than the first row. The tool returns no rows, but matching rows exist. Raise the limit, or select fewer fields.
-
An export is blocked:
COPY … TOis blocked in read-only mode and for a token without the write scope. SetCB_MCP_READ_ONLY_MODE=falseand use a token withcouchbase-mcp:write. -
An export is rejected: Set
copy_to_link,copy_to_bucket, andcopy_to_pathtogether. The link must already exist.copy_to_formatacceptsjsonorparquet.
See Large Result Handling for the full details.
Async Query Issues
The async query tools keep each query handle in the memory of one server process. For how the tools work together, see Query and Index.
| Symptom | What to do |
|---|---|
|
|
A fetch of the results fails with a timeout |
The query finished on the cluster, so raise |
A handle works on some calls and stops working on others, with more than one server behind a load balancer |
Each server keeps its own handles. Configure the load balancer to send all requests for one handle to the same server. |
Read-Only Mode Issues
If you’re trying to perform write operations but they’re not working as expected, check the following:
-
Check whether
CB_MCP_READ_ONLY_MODE=true(the default). -
When
CB_MCP_READ_ONLY_MODE=true,operational_insights_create_indexis not loaded, and SQL++ queries run with the server-sidereadonlyoption (so the cluster itself rejects data and structure modifications).COPY … TO(export) statements are also blocked client-side. SetCB_MCP_READ_ONLY_MODE=falseto allow write operations. -
See Read-Only Mode for the full behavior reference.
Tool Disabling Issues
If a tool you expect to be disabled is still executing, check the following:
-
Verify that you’ve spelled tool names exactly as listed in the Tools reference.
-
If using a file path for
CB_MCP_DISABLED_TOOLS, verify that the file exists and the server process can read it. If using Docker, verify that the file is included in the container and the path is correct. -
Remember that disabling tools alone does not prevent operations - RBAC is the authoritative security control. See Security.
Elicitation/Tools Requiring Confirmation
If the tool you expect to require confirmation is executing without it, check the following:
-
Verify that the MCP client supports Elicitation. If the client does not support it, the server executes the tools without requiring confirmation.
-
Verify that you’ve spelled tool names exactly as listed in the Tools reference.
-
The server fails to start with confirmation-required tools: Elicitation cannot work in stateless mode, which has no session for the prompt. The server refuses to start when you combine
--confirmation-required-toolswith--stateless-http. Turn off stateless mode, or remove the confirmation requirement. -
If using a file path for
CB_MCP_CONFIRMATION_REQUIRED_TOOLS, verify that the file exists and the server process can read it. If using Docker, verify that the file is included in the container and the path is correct.
Environment Variable Issues
If you’re setting environment variables but they do not seem to be taking effect, check the following:
-
Variables not taking effect: Verify that you’ve set variables in the
envblock of your MCP client configuration, not as system environment variables (unless your client supports that). -
CLI vs environment variable conflicts: Command line arguments take priority over environment variables. If a setting is not behaving as expected, check if it’s being overridden by a CLI argument.
-
See Environment Variables for the full reference.
OAuth Issues
OAuth applies only to the Streamable HTTP transport — it’s ignored on stdio. For the full configuration reference, see OAuth.
Quick first-pass diagnosis
Before digging in, confirm these five things — a surprising number of OAuth issues are resolved here:
| # | Check | Expected | |
|---|---|---|---|
1 |
What transport is the server on? |
Streamable HTTP ( |
|
2 |
What does the startup log say about OAuth? |
One of |
|
3 |
Does the PRM endpoint respond? |
|
|
4 |
Does an unauthenticated tool call return 401? |
A |
|
5 |
Decode a sample token and confirm |
Values match what the server expects |
Server startup
| Symptom | Meaning | Fix | |
|---|---|---|---|
|
You set some but not all of the required JWT settings. |
OAuth is all-or-nothing: set all of |
|
|
You enabled PRM ( |
With PRM, the issuer is published as the authorization-server URL and must be a valid |
|
Log: |
The server is running with no OAuth — all requests are accepted unauthenticated. |
You passed none of the OAuth settings (a dropped shell line-continuation |
|
Log: |
OAuth flags were detected but the server started on |
Add |
|
Log: |
You asked for PRM but configured no token verifier. |
Set the JWT settings. PRM is meaningless without a verifier — it advertises an authorization server but validates nothing. |
|
|
PRM is not mounted. |
PRM is published only when |
401 Unauthorized — token validation
Returned by the auth middleware before any tool runs. The log shows Auth error returned: invalid_token (status=401). Decode the token and compare it against your server config.
| Symptom | Meaning | Fix | |
|---|---|---|---|
|
Token’s |
Decode a sample token, copy the |
|
|
Token’s |
Decode a token, copy |
|
|
The |
Mint a fresh token. If you suspect clock skew, run NTP on the server host — the server applies no leeway by default. |
403 Forbidden — scope enforcement
Returned after JWT validation succeeds. The message names the required and missing scopes.
| Symptom | Meaning | Fix | |
|---|---|---|---|
|
The token does not carry the required scope. |
Decode the token and check both the |
|
|
This is the only OI tool classified as a write tool. Every other OI tool, including |
Mint a token carrying |
|
|
Read-only mode is on, so the server does not load this tool when |
Set |
Couchbase-layer errors (after OAuth succeeds)
These appear after the JWT validated and the scope check passed — they come from the Operational Insights cluster itself or its RBAC, not the OAuth layer.
| Symptom | Meaning | Fix | |
|---|---|---|---|
Authentication fails against the Operational Insights cluster |
|
Verify the credentials directly against the Operational Insights cluster. Check the connection scheme ( |
|
Server fails to start with a connection configuration error |
The server started without complete Operational Insights connection settings. |
Set |
|
Reads succeed but writes fail |
The Operational Insights user lacks RBAC write permission on the target database. |
RBAC is the ultimate authority — even a valid |
Logging Issues
The MCP server’s own logging is configured at startup through environment variables or CLI flags — see Logging for the full configuration reference.
Every start emits one INFO boot summary line reporting the resolved configuration: the level in effect, which sinks are live, and the exact file paths being written.
For example:
2026-06-29T18:08:49+0530 - couchbase - INFO - Logging configured: level=INFO, sinks=stderr,file, log_files={'INFO': 'mcp_server_operational_insights.info.log', 'WARNING': 'mcp_server_operational_insights.warning.log', 'ERROR': 'mcp_server_operational_insights.error.log'}, max_bytes=1048576
When logging behaves unexpectedly, read this line first — then work through the following table.
| Symptom | Likely cause | Fix | |
|---|---|---|---|
No log files anywhere |
The |
Set |
|
Files exist but one stays empty |
Each level’s file is filtered to exactly its level, so an idle server may legitimately have an empty |
This is expected. The |
|
A per-level file I expected is missing (for example, no |
That level is below the configured threshold — a file is created only for levels at or above |
Lower the level to include it: |
|
Server logged "File logging is disabled…" warning |
The |
Expected when running |
|
I set a log level and nothing changed |
An invalid level value silently fell back to |
Check the boot output for |
|
A sink I configured is being ignored |
An unrecognized |
Look for |
|
I set a rotation size to |
|
The server logs a warning and falls back to the 1 MB default. You can’t disable rotation this way. To control disk usage, adjust |
|
Startup warning: |
You’re using the deprecated byte-based size variable. |
Switch to |
|
|
|
Set |
|
An |
Stack traces are emitted at |
Re-run at |
|
No logs at all from the server |
Either |
Confirm the boot line appears. For stdio clients, see the Checking Logs section later in this page for client log locations. |
|
|
The |
This file captures resolved environment/system info. It’s written only when the |
Checking Logs
To configure the MCP server’s own logs — log level, console/file output, and file logging for support — see Logging.
The MCP client also keeps its own logs. Check the MCP client logs for errors or warnings:
| Client | Log Location | |
|---|---|---|
Claude Desktop |
|
|
Cursor |
Bottom panel > Output > "Cursor MCP" |
|
Windsurf |
Check Windsurf output panel |
|
VS Code |
Command Palette > "MCP: List Servers" > Show Output |
|
JetBrains |
|
|
Factory |
|