Commit 37fe8e1
authored
Support multiple buckets (#47)
* Add support for the MCP server to work with multiple buckets
- Introduced `connect_to_bucket` utility to establish bucket connections using the cluster context.
- Updated relevant functions to accept `bucket_name` as an argument where necessary, improving flexibility in handling Couchbase operations.
- Enhanced documentation and logging for better clarity on connection status and error handling.
* Update README.md to enhance feature list and clarify environment variable usage
- Added new features for retrieving bucket, scope, and collection lists in the MCP server.
- Removed references to `CB_BUCKET_NAME` from environment variable sections
* Remove `validate_connection_config` function and its references from the utils module
* Add the bucket configuration back in to the MCP server
* Add bucket name retrieval to server configuration and update connection logic
- Included 'bucket_name' in the server configuration status.
- Updated the connection logic to resolve the bucket name before attempting to connect, improving error handling and clarity in connection status.
* Use Query based retrieval for getting the collections in a scope
* Fix typo in docstring of run_cluster_query function in query.py
* Handle review comments
- Typo in docstring.
- Enhanced error handling by removing redundant checks for empty strings.
- Improved the retrieval of bucket names in connection status responses.
* Update README.md to clarify environment variable usage and enhance feature descriptions
- Added note regarding the requirement of Query services for retrieving collections in a specified scope and bucket.
- Included `CB_BUCKET_NAME` in the environment variable section with a description for its usage.
* Update error handling in cluster connection response to always indicate disconnection status
* Update README.md to add a note on database credential requirements for default bucket in MCP server configuration
* Refactor bucket name resolution in KV, Query, and Server modules
- Updated the logic to use `resolved_bucket_name` instead of `bucket_name` for improved clarity and consistency across functions.
- Enhanced error logging in the server module to specify the resolved bucket name when encountering issues.
* Remove bucket_name from MCP server initialization
- Removed the `resolve_bucket_name` function and updated the code to directly use `bucket_name` in KV, Query, and Server modules for improved clarity.
- Adjusted function signatures to require `bucket_name` as a mandatory parameter, enhancing consistency in bucket handling.
- Updated error logging to reflect the direct use of `bucket_name` in connection status responses.
* Update README.md to reflect removal of CB_BUCKET_NAME from configuration examples
- Removed references to `CB_BUCKET_NAME` in environment variable examples and usage notes for clarity.
- Adjusted descriptions to ensure consistency with recent changes in MCP server initialization.
* Handle error in case of unspecified bucket_name for test_cluster_connection tool
* Update README.md to remove note on database credential limitations for MCP server configuration1 parent 355b8ce commit 37fe8e1
File tree
10 files changed
+135
-118
lines changed- src
- tools
- utils
10 files changed
+135
-118
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
8 | 6 | | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
| 13 | + | |
15 | 14 | | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
| 89 | + | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
108 | | - | |
| 107 | + | |
109 | 108 | | |
110 | | - | |
111 | 109 | | |
112 | 110 | | |
113 | 111 | | |
| |||
210 | 208 | | |
211 | 209 | | |
212 | 210 | | |
213 | | - | |
214 | 211 | | |
215 | 212 | | |
216 | 213 | | |
| |||
244 | 241 | | |
245 | 242 | | |
246 | 243 | | |
247 | | - | |
248 | 244 | | |
249 | 245 | | |
250 | 246 | | |
| |||
321 | 317 | | |
322 | 318 | | |
323 | 319 | | |
324 | | - | |
325 | 320 | | |
326 | 321 | | |
327 | 322 | | |
| |||
350 | 345 | | |
351 | 346 | | |
352 | 347 | | |
353 | | - | |
354 | | - | |
355 | 348 | | |
356 | 349 | | |
357 | 350 | | |
| |||
377 | 370 | | |
378 | 371 | | |
379 | 372 | | |
380 | | - | |
| 373 | + | |
381 | 374 | | |
382 | 375 | | |
383 | 376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 80 | | |
86 | 81 | | |
87 | 82 | | |
| |||
121 | 116 | | |
122 | 117 | | |
123 | 118 | | |
124 | | - | |
125 | 119 | | |
126 | 120 | | |
127 | 121 | | |
| |||
133 | 127 | | |
134 | 128 | | |
135 | 129 | | |
136 | | - | |
137 | 130 | | |
138 | 131 | | |
139 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| 36 | + | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
| |||
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
44 | 53 | | |
45 | 54 | | |
46 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | | - | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
23 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
24 | 31 | | |
25 | 32 | | |
26 | 33 | | |
| |||
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| 42 | + | |
35 | 43 | | |
36 | 44 | | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
41 | 49 | | |
42 | | - | |
| 50 | + | |
| 51 | + | |
43 | 52 | | |
44 | 53 | | |
45 | 54 | | |
| |||
51 | 60 | | |
52 | 61 | | |
53 | 62 | | |
54 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
55 | 68 | | |
56 | 69 | | |
57 | 70 | | |
58 | | - | |
| 71 | + | |
| 72 | + | |
59 | 73 | | |
60 | 74 | | |
61 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | | - | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | | - | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
0 commit comments