FAQ and troubleshooting#

Common questions and fixes for setting up and running the OneTick MCP server.

Installation and setup#

ModuleNotFoundError: No module named ‘onetick_mcp’ or onetick-mcp: command not found

The virtual environment is not active, so the system python is running. Run source .venv/bin/activate, or call .venv/bin/python directly. See Install.

Where should I run the quickstart commands from?

Run from the directory that holds your .venv, .env and document_sources. Paths such as ./document_sources are relative, and .env is read from the current directory only. See Download documentation sources.

My settings in .env are ignored.

Both the server and build_index read .env from the current working directory only. Run them from the directory that contains your .env file, otherwise the defaults are used.

The server fails to start with error parsing value for field “COLLECTIONS”.

ONETICK_DB_COLLECTIONS must be a JSON array, for example ONETICK_DB_COLLECTIONS='["python-docs","sql-docs"]', not a plain string. See Capability and data-source variables.

The server fails to start with ONETICK_DB_TOOLS names unknown tool(s).

ONETICK_DB_TOOLS takes a comma-separated list of individual tool names, such as search_python-docs,list_databases. A name that is not a valid tool stops the server at startup, and the error lists the valid names. A search tool is also rejected this way if its collection is not listed in ONETICK_DB_COLLECTIONS. See Enabling and disabling tools.

Which port does the server use?

127.0.0.1:8000 by default. Change it with KX_MCP_HOST and KX_MCP_PORT; see Server variables. Clients connect to /mcp (Streamable HTTP), not /sse.

How do I check the server is running?

Run curl -f http://localhost:8000/health (use your own port if you changed it). It prints OK once the server is up. Then connect your client and check the OneTick tools appear in its tool list. See Deployment.

Where are the logs?

The server writes to the terminal and to dated log files under ./logs. Use LOG_DIR to change the location and LOG_LEVEL to change how much is logged. See Logging.

Database#

The pgvector container image will not pull.

Check access to your container registry, or point ONETICK_DB_SQL_CONNECTION_STRING at an existing PostgreSQL 16+ instance with pgvector instead. With Podman, keep the docker.io/ prefix in the image name. See Deployment.

The index build or server fails creating the vector extension.

The error is Failed to create vector extension: ... permission denied to create extension "vector". The server and build_index create the vector extension if it is missing, which needs a database superuser. If your database role is restricted, ask a database administrator to run CREATE EXTENSION vector; once in the target database, then start again.

The database connection fails. What should I check?

The connection string is ONETICK_DB_SQL_CONNECTION_STRING, in the form postgresql+psycopg://<user>:<password>@<host>:<port>/<database>. Match the error to the cause:

  • Connection refused: nothing is listening at that host and port. Check that the database is running, the port is right, and the host is reachable from the server.

  • password authentication failed for user: the user or password does not match the database.

  • No module named 'psycopg2' or Can't load plugin: sqlalchemy.dialects:postgres: the scheme is wrong. Use postgresql+psycopg://, not postgresql:// or postgres://.

  • Could not parse SQLAlchemy URL (migrations), or ONETICK_DB_SQL_CONNECTION_STRING is not set in the startup log: the variable is missing. Add it to your .env file in the directory you run from.

If your password contains special characters, either URL-encode them or use a password without them.

Search and the index#

Search tools return nothing.

The index has not been built. A search against a collection that has not been indexed returns an empty result, not an error. See Rebuilding the search index.

Search fails with “different vector dimensions”, or results look wrong.

The server is using a different embedding model from the one the index was built with. If the two models produce different vector sizes, searches fail with different vector dimensions 384 and 768 (the numbers depend on the models). If they happen to produce the same size, searches succeed but the results are poor, with no error. Set ONETICK_DB_EMBEDDING_TYPE and ONETICK_DB_EMBEDDING_MODEL to match the index, or rebuild the index with the model you want. See Embeddings.

The server fails to start with “needs local embeddings”.

The error is EMBEDDING_TYPE='sentence_transformer' needs local embeddings. Local embeddings are an optional install. Install them with pip install "onetick-llmbase[local-embeddings]"; see Local (offline) embeddings.

The index build fails on Windows with UnicodeDecodeError (cp1252).

Markdown sources must be UTF-8. The loader reads them with an explicit UTF-8 encoding, so a non-UTF-8 Windows locale does not require PYTHONUTF8 or python -X utf8. Convert any custom Markdown saved in a legacy encoding to UTF-8. If UTF-8 documentation still fails with an error mentioning cp1252, check that you have installed the engine update containing this fix in the virtual environment used to run build_index.

Local embeddings fail on Windows with c10.dll / WinError 1114.

OneTick imported before PyTorch can trigger this DLL initialization failure. The index builder and server now preload PyTorch first when local document embeddings are enabled on Windows. Install onetick-llmbase[local-embeddings] and use matching updated engine and product packages; no manual import-order wrapper is needed. If the error persists, check whether python -c "import torch" works in the same virtual environment. If that fails too, the PyTorch installation itself needs attention. See Local (offline) embeddings.

A search tool is missing from my client’s tool list.

Check that the collection is listed in ONETICK_DB_COLLECTIONS and, if you set ONETICK_DB_TOOLS, that the tool name is listed there too. Also check the startup log for connectivity check lines: the server leaves out a tool whose prerequisites are unavailable (for example ONETICK_DB_SQL_CONNECTION_STRING is not set (required for the doc-search tools)), and stops if no tool can be served. If the missing tool is one of your own custom tools, its name must also be in ONETICK_DB_TOOLS: a custom tool file is only loaded when its name is listed, so an unlisted tool leaves no Loaded custom tool line in the log. The line that means a tool is served is Registered MCP tool: <name>; the bundled tools print Loaded custom tool even when they are left out. Restart the server after changing either setting, then reconnect your client so it reloads the tool list. See Active collections and Enabling and disabling tools.

The index build fails with an OpenAI error.

Missing credentials means OPENAI_API_KEY is not set where you ran the build; add it to your .env file. Incorrect API key provided (a 401 error) means the key is wrong or has been revoked. The same key is needed when the server runs, to embed search queries. See OpenAI-compatible server if you use your own endpoint.

The index build stopped part way through. Is the index broken?

If the build was interrupted, run it again. A build clears each collection before re-embedding it, so an interrupted collection is incomplete until a build finishes. Each run starts over for the collections you select.

I changed the embedding type or model. What do I need to do?

Restart the server and rebuild the search index. See Embeddings.

Do I need to restart the server when the reference-data CSV files change?

No. The files are read on each request. See Custom Reference Data.

Can I rebuild the index while the server is running?

Yes. You do not need to stop or restart the server. However, searches against the collections being rebuilt return empty or partial results until the rebuild finishes, so rebuild during off-peak periods. See Rebuilding the search index.

Does rebuilding the index cost money?

With OpenAI or an OpenAI-compatible hosted endpoint, yes. By default a rebuild re-embeds all collections, and every run is billed again. Use --only_collections to rebuild only the collections that changed. See Embedding costs.

OneTick data tools fail with a generic authentication error.

OTP_HTTP_ADDRESS must point at the same tenant as OTP_ACCESS_TOKEN_URL. See OneTick WebAPI authentication.

search_symbol_universe fails with FileNotFoundError after the server has run for days.

Set OTP_BASE_FOLDER_FOR_GENERATED_RESOURCE to a directory outside the operating system’s temp area. See Long-running deployments.

Restricted and offline environments#

What does my network team need to allow?

See Network requirements.

I cannot clone the documentation repositories on the server.

Clone them on a machine that has access and copy document_sources across. The search index is built from local files, and the reference-data tools read local CSV files.

How do I run with no outbound network access?

Combine these pages:

The embedding model download fails behind a proxy.

Point HF_ENDPOINT at your internal registry mirror, or use the air-gapped steps. See Local (offline) embeddings.