Troubleshoot MarkLogic MCP Server
- Last Updated: December 3, 2026
- 8 minute read
- Documentation
Follow this troubleshooting guidance to quickly isolate whether a problem is in your MCP client, MarkLogic MCP Server, or MarkLogic Retrieval API deployment.
No tools visible in the MCP client
Symptoms:
- MarkLogic MCP Server does not appear in the client.
- MarkLogic MCP Server appears, but tools are missing.
Checks:
- Confirm that the MCP URL shape is correct:
http://<host>:8088/api/v1/agent/mra-agent/session/<session-id>/mcp. - Confirm that MarkLogic MCP Server is running by using
docker compose psin the directory containing your docker-compose.yaml file. - If you have edited your MCP client configuration, then reload or restart the MCP client.
- List tools. For example, in VS Code Copilot, type
#in the chat input. - Verify MarkLogic MCP Server registration with your client’s MCP server listing UI/command.
Authentication failures
Symptoms:
- 401 responses
- OAuth redirects not completing
- "invalid token" / "authorization required"
For the expected header format for each authentication mode, see Authorization header behavior.
Basic or digest mode
Confirm
auth_methodis set tobasicordigestunder workflowcontextblocks inconfig.yaml.Confirm your MCP client sends:
Authorization: Bearer <base64(username:password)>
Re-generate the token if credentials changed:
echo -n "username:password" | base64
OAuth mode
- Confirm
auth_methodis set tooauthunder workflowcontextblocks. - Confirm
mcp_auth.enabledistrueinconfig.yaml. - Remove the static Authorization header from the client configuration.
- Confirm that
authorization_serverinconfig.yamlis reachable from the MCP client environment. - In VS Code dynamic registration, use the MCP client ID configured in your IdP provider. See your IdP administrator for more information.
- If VS Code appears stuck on old credentials, then clear old dynamic providers:
- Open Command Palette and run Authentication: Remove Dynamic Authentication Providers.
- Remove entries for your MCP host, then retry.
- Retry a tool call to trigger login flow.
OAuth symptom
When connecting the MCP client, the OAuth login popup fails with an error related to redirect_uri. The authorization URL typically includes a callback such as https://example.com/sn/oauthcallback or https://vscode.dev/redirect.
Cause:
Many IdPs permit only redirect URIs explicitly configured for the OAuth client. If the MCP client's callback URL is not configured as an allowed redirect URI for the OAuth client, then the IdP rejects the authorization request.
Resolution:
Add the MCP client callback URL to the list of valid redirectUris in your IdP.
Connection failures
Symptoms:
- "connection refused".
- Timeouts.
- MCP client can reach MarkLogic MCP Server, but MarkLogic MCP Server cannot reach MarkLogic Server.
Checks:
Confirm that the MarkLogic MCP Server endpoint is reachable:
curl -i http://localhost:8088/Confirm that the MarkLogic REST app server endpoint is reachable directly:
curl --anyauth -u admin:admin http://localhost:8003/v1/retrieve/definitionIf MarkLogic MCP Server runs in Docker and MarkLogic Server runs on host, then check
marklogic_urlinconfig.yaml:marklogic_url: http://host.docker.internal:<port>
Ensure host and port values match what your MarkLogic REST app server actually uses.
Is MRA deployed and responding?
Before debugging MCP behavior, verify MRA itself:
curl --anyauth -u <user>:<password> http://<host>:<port>/v1/retrieve/definition
If this fails, then fix deployment first:
SQL tool issues
This table lists problems that can occur when you use RetrieveSQLMetadata and RetrieveSQLResult, with their causes and actions:
| Symptom | Cause | Action |
|---|---|---|
|
The query is invalid or unsupported. |
Verify column names with |
The query is not a single read-only statement. |
Submit one |
|
|
Two selected columns have the same name. |
Add |
|
The MCP client did not send an authorization header. |
Verify the MCP client workflow |
MarkLogic Server credentials are missing or invalid. |
Verify the MarkLogic Server credentials. |
|
|
The user does not have the |
|
|
MRA is not deployed. |
|
The user does not have the |
||
|
The request uses an unsupported HTTP method. |
Use |
|
The request uses an unsupported HTTP method. |
Use |
|
An unexpected MarkLogic Server server-side failure occurred. |
|
Either SQL tool shows only an HTTP status but no detailed message. |
Requests through the SQL tools can return the HTTP status without the |
Send the same request directly to the SQL endpoint to see the detailed validation or authorization message. |
Either SQL tool returns unexpected results:
|
The user's roles limit the schemas, views, and documents that the user can see. |
Confirm the user's roles and document permissions. |
The required TDE views are not deployed. |
Confirm that the TDE views exist on MarkLogic Server and are queryable. |
|
The query column name does not exactly match the column name from the metadata. |
Use the exact column names from the metadata. |
|
The user role changed after the metadata was cached. |
|
|
The TDE view changed after the metadata was cached. |
||
|
The result reached the row limit:
|
Raise the row limit by setting |
|
The result reached the row limit:
|
|
A permission change does not appear in |
The user role changed after the metadata was cached. |
|
A new or changed TDE view does not appear in |
The TDE view changed after the metadata was cached. |
|
For example, to check the SQL Metadata endpoint directly, bypassing MarkLogic MCP Server, run this command:
curl --anyauth -u <user>:<password> http://<host>:<port>/v1/retrieve/sql/metadata
SPARQL tool issues
This table lists problems that can occur when you use RetrieveSparqlMetadata and RetrieveSparqlResult, with their causes and actions:
| Symptom | Cause | Action |
|---|---|---|
|
The request is invalid. |
|
The query is malformed or unsupported. |
|
|
|
The MCP request is missing valid authentication. |
|
MarkLogic Server credentials are missing or invalid. |
Verify the MarkLogic Server credentials. |
|
|
The user does not have the |
|
The user does not have the |
Verify that the user's roles grant the |
|
|
MRA is not deployed. |
|
The user cannot access an endpoint module. |
||
|
The request uses an unsupported HTTP method. |
Use |
|
The request uses an unsupported HTTP method. |
Use |
|
An unexpected MarkLogic Server server-side failure occurred. |
|
|
MarkLogic Server recognized a MarkLogic REST app server execution timeout or cancellation. |
|
Expected entries are missing from
|
The user cannot access those entries. |
Verify the user's access. |
Permissions changed after the metadata was cached. |
|
|
Metadata changed after the metadata was cached. |
||
|
A metadata list reached its
|
Raise the row limit by setting |
|
The
|
|
An |
This is the expected response shape for an |
Read the boolean value in the |
A permission change does not appear in |
The user role changed after the metadata was cached. |
|
To inspect an endpoint's detailed error response directly, call the SPARQL metadata endpoint or submit the same query to the SPARQL endpoint.
For example, to check the SPARQL endpoint directly, bypassing MarkLogic MCP Server, run this command:
curl --anyauth -u <user>:<password> -H "Content-Type: application/json" -X POST http://<host>:<port>/v1/retrieve/sparql -d '{"query":"SELECT (1 AS ?one) WHERE {}"}'
Check MarkLogic Server logs
If endpoint checks fail or return unexpected MarkLogic Server errors, then inspect MarkLogic Server logs directly.
If MarkLogic Server is running in Docker
Run this command from the directory containing the docker-compose.yaml that defines your MarkLogic Server container, substituting the service name used in that file for marklogic:
docker compose logs marklogic
Use -f to follow logs while reproducing a failing request:
docker compose logs -f marklogic
Note: The docker-compose.yaml supplied in examples/marklogic-mcp defines only the MarkLogic MCP Server container, not MarkLogic Server. If you started MarkLogic Server separately, then use docker logs <container-name> instead.
If MarkLogic Server is running outside Docker
Check the MarkLogic Server Logs directory (default: /var/opt/MarkLogic/Logs/) and inspect:
ErrorLog.txt(MarkLogic Server/runtime errors)- Error/access logs for your MarkLogic REST app server (for request-level failures)
What to look for
- Authentication or authorization failures.
- Rewriter or endpoint module load errors.
- JavaScript or XQuery runtime exceptions from endpoint code.
- Host, port, or TLS connection failures when calling dependent services.
Fast isolation decision tree
- If the MCP client cannot discover MarkLogic MCP Server tools, then troubleshoot client registration, MCP URL, and MarkLogic MCP Server startup first.
- If tools are visible but calls fail with authentication errors, then troubleshoot authentication mode and headers or tokens.
- If authentication is configured correctly but tool calls still fail, then verify MRA endpoint health with direct
curl.