@@ -122,16 +122,6 @@ Relevant information is pulled from <https://cratedb.com/docs>, curated per
122122<br >
123123Tool names are: ` get_cratedb_documentation_index ` , ` fetch_cratedb_docs `
124124
125- ### Security considerations
126-
127- ** By default, the application will access the database in read-only mode.**
128-
129- We do not recommend letting LLM-based agents insert or modify data by itself.
130- As such, only ` SELECT ` statements are permitted and forwarded to the database.
131- All other operations will raise a ` ValueError ` exception, unless the
132- ` CRATEDB_MCP_PERMIT_ALL_STATEMENTS ` environment variable is set to a
133- truthy value. This is ** not** recommended.
134-
135125### Install
136126
137127The configuration snippets for AI assistants are using the ` uvx ` launcher
@@ -174,6 +164,23 @@ in seconds.
174164The ` CRATEDB_MCP_DOCS_CACHE_TTL ` environment variable (default: 3600) defines
175165the cache lifetime for documentation resources in seconds.
176166
167+ ### Security considerations
168+
169+ If you want to prevent agents from modifying data, i.e., permit ` SELECT ` statements
170+ only, it is recommended to [ create a read-only database user by using "GRANT DQL"] .
171+ ``` sql
172+ CREATE USER " read-only" WITH (password = ' YOUR_PASSWORD' );
173+ GRANT DQL TO " read-only" ;
174+ ```
175+ Then, include relevant access credentials in the cluster URL.
176+ ``` shell
177+ export CRATEDB_CLUSTER_URL=
" https://read-only:[email protected] :4200" 178+ ```
179+ The MCP Server also prohibits non-SELECT statements on the application level.
180+ All other operations will raise a ` PermissionError ` exception, unless the
181+ ` CRATEDB_MCP_PERMIT_ALL_STATEMENTS ` environment variable is set to a
182+ truthy value.
183+
177184### Operate
178185
179186Start MCP server with ` stdio ` transport (default).
@@ -227,6 +234,7 @@ Version pinning is strongly recommended, especially if you use it as a library.
227234[ CrateDB ] : https://cratedb.com/database
228235[ cratedb-about ] : https://pypi.org/project/cratedb-about/
229236[ cratedb-outline.yaml ] : https://github.com/crate/about/blob/v0.0.4/src/cratedb_about/outline/cratedb-outline.yaml
237+ [ create a read-only database user by using "GRANT DQL" ] : https://community.cratedb.com/t/create-read-only-database-user-by-using-grant-dql/2031
230238[ development documentation ] : https://github.com/crate/cratedb-mcp/blob/main/DEVELOP.md
231239[ example questions ] : https://github.com/crate/about/blob/v0.0.4/src/cratedb_about/query/model.py#L17-L44
232240[ examples folder ] : https://github.com/crate/cratedb-mcp/tree/main/examples
0 commit comments