timebase-mcp 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,417 @@
1
+ Metadata-Version: 2.3
2
+ Name: timebase-mcp
3
+ Version: 0.1.1
4
+ Summary: Model Context Protocol (MCP) server for TimeBase
5
+ Requires-Dist: mcp[cli]>=1.27.1,<1.28.0
6
+ Requires-Dist: pydantic>=2.13.3,<2.14.0
7
+ Requires-Dist: pydantic-settings>=2.14.0,<2.15.0
8
+ Requires-Dist: dxapi===5.5.72 ; extra == 'all'
9
+ Requires-Dist: dxapi-ce===6.2.1 ; extra == 'all'
10
+ Requires-Dist: dxapi-ce===6.2.1 ; extra == 'community'
11
+ Requires-Dist: dxapi===5.5.72 ; extra == 'enterprise'
12
+ Requires-Python: >=3.10, <3.15
13
+ Provides-Extra: all
14
+ Provides-Extra: community
15
+ Provides-Extra: enterprise
16
+ Description-Content-Type: text/markdown
17
+
18
+ # TimeBase MCP
19
+
20
+ ## Prerequisites
21
+
22
+ - Python `>=3.10`
23
+ - One of the following:
24
+ - [pip](https://pip.pypa.io/en/stable/installation/)
25
+ - [uv](https://docs.astral.sh/uv/getting-started/installation/)
26
+ - [pipx](https://pipx.pypa.io/stable/how-to/install-pipx/)
27
+
28
+ ## Installation
29
+
30
+ > [!TIP]
31
+ > If you're planning to work with both TimeBase Community and Enterprise servers, you can install both editions by replacing `[community]` or `[enterprise]` with `[all]` in the commands below.
32
+ > MCP server will automatically select the correct edition to use based on the connected TimeBase server.
33
+ >
34
+ > Already installed? See [Updating an Existing Installation](#updating-an-existing-installation).
35
+
36
+ ### Using pip
37
+
38
+ Community edition:
39
+
40
+ ```bash
41
+ python -m pip install --extra-index-url "https://<user>:<password>@nexus.deltixhub.com/repository/epm-rtc-python/simple" "timebase-mcp[community]"
42
+ ```
43
+
44
+ Enterprise edition:
45
+
46
+ ```bash
47
+ python -m pip install --extra-index-url "https://<user>:<password>@nexus.deltixhub.com/repository/epm-rtc-python/simple" "timebase-mcp[enterprise]"
48
+ ```
49
+
50
+ If you get an error about environment being managed externally, follow the [uv](#using-uv) or [pipx](#using-pipx) instructions instead.
51
+
52
+ > [!WARNING]
53
+ > Do NOT create a virtual environment manually when using pip, as MCP server needs to be globally accessible in PATH. If you want to isolate dependencies, use [pipx](#using-pipx) or [uv](#using-uv) which handle this automatically.
54
+
55
+ ### Using uv
56
+
57
+ Community edition:
58
+
59
+ ```bash
60
+ uv tool install -p 3.14 --index "https://<user>:<password>@nexus.deltixhub.com/repository/epm-rtc-python/simple" --from "timebase-mcp[community]" timebase-mcp
61
+ ```
62
+
63
+ Enterprise edition:
64
+
65
+ ```bash
66
+ uv tool install -p 3.14 --index "https://<user>:<password>@nexus.deltixhub.com/repository/epm-rtc-python/simple" --from "timebase-mcp[enterprise]" timebase-mcp
67
+ ```
68
+
69
+ ### Using pipx
70
+
71
+ Community edition:
72
+
73
+ ```bash
74
+ pipx install --python 3.14 --pip-args "--extra-index-url https://<user>:<password>@nexus.deltixhub.com/repository/epm-rtc-python/simple" "timebase-mcp[community]"
75
+ ```
76
+
77
+ Enterprise edition:
78
+
79
+ ```bash
80
+ pipx install --python 3.14 --pip-args "--extra-index-url https://<user>:<password>@nexus.deltixhub.com/repository/epm-rtc-python/simple" "timebase-mcp[enterprise]"
81
+ ```
82
+
83
+ > [!NOTE]
84
+ > MCP server will be launched from MCP client (coding agent) automatically, but the installed `timebase-mcp` must be in PATH.
85
+ > After installation you can verify that the server is correctly installed and accessible by running the following command from a new terminal:
86
+ >
87
+ > ```bash
88
+ > timebase-mcp -v
89
+ > ```
90
+
91
+ ## Updating an Existing Installation
92
+
93
+ Use the command for your package manager to update `timebase-mcp` to the latest available version.
94
+
95
+ ### Using pip
96
+
97
+ Community edition:
98
+
99
+ ```bash
100
+ python -m pip install --upgrade --extra-index-url "https://<user>:<password>@nexus.deltixhub.com/repository/epm-rtc-python/simple" "timebase-mcp[community]"
101
+ ```
102
+
103
+ Enterprise edition:
104
+
105
+ ```bash
106
+ python -m pip install --upgrade --extra-index-url "https://<user>:<password>@nexus.deltixhub.com/repository/epm-rtc-python/simple" "timebase-mcp[enterprise]"
107
+ ```
108
+
109
+ ### Using uv
110
+
111
+ ```bash
112
+ uv tool upgrade -p 3.14 --index "https://<user>:<password>@nexus.deltixhub.com/repository/epm-rtc-python/simple" timebase-mcp
113
+ ```
114
+
115
+ ### Using pipx
116
+
117
+ ```bash
118
+ pipx upgrade --python 3.14 --pip-args "--extra-index-url https://<user>:<password>@nexus.deltixhub.com/repository/epm-rtc-python/simple" "timebase-mcp"
119
+ ```
120
+
121
+ After updating, run `timebase-mcp -v` from a new terminal to verify the installed version and PATH access.
122
+
123
+ ## Basic Configuration
124
+
125
+ For no-auth and basic-auth setups, use these variables in your MCP config:
126
+
127
+ | Variable | Default value | Description |
128
+ | - | - | - |
129
+ | `TIMEBASE_URL` | `dxtick://localhost:8011` | TimeBase connection URL |
130
+ | `TIMEBASE_USERNAME` | None | Username for basic auth |
131
+ | `TIMEBASE_PASSWORD` | None | Password for basic auth |
132
+
133
+ If your server does not require authentication, set only `TIMEBASE_URL`.
134
+
135
+ For more options, including OAuth2, see [Advanced Configuration](#advanced-configuration).
136
+
137
+ ## MCP Client Configuration
138
+
139
+ Follow the instructions for your MCP client to configure the server.
140
+
141
+ <details>
142
+ <summary>VS Code</summary>
143
+
144
+ Create `.vscode/mcp.json`:
145
+
146
+ ```json
147
+ {
148
+ "servers": {
149
+ "timebase-mcp": {
150
+ "type": "stdio",
151
+ "command": "timebase-mcp",
152
+ "args": [],
153
+ "env": {
154
+ "TIMEBASE_URL": "dxtick://localhost:8011"
155
+ }
156
+ }
157
+ }
158
+ }
159
+ ```
160
+
161
+ </details>
162
+
163
+ <details>
164
+ <summary>Cursor</summary>
165
+
166
+ #### Click the button to install
167
+
168
+ [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=timebase-mcp&config=eyJ0eXBlIjoic3RkaW8iLCJlbnYiOnsiVElNRUJBU0VfVVJMIjoiZHh0aWNrOi8vbG9jYWxob3N0OjgwMTEifSwiY29tbWFuZCI6InRpbWViYXNlLW1jcCAifQ%3D%3D)
169
+
170
+ #### Or manually create `.cursor/mcp.json`
171
+
172
+ ```json
173
+ {
174
+ "mcpServers": {
175
+ "timebase-mcp": {
176
+ "type": "stdio",
177
+ "command": "timebase-mcp",
178
+ "args": [],
179
+ "env": {
180
+ "TIMEBASE_URL": "dxtick://localhost:8011"
181
+ }
182
+ }
183
+ }
184
+ }
185
+ ```
186
+
187
+ </details>
188
+
189
+ <details>
190
+ <summary>Claude Desktop</summary>
191
+
192
+ Available options: Claude Desktop config and MCP Bundle.
193
+
194
+ #### MCP Config
195
+
196
+ Follow the [official guide](https://modelcontextprotocol.io/docs/develop/connect-local-servers#installing-the-filesystem-server) for your OS, for the configuration use the following:
197
+
198
+ ```json
199
+ {
200
+ "mcpServers": {
201
+ "timebase-mcp": {
202
+ "command": "timebase-mcp",
203
+ "args": [],
204
+ "env": {
205
+ "TIMEBASE_URL": "dxtick://localhost:8011"
206
+ }
207
+ }
208
+ }
209
+ }
210
+ ```
211
+
212
+ #### MCP Bundle
213
+
214
+ This currently requires [Node.js](https://nodejs.org/en/download) and [uv](https://docs.astral.sh/uv/getting-started/installation/) to be installed.
215
+
216
+ 1. Run the following command in this repo to create the bundle:
217
+
218
+ ```bash
219
+ npx @anthropic-ai/mcpb pack
220
+ ```
221
+
222
+ 2. In Claude Desktop go to `Settings > Extensions > Advanced settings > Install extension` and select the `.mcpb` file generated in step 1.
223
+
224
+ </details>
225
+
226
+ <details>
227
+ <summary>Claude Code</summary>
228
+
229
+ ```
230
+ claude mcp add timebase-mcp --transport stdio --env TIMEBASE_URL='dxtick://localhost:8011' -- timebase-mcp
231
+ ```
232
+
233
+ > [!NOTE]
234
+ > This command adds a local-scoped server (current project and user only). There're also `project` and `user` scopes, specify them via a `--scope local|project|user` flag.
235
+ > Check out the [official documentation](https://code.claude.com/docs/en/mcp#mcp-installation-scopes) for more details.
236
+
237
+ </details>
238
+
239
+ <details>
240
+ <summary>Opencode</summary>
241
+
242
+ Add the following to your `opencode.jsonc`:
243
+
244
+ ```json
245
+ {
246
+ "$schema": "https://opencode.ai/config.json",
247
+ "mcp": {
248
+ "timebase-mcp": {
249
+ "type": "local",
250
+ "command": "timebase-mcp",
251
+ "enabled": true,
252
+ "environment": {
253
+ "TIMEBASE_URL": "dxtick://localhost:8011",
254
+ },
255
+ },
256
+ },
257
+ }
258
+ ```
259
+
260
+ </details>
261
+
262
+ ## Advanced Configuration
263
+
264
+ Use these variables for configuring the MCP server:
265
+
266
+ | Variable | Default value | Description |
267
+ | - | - | - |
268
+ | `TIMEBASE_URL` | `dxtick://localhost:8011` | TimeBase connection URL |
269
+ | `TIMEBASE_USERNAME` | None | Username for basic auth. Optional for OAuth2; when omitted, defaults to `TIMEBASE_OAUTH2_CLIENT_ID` |
270
+ | `TIMEBASE_PASSWORD` | None | Password for basic auth. Mutually exclusive with the OAuth2 settings |
271
+ | `TIMEBASE_OAUTH2_TOKEN_URL` | None | OAuth2 token endpoint for auth using the client credentials flow |
272
+ | `TIMEBASE_OAUTH2_CLIENT_ID` | None | OAuth2 client ID |
273
+ | `TIMEBASE_OAUTH2_CLIENT_SECRET` | None | OAuth2 client secret |
274
+ | `TIMEBASE_OAUTH2_SCOPE` | None | Optional space-delimited OAuth2 scopes |
275
+ | `TIMEBASE_OAUTH2_TOKEN_PARAMS` | None | Optional JSON object of extra OAuth2 token form parameters |
276
+ | `MCP_LOG_LEVEL` | `INFO` | Log verbosity: `DEBUG`, `INFO`, `WARNING`, `ERROR`, or `CRITICAL` |
277
+
278
+ > [!IMPORTANT]
279
+ > Enterprise connections may need extra SSL environment variables that are handled by `dxapi`. This includes `DXAPI_SSL_TERMINATION`, `DXAPI_SSL_TRUST_ALL`, `SSL_CERT_FILE`, etc.
280
+ > See [dxapi environment variables](https://kb.timebase.info/docs/development/clients/python%20dxapi/python_dxapi_configuration#environment-variables) and [SSL configuration](https://kb.timebase.info/docs/development/clients/python%20dxapi/python_dxapi_configuration#ssl-configuration).
281
+
282
+ ### OAuth2 Client Credentials
283
+
284
+ OAuth2 works only with the enterprise `dxapi` client. `timebase-mcp` uses the client credentials flow and currently supports the `client_secret_post` token-endpoint authentication method.
285
+
286
+ Required variables:
287
+
288
+ - `TIMEBASE_OAUTH2_TOKEN_URL`
289
+ - `TIMEBASE_OAUTH2_CLIENT_ID`
290
+ - `TIMEBASE_OAUTH2_CLIENT_SECRET`
291
+
292
+ Optional variables:
293
+
294
+ - `TIMEBASE_USERNAME` to override the default TimeBase username; otherwise `TIMEBASE_OAUTH2_CLIENT_ID` is used
295
+ - `TIMEBASE_OAUTH2_SCOPE` as a single space-delimited string when multiple scopes are required
296
+ - `TIMEBASE_OAUTH2_TOKEN_PARAMS`
297
+
298
+ Microsoft Entra ID example configuration:
299
+
300
+ ```dotenv
301
+ TIMEBASE_URL=dxtick://example.com:8011
302
+ TIMEBASE_OAUTH2_TOKEN_URL=https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
303
+ TIMEBASE_OAUTH2_CLIENT_ID=<client-id>
304
+ TIMEBASE_OAUTH2_CLIENT_SECRET=<client-secret>
305
+ TIMEBASE_OAUTH2_SCOPE=api://example-api/.default
306
+ ```
307
+
308
+ Use `TIMEBASE_OAUTH2_TOKEN_PARAMS` only if your provider requires extra token fields such as `audience`, `resource`, etc. It must be a valid JSON object.
309
+
310
+ ## Features
311
+
312
+ ### Tools
313
+
314
+ | Name | Description | Key inputs | Notes |
315
+ | - | - | - | - |
316
+ | `list_streams` | List available TimeBase streams with descriptions | None | Read-only stream catalog lookup |
317
+ | `get_stream_schema` | Get the schema of a specific stream | `stream_key` | Returns the schema text for the requested stream |
318
+ | `get_stream_time_range` | Get the UTC time range of a specific stream | `stream_key` | Returns start and end timestamps |
319
+ | `get_stream_symbols` | Get symbols from a specific stream | `stream_key`, optional `limit`, optional `cursor` | Returns sorted, paginated symbols. `limit` can be 1-500 |
320
+ | `get_stream_messages` | Preview the first or last messages from a stream | `stream_key`, optional `reverse`, optional `count` | Returns up to `count` JSON-formatted messages. Use `reverse` to read from the end of the stream |
321
+ | `execute_query` | Execute a TimeBase QQL query | `query`, optional `limit` | Returns a limited preview of result rows. `limit` can be 1-100 |
322
+ | `compile_query` | Compile a TimeBase QQL query | `query` | Returns parser-level diagnostics only (not full semantic/logical validation). `error_token` is the first unexpected token, which may be after the actual root cause. |
323
+
324
+ ### Resources
325
+
326
+ Some clients (e.g. VS Code) allow users to explicitly add resources to the context.
327
+
328
+ | URI | Name | Description |
329
+ | - | - | - |
330
+ | `timebase://streams` | `stream_catalog` | Text resource listing streams and descriptions |
331
+ | `timebase://streams/{stream_key}/schema` | `stream_schema` | Resource template exposing a stream schema by key |
332
+
333
+ ## Troubleshooting
334
+
335
+ ### General
336
+
337
+ - Green indicator in Cursor's MCP panel means the timebase-mcp server is running and Cursor is connected to it, but it doesn't necessarily mean that timebase-mcp is successfully connected to TimeBase.
338
+
339
+ #### Where to find logs?
340
+
341
+ <details>
342
+ <summary>VS Code</summary>
343
+
344
+ Logs can be found in the output panel (`View > Output`, then select timebase-mcp from the dropdown).
345
+
346
+ </details>
347
+
348
+ <details>
349
+ <summary>Cursor</summary>
350
+
351
+ Logs can be found in the Cursor's output panel (`View > Output`, then select timebase-mcp from the dropdown).
352
+
353
+ </details>
354
+
355
+ <details>
356
+ <summary>Claude Desktop</summary>
357
+
358
+ Logs can be found at `Settings > Developer > TimeBase MCP > View Logs`.
359
+
360
+ </details>
361
+
362
+ <details>
363
+ <summary>Claude Code</summary>
364
+
365
+ Launch Claude Code in an MCP debug mode:
366
+
367
+ ```bash
368
+ claude --debug mcp
369
+ ```
370
+
371
+ Refer to the [official documentation](https://code.claude.com/docs/en/debug-your-config#check-mcp-servers) for more details.
372
+
373
+ </details>
374
+
375
+ <details>
376
+ <summary>Opencode</summary>
377
+
378
+ MCP server logs can be found in the Opencode's log:
379
+
380
+ - On Linux and MacOS: `~/.local/share/opencode/log/`
381
+ - On Windows: Press `WIN+R` and paste `%USERPROFILE%\.local\share\opencode\log`
382
+
383
+ Refer to the [official documentation](https://opencode.ai/docs/troubleshooting/#logs) for more details.
384
+
385
+ </details>
386
+
387
+ <details>
388
+ <summary>Other</summary>
389
+
390
+ Logs are printed to stderr of the `timebase-mcp` process, look for them in the terminal where you started `timebase-mcp` or in the logs of your MCP client.
391
+
392
+ </details>
393
+
394
+ ### TimeBase connection issues
395
+
396
+ First, find the logs as described above and check for any error messages related to TimeBase connection. Common issues:
397
+
398
+ - TimeBase server is not running or not accessible from this environment (e.g. wrong URL, network issues, firewall, WSL misconfiguration, etc.). Look for messages like `Connection refused at SOCKET`.
399
+
400
+ - MCP edition mismatch: if you're trying to connect to TimeBase Enterprise but have the Community edition installed (or vice versa), you may see errors about protocol version mismatch and message about requiring an Enterprise/Community client.
401
+
402
+ - Remote access is not enabled: some features require remote access to be enabled on the TimeBase server. Refer to TimeBase documentation for instructions on how to enable it:
403
+ - [Remote Access for TimeBase Enterprise](https://kb.timebase.info/docs/deployment/config#system-remoteMonitoring)
404
+ - [Remote Access for TimeBase Community](https://kb.timebase.info/community/deployment/config#system-remoteMonitoring)
405
+
406
+ - Missing `DXAPI_SSL_TERMINATION` flag: if your TimeBase server setup requires SSL termination, but the `DXAPI_SSL_TERMINATION` environment variable is not set to `true`, `dxapi` may hang indefinitely and you'll get MCP connection timeout errors in the logs.
407
+
408
+ For TimeBase CE make sure that both Native (usually 8011) and HTTP (usually 8021) ports are visible and exposed to MCP. For example in case of port forwarding:
409
+
410
+ ```sh
411
+ kubectl port-forward pod/timebase-consolidated-0 8011:8011 8021:8021 -n dev-namespace
412
+ ```
413
+
414
+
415
+ # See also
416
+
417
+ [TimeBase Skills (QQL)](https://gitlab.deltixhub.com/Deltix/QuantServer/Timebase/tb-agent-plugins)