You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -54,7 +55,7 @@ Before installing and running the KDB-X MCP Server, ensure you have met the foll
54
55
-[Cloned this repo](#clone-the-repository)
55
56
- A `KDB-X/KDB+` Service listening on a host and port that will be accessible to the MCP Server
56
57
- See examples - [KDB-X Setup](#kdb-x-setup) / [KDB+ Setup](#kdb-setup)
57
-
- KDB-X can be installed by signing up to the [kdb-x public preview](https://kdb-x.kx.com/sign-in) - see [KDB-X documentation](https://docs.kx.com/public-preview/kdb-x/home.htm) for supporting information
58
+
- KDB-X can be installed by signing up to the [KDB-X public preview](https://kdb-x.kx.com/sign-in) - see [KDB-X documentation](https://docs.kx.com/public-preview/kdb-x/home.htm) for supporting information
58
59
- Windows users can run the KDB-X MCP Server on Windows and connect to a local KDB-X database via WSL or remote KDB-X database running on Linux
59
60
- Windows users can run a local KDB-X database by installing KDB-X on [WSL](https://learn.microsoft.com/en-us/windows/wsl/install), and use the default [streamable-http transport](#transport-options) when running the [KDB-X MCP Server](#run-the-server) - both share the same localhost network.
60
61
- For details on KDB-X usage restrictions see [documentation](https://docs.kx.com/product/licensing/usage-restrictions.htm#kdb-x-personal-trial-download)
Before starting the KDB-X MCP Server, you must configure embedding models for your tables if you wish to use Similarity Search.
253
+
The repository includes two ready-to-use embedding providers: OpenAI and SentenceTransformers.
254
+
You can customize these implementations as needed, or add your own provider by following the steps outlined below.
255
+
256
+
1. Update Dependencies - Add your required embedding providers to `pyproject.toml` dependencies section.
257
+
258
+
2. Set Environment Variables - Configure required API keys for your chosen embedding providers if necessary (for example, set the environment variable `OPENAI_API_KEY` to use OpenAI's API)
259
+
260
+
3. Add New Provider - The file `src/mcp_server/utils/embeddings.py` defines the base class `EmbeddingProvider` for all embedding providers.
261
+
To add a new provider, create a class in the same file that extends this base class and implements all required abstract methods.
262
+
You can use the existing implementations of OpenAI and SentenceTransformers in the same file as templates — simply copy and modify them to suit your needs. To register your provider, use the `@register_provider` decorator above your class definition. It is not compulsory for the registered provider name to follow the provider's Python package name.
263
+
264
+
4. Configure Table Embeddings - Update the embeddings configuration file at `src/mcp_server/utils/embeddings.csv` with your actual database and table names, embedding providers and models. The name you provide at `embeddings.csv` should match the registered provider name specified in file `embeddings.py`.
265
+
249
266
## Usage with Claude Desktop
250
267
251
268
### Configure Claude Desktop
@@ -302,7 +319,8 @@ If you have pre-existing MCP servers see [example config with multiple mcp-serve
302
319
"--directory",
303
320
"/path/to/this/repo/",
304
321
"run",
305
-
"mcp_server"
322
+
"mcp-server",
323
+
"--stdio"
306
324
]
307
325
}
308
326
}
@@ -311,7 +329,7 @@ If you have pre-existing MCP servers see [example config with multiple mcp-serve
311
329
312
330
**Note**
313
331
314
-
- Update your `<user>` to point to the absolute path of the uv executable - only required if `uv` is on your path
332
+
- Update your `<user>` to point to the absolute path of the uv executable - only required if `uv` is not on your path
315
333
- Update the `--directory` path to the absolute path of this repo
316
334
- Currently `KDB-X` does not support Windows, meaning `stdio` is not an option for Windows users
317
335
- Claude Desktop is responsible for starting/stopping the MCP server when using `stdio`
| kdbx_table_analysis | Generate a detailed analysis prompt for a specific table. | table_name: Name of the table to analyze<br> analysis_type (optional): Type of analysis options statistical, data_quality<br> sample_size (optional): Suggested sample size for data exploration | The generated table analysis prompt |
393
+
| kdbx_table_analysis | Generate a detailed analysis prompt for a specific table. |`table_name`: Name of the table to analyze<br> `analysis_type` (optional): Type of analysis options statistical, data_quality<br> `sample_size` (optional): Suggested sample size for data exploration | The generated table analysis prompt |
| kdbx_run_sql_query | Execute SQL SELECT against KDB-X database | query (str): SQL SELECT query string to execute | JSON object with query results (max 1000 rows) |
406
+
| kdbx_run_sql_query | Execute SQL SELECT against KDB-X database |`query`: SQL SELECT query string to execute | JSON object with query results (max 1000 rows) |
407
+
| kdbx_similarity_search | Perform vector similarity search on a KDB-X table |`table_name`: Name of the table to search <br> `query`: Text query to convert to vector and search <br> `n` (optional): Number of results to return | Dictionary containing search result |
389
408
390
409
## Development
391
410
@@ -441,7 +460,7 @@ If the MCP Server port is being used by another process you will need to specify
self.logger.error("KDB-X SQL interface check: FAILED - KDB-X service does not have the SQL interface loaded. Load it by running .s.init[] in your KDB-X Session")
113
113
sys.exit(1)
114
+
ifnotconn('@[{2< count .ai};(::);{0b}]').py():
115
+
self.logger.error("KDB-X AI Libs check: FAILED - KDB-X service does not have the AI Libs loaded. Load it by running \l ai-libs/init.q in your KDB-X Session")
116
+
sys.exit(1)
114
117
else:
115
118
self.logger.info("KDB-X SQL interface check: SUCCESS - SQL interface is loaded")
0 commit comments