Skip to content

Commit 122d83c

Browse files
- Expanding local.
1 parent d4abb4a commit 122d83c

File tree

2 files changed

+129
-40
lines changed

2 files changed

+129
-40
lines changed

pkg/mcp_server/dto.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ type HierarchyInput struct {
9393
type ServerInfoOutput struct {
9494
Name string `json:"name" jsonschema:"server name"`
9595
Info string `json:"info" jsonschema:"server info"`
96-
IsReadOnly bool `json:"read_only" jsonschema:"is the database read-only"`
96+
IsReadOnly bool `json:"is_read_only" jsonschema:"is the database read-only"`
9797
}
9898

9999
type QueryInput struct {

test/robot/functional/mcp.robot

Lines changed: 128 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -249,60 +249,149 @@ Concurrent psql and Reverse Proxy MCP HTTPS Server Query Tool
249249
Should Be Equal As Integers ${psql_client_result.rc} 0
250250

251251
MCP HTTPS Server JSON DTO Verification
252-
Pass Execution If "%{IS_SKIP_MCP_TEST=false}" == "true" Some platforms do not have the MCP client available
253-
Sleep 5s
254252
# greet (plain text response)
255-
${greet}= Run Process ${STACKQL_MCP_CLIENT_EXE} exec \-\-client\-type\=http \-\-url\=https://127.0.0.1:9004 \-\-client\-cfg { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true } \-\-exec.action greet \-\-exec.args {"name":"JSON TEST"}
253+
${greet}= Run Process
254+
... ${STACKQL_MCP_CLIENT_EXE}
255+
... exec
256+
... \-\-client\-type\=http
257+
... \-\-url\=https://127.0.0.1:9004
258+
... \-\-client\-cfg
259+
... { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true }
260+
... \-\-exec.action
261+
... greet
262+
... \-\-exec.args
263+
... {"name":"JSON TEST"}
264+
... stdout=${CURDIR}${/}tmp${/}MCP-HTTPS-greet.txt
265+
... stderr=${CURDIR}${/}tmp${/}MCP-HTTPS-greet-stderr.txt
256266
Should Be Equal As Integers ${greet.rc} 0
257267
Should Contain ${greet.stdout} Hi JSON TEST
258268

259-
${srvinfo}= Run Process ${STACKQL_MCP_CLIENT_EXE} exec \-\-client\-type\=http \-\-url\=https://127.0.0.1:9004 \-\-client\-cfg { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true } \-\-exec.action server_info
260-
... stdout=${CURDIR}${/}tmp${/}MCP-Get-Server-Info-Json.txt
261-
... stderr=${CURDIR}${/}tmp${/}MCP-Get-Server-Info-Json-stderr.txt
269+
# server_info
270+
${srvinfo}= Run Process
271+
... ${STACKQL_MCP_CLIENT_EXE}
272+
... exec
273+
... \-\-client\-type\=http
274+
... \-\-url\=https://127.0.0.1:9004
275+
... \-\-client\-cfg
276+
... { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true }
277+
... \-\-exec.action
278+
... server_info
279+
... stdout=${CURDIR}${/}tmp${/}MCP-HTTPS-server-info.txt
280+
... stderr=${CURDIR}${/}tmp${/}MCP-HTTPS-server-info-stderr.txt
262281
Should Be Equal As Integers ${srvinfo.rc} 0
263-
Log response = ${srvinfo.stdout}
264282
${srvinfo_obj}= Parse MCP JSON Output ${srvinfo.stdout}
265283
Dictionary Should Contain Key ${srvinfo_obj} name
266284
Dictionary Should Contain Key ${srvinfo_obj} info
267-
Dictionary Should Contain Key ${srvinfo_obj} read_only
268-
269-
# ${dbident}= Run Process ${STACKQL_MCP_CLIENT_EXE} exec \-\-client\-type\=http \-\-url\=https://127.0.0.1:9004 \-\-client\-cfg { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true } \-\-exec.action db_identity
270-
# Should Be Equal As Integers ${dbident.rc} 0
271-
# ${dbident_obj}= Parse MCP JSON Output ${dbident.stdout}
272-
# Dictionary Should Contain Key ${dbident_obj} identity
285+
Dictionary Should Contain Key ${srvinfo_obj} is_read_only
273286

274-
# ${meta_srvinfo}= Run Process ${STACKQL_MCP_CLIENT_EXE} exec \-\-client\-type\=http \-\-url\=https://127.0.0.1:9004 \-\-client\-cfg { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true } \-\-exec.action meta.server_info
275-
# Should Be Equal As Integers ${meta_srvinfo.rc} 0
276-
# ${meta_srvinfo_obj}= Parse MCP JSON Output ${meta_srvinfo.stdout}
277-
# Dictionary Should Contain Key ${meta_srvinfo_obj} is_read_only
287+
# db_identity
288+
${dbident}= Run Process
289+
... ${STACKQL_MCP_CLIENT_EXE}
290+
... exec
291+
... \-\-client\-type\=http
292+
... \-\-url\=https://127.0.0.1:9004
293+
... \-\-client\-cfg
294+
... { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true }
295+
... \-\-exec.action
296+
... db_identity
297+
... stdout=${CURDIR}${/}tmp${/}MCP-HTTPS-db-identity.txt
298+
... stderr=${CURDIR}${/}tmp${/}MCP-HTTPS-db-identity-stderr.txt
299+
Should Be Equal As Integers ${dbident.rc} 0
300+
${dbident_obj}= Parse MCP JSON Output ${dbident.stdout}
301+
Dictionary Should Contain Key ${dbident_obj} identity
278302

279-
# ${query_json}= Run Process ${STACKQL_MCP_CLIENT_EXE} exec \-\-client\-type\=http \-\-url\=https://127.0.0.1:9004 \-\-client\-cfg { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true } \-\-exec.action query_v2 \-\-exec.args {"sql":"SELECT assetType, count(*) as asset_count FROM google.cloudasset.assets WHERE parentType \= 'projects' and parent \= 'testing-project' GROUP BY assetType order by count(*) desc, assetType desc;","format":"json"}
280-
# Should Be Equal As Integers ${query_json.rc} 0
281-
# ${query_obj}= Parse MCP JSON Output ${query_json.stdout}
282-
# Should Be Equal ${query_obj["format"]} json
283-
# Dictionary Should Contain Key ${query_obj} rows
284-
# ${row_count}= Get From Dictionary ${query_obj} row_count
285-
# Should Be True ${row_count} > 0
303+
# query_v2 format=json
304+
${query_json}= Run Process
305+
... ${STACKQL_MCP_CLIENT_EXE}
306+
... exec
307+
... \-\-client\-type\=http
308+
... \-\-url\=https://127.0.0.1:9004
309+
... \-\-client\-cfg
310+
... { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true }
311+
... \-\-exec.action
312+
... query_v2
313+
... \-\-exec.args
314+
... {"sql":"show providers;","format":"json"}
315+
... stdout=${CURDIR}${/}tmp${/}MCP-HTTPS-query-v2-json.txt
316+
... stderr=${CURDIR}${/}tmp${/}MCP-HTTPS-query-v2-json-stderr.txt
317+
Should Be Equal As Integers ${query_json.rc} 0
318+
${query_obj}= Parse MCP JSON Output ${query_json.stdout}
319+
Should Be Equal ${query_obj["format"]} json
320+
Dictionary Should Contain Key ${query_obj} rows
321+
${row_count}= Get From Dictionary ${query_obj} row_count
322+
Should Be True ${row_count} > 0
286323

287-
# ${ns_query_text}= Run Process ${STACKQL_MCP_CLIENT_EXE} exec \-\-client\-type\=http \-\-url\=https://127.0.0.1:9004 \-\-client\-cfg { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true } \-\-exec.action query.exec_text \-\-exec.args {"sql":"SELECT 1","format":"text"}
324+
# query.exec_text
325+
# ${ns_query_text}= Run Process
326+
# ... ${STACKQL_MCP_CLIENT_EXE}
327+
# ... exec
328+
# ... \-\-client\-type\=http
329+
# ... \-\-url\=https://127.0.0.1:9004
330+
# ... \-\-client\-cfg
331+
# ... { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true }
332+
# ... \-\-exec.action
333+
# ... query.exec_text
334+
# ... \-\-exec.args
335+
# ... {"sql":"SELECT 1","format":"text"}
336+
# ... stdout=${CURDIR}${/}tmp${/}MCP-HTTPS-query-exec-text.txt
337+
# ... stderr=${CURDIR}${/}tmp${/}MCP-HTTPS-query-exec-text-stderr.txt
288338
# Should Be Equal As Integers ${ns_query_text.rc} 0
289339
# ${ns_query_text_obj}= Parse MCP JSON Output ${ns_query_text.stdout}
290340
# Should Be Equal ${ns_query_text_obj["format"]} text
291341
# Dictionary Should Contain Key ${ns_query_text_obj} raw
292342

293-
# ${ns_query_json}= Run Process ${STACKQL_MCP_CLIENT_EXE} exec \-\-client\-type\=http \-\-url\=https://127.0.0.1:9004 \-\-client\-cfg { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true } \-\-exec.action query.exec_json \-\-exec.args {"sql":"SELECT 1","row_limit":5}
294-
# Should Be Equal As Integers ${ns_query_json.rc} 0
295-
# ${ns_query_json_obj}= Parse MCP JSON Output ${ns_query_json.stdout}
296-
# Should Be Equal ${ns_query_json_obj["format"]} json
297-
# ${ns_row_count}= Get From Dictionary ${ns_query_json_obj} row_count
298-
# Should Be True ${ns_row_count} >= 0
343+
# query.exec_json
344+
${ns_query_json}= Run Process
345+
... ${STACKQL_MCP_CLIENT_EXE}
346+
... exec
347+
... \-\-client\-type\=http
348+
... \-\-url\=https://127.0.0.1:9004
349+
... \-\-client\-cfg
350+
... { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true }
351+
... \-\-exec.action
352+
... query.exec_json
353+
... \-\-exec.args
354+
... {"sql":"SELECT 1","row_limit":5}
355+
... stdout=${CURDIR}${/}tmp${/}MCP-HTTPS-query-exec-json.txt
356+
... stderr=${CURDIR}${/}tmp${/}MCP-HTTPS-query-exec-json-stderr.txt
357+
Should Be Equal As Integers ${ns_query_json.rc} 0
358+
${ns_query_json_obj}= Parse MCP JSON Output ${ns_query_json.stdout}
359+
Should Be Equal ${ns_query_json_obj["format"]} json
360+
${ns_row_count}= Get From Dictionary ${ns_query_json_obj} row_count
361+
Should Be True ${ns_row_count} >= 0
299362

300-
# ${meta_fk}= Run Process ${STACKQL_MCP_CLIENT_EXE} exec \-\-client\-type\=http \-\-url\=https://127.0.0.1:9004 \-\-client\-cfg { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true } \-\-exec.action meta.get_foreign_keys \-\-exec.args {"provider":"google","service":"cloudresourcemanager","resource":"projects"}
301-
# Should Be Equal As Integers ${meta_fk.rc} 0
302-
# ${meta_fk_obj}= Parse MCP JSON Output ${meta_fk.stdout}
303-
# Dictionary Should Contain Key ${meta_fk_obj} text
363+
# meta.get_foreign_keys
364+
${meta_fk}= Run Process
365+
... ${STACKQL_MCP_CLIENT_EXE}
366+
... exec
367+
... \-\-client\-type\=http
368+
... \-\-url\=https://127.0.0.1:9004
369+
... \-\-client\-cfg
370+
... { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true }
371+
... \-\-exec.action
372+
... meta.get_foreign_keys
373+
... \-\-exec.args
374+
... {"provider":"google","service":"cloudresourcemanager","resource":"projects"}
375+
... stdout=${CURDIR}${/}tmp${/}MCP-HTTPS-meta-get-foreign-keys.txt
376+
... stderr=${CURDIR}${/}tmp${/}MCP-HTTPS-meta-get-foreign-keys-stderr.txt
377+
Should Be Equal As Integers ${meta_fk.rc} 0
378+
${meta_fk_obj}= Parse MCP JSON Output ${meta_fk.stdout}
379+
Dictionary Should Contain Key ${meta_fk_obj} text
304380

305-
# ${meta_rels}= Run Process ${STACKQL_MCP_CLIENT_EXE} exec \-\-client\-type\=http \-\-url\=https://127.0.0.1:9004 \-\-client\-cfg { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true } \-\-exec.action meta.find_relationships \-\-exec.args {"provider":"google","service":"cloudresourcemanager","resource":"projects"}
306-
# Should Be Equal As Integers ${meta_rels.rc} 0
307-
# ${meta_rels_obj}= Parse MCP JSON Output ${meta_rels.stdout}
308-
# Dictionary Should Contain Key ${meta_rels_obj} text
381+
# meta.find_relationships
382+
${meta_rels}= Run Process
383+
... ${STACKQL_MCP_CLIENT_EXE}
384+
... exec
385+
... \-\-client\-type\=http
386+
... \-\-url\=https://127.0.0.1:9004
387+
... \-\-client\-cfg
388+
... { "apply_tls_globally": true, "insecure_skip_verify": true, "ca_file": "test/server/mtls/credentials/pg_server_cert.pem", "promote_leaf_to_ca": true }
389+
... \-\-exec.action
390+
... meta.find_relationships
391+
... \-\-exec.args
392+
... {"provider":"google","service":"cloudresourcemanager","resource":"projects"}
393+
... stdout=${CURDIR}${/}tmp${/}MCP-HTTPS-meta-find-relationships.txt
394+
... stderr=${CURDIR}${/}tmp${/}MCP-HTTPS-meta-find-relationships-stderr.txt
395+
Should Be Equal As Integers ${meta_rels.rc} 0
396+
${meta_rels_obj}= Parse MCP JSON Output ${meta_rels.stdout}
397+
Dictionary Should Contain Key ${meta_rels_obj} text

0 commit comments

Comments
 (0)