Skip to content

Commit be2bce0

Browse files
progress-interface
Summary: - Rmove compile errors. - Leverage golang mcp SDK.
1 parent 3fa709f commit be2bce0

File tree

7 files changed

+476
-572
lines changed

7 files changed

+476
-572
lines changed

go.mod

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/stackql/stackql
22

3-
go 1.22.0
3+
go 1.23.0
44

55
require (
66
github.com/DATA-DOG/go-sqlmock v1.5.1
@@ -10,6 +10,7 @@ require (
1010
github.com/jackc/pgx/v5 v5.0.4
1111
github.com/lib/pq v1.10.4
1212
github.com/magiconair/properties v1.8.6
13+
github.com/modelcontextprotocol/go-sdk v1.0.0
1314
github.com/olekukonko/tablewriter v0.0.0-20180130162743-b8a9be070da4
1415
github.com/sirupsen/logrus v1.9.3
1516
github.com/snowflakedb/gosnowflake v1.15.0
@@ -21,7 +22,7 @@ require (
2122
github.com/stackql/psql-wire v0.1.1-beta23
2223
github.com/stackql/stackql-parser v0.0.15-alpha06
2324
github.com/stretchr/testify v1.10.0
24-
golang.org/x/sync v0.10.0
25+
golang.org/x/sync v0.15.0
2526
gonum.org/v1/gonum v0.15.1
2627
gopkg.in/yaml.v2 v2.4.0
2728
gotest.tools v2.2.0+incompatible
@@ -81,6 +82,7 @@ require (
8182
github.com/golang/protobuf v1.5.2 // indirect
8283
github.com/google/flatbuffers v24.12.23+incompatible // indirect
8384
github.com/google/go-cmp v0.7.0 // indirect
85+
github.com/google/jsonschema-go v0.3.0 // indirect
8486
github.com/google/uuid v1.6.0 // indirect
8587
github.com/gorilla/mux v1.8.0 // indirect
8688
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
@@ -112,21 +114,22 @@ require (
112114
github.com/stretchr/objx v0.5.2 // indirect
113115
github.com/subosito/gotenv v1.2.0 // indirect
114116
github.com/xo/dburl v0.23.2 // indirect
117+
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
115118
github.com/zeebo/xxh3 v1.0.2 // indirect
116119
go.opentelemetry.io/otel v1.35.0 // indirect
117120
go.opentelemetry.io/otel/trace v1.35.0 // indirect
118121
go.uber.org/atomic v1.9.0 // indirect
119122
go.uber.org/multierr v1.7.0 // indirect
120123
go.uber.org/zap v1.21.0 // indirect
121-
golang.org/x/crypto v0.32.0 // indirect
124+
golang.org/x/crypto v0.39.0 // indirect
122125
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
123-
golang.org/x/mod v0.22.0 // indirect
124-
golang.org/x/net v0.34.0 // indirect
126+
golang.org/x/mod v0.25.0 // indirect
127+
golang.org/x/net v0.41.0 // indirect
125128
golang.org/x/oauth2 v0.26.0 // indirect
126-
golang.org/x/sys v0.30.0 // indirect
127-
golang.org/x/term v0.28.0 // indirect
128-
golang.org/x/text v0.21.0 // indirect
129-
golang.org/x/tools v0.29.0 // indirect
129+
golang.org/x/sys v0.33.0 // indirect
130+
golang.org/x/term v0.32.0 // indirect
131+
golang.org/x/text v0.26.0 // indirect
132+
golang.org/x/tools v0.34.0 // indirect
130133
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
131134
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
132135
google.golang.org/grpc v1.67.1 // indirect

go.sum

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
261261
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
262262
github.com/google/go-jsonnet v0.17.0 h1:/9NIEfhK1NQRKl3sP2536b2+x5HnZMdql7x3yK/l8JY=
263263
github.com/google/go-jsonnet v0.17.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw=
264+
github.com/google/jsonschema-go v0.3.0 h1:6AH2TxVNtk3IlvkkhjrtbUc4S8AvO0Xii0DxIygDg+Q=
265+
github.com/google/jsonschema-go v0.3.0/go.mod h1:r5quNTdLOYEz95Ru18zA0ydNbBuYoo9tgaYcxEYhJVE=
264266
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
265267
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
266268
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -407,6 +409,8 @@ github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8D
407409
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
408410
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
409411
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
412+
github.com/modelcontextprotocol/go-sdk v1.0.0 h1:Z4MSjLi38bTgLrd/LjSmofqRqyBiVKRyQSJgw8q8V74=
413+
github.com/modelcontextprotocol/go-sdk v1.0.0/go.mod h1:nYtYQroQ2KQiM0/SbyEPUWQ6xs4B95gJjEalc9AQyOs=
410414
github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs=
411415
github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns=
412416
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
@@ -492,6 +496,8 @@ github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s
492496
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
493497
github.com/xo/dburl v0.23.2 h1:Fl88cvayrgE56JA/sqhNMLljCW/b7RmG1mMkKMZUFgA=
494498
github.com/xo/dburl v0.23.2/go.mod h1:uazlaAQxj4gkshhfuuYyvwCBouOmNnG2aDxTCFZpmL4=
499+
github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4=
500+
github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4=
495501
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
496502
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
497503
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -553,8 +559,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
553559
golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
554560
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
555561
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
556-
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
557-
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
562+
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
563+
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
558564
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
559565
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
560566
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -592,8 +598,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
592598
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
593599
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
594600
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
595-
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
596-
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
601+
golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
602+
golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
597603
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
598604
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
599605
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -631,8 +637,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
631637
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
632638
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
633639
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
634-
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
635-
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
640+
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
641+
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
636642
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
637643
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
638644
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -662,8 +668,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
662668
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
663669
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
664670
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
665-
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
666-
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
671+
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
672+
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
667673
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
668674
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
669675
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -721,12 +727,12 @@ golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBc
721727
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
722728
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
723729
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
724-
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
725-
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
730+
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
731+
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
726732
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
727733
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
728-
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
729-
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
734+
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
735+
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
730736
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
731737
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
732738
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -735,8 +741,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
735741
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
736742
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
737743
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
738-
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
739-
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
744+
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
745+
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
740746
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
741747
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
742748
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -796,8 +802,8 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
796802
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
797803
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
798804
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
799-
golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=
800-
golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588=
805+
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
806+
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
801807
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
802808
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
803809
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

pkg/mcp_server/config.go

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import (
1212
type Config struct {
1313
// Server contains server-specific configuration.
1414
Server ServerConfig `json:"server" yaml:"server"`
15-
15+
1616
// Backend contains backend-specific configuration.
1717
Backend BackendConfig `json:"backend" yaml:"backend"`
18-
18+
1919
// Transport contains transport layer configuration.
2020
Transport TransportConfig `json:"transport" yaml:"transport"`
21-
21+
2222
// Logging contains logging configuration.
2323
Logging LoggingConfig `json:"logging" yaml:"logging"`
2424
}
@@ -27,16 +27,16 @@ type Config struct {
2727
type ServerConfig struct {
2828
// Name is the server name advertised to clients.
2929
Name string `json:"name" yaml:"name"`
30-
30+
3131
// Version is the server version advertised to clients.
3232
Version string `json:"version" yaml:"version"`
33-
33+
3434
// Description is a human-readable description of the server.
3535
Description string `json:"description" yaml:"description"`
36-
36+
3737
// MaxConcurrentRequests limits the number of concurrent client requests.
3838
MaxConcurrentRequests int `json:"max_concurrent_requests" yaml:"max_concurrent_requests"`
39-
39+
4040
// RequestTimeout specifies the timeout for individual requests.
4141
RequestTimeout Duration `json:"request_timeout" yaml:"request_timeout"`
4242
}
@@ -45,20 +45,20 @@ type ServerConfig struct {
4545
type BackendConfig struct {
4646
// Type specifies the backend type ("stackql", "tcp", "memory").
4747
Type string `json:"type" yaml:"type"`
48-
48+
4949
// ConnectionString contains the connection details for the backend.
5050
// Format depends on the backend type.
5151
ConnectionString string `json:"connection_string" yaml:"connection_string"`
52-
52+
5353
// MaxConnections limits the number of backend connections.
5454
MaxConnections int `json:"max_connections" yaml:"max_connections"`
55-
55+
5656
// ConnectionTimeout specifies the timeout for backend connections.
5757
ConnectionTimeout Duration `json:"connection_timeout" yaml:"connection_timeout"`
58-
58+
5959
// QueryTimeout specifies the timeout for individual queries.
6060
QueryTimeout Duration `json:"query_timeout" yaml:"query_timeout"`
61-
61+
6262
// RetryConfig contains retry policy configuration.
6363
Retry RetryConfig `json:"retry" yaml:"retry"`
6464
}
@@ -67,13 +67,13 @@ type BackendConfig struct {
6767
type TransportConfig struct {
6868
// EnabledTransports lists which transports to enable (stdio, tcp, websocket).
6969
EnabledTransports []string `json:"enabled_transports" yaml:"enabled_transports"`
70-
70+
7171
// StdioConfig contains stdio transport configuration.
7272
Stdio StdioTransportConfig `json:"stdio" yaml:"stdio"`
73-
73+
7474
// TCPConfig contains TCP transport configuration.
7575
TCP TCPTransportConfig `json:"tcp" yaml:"tcp"`
76-
76+
7777
// WebSocketConfig contains WebSocket transport configuration.
7878
WebSocket WebSocketTransportConfig `json:"websocket" yaml:"websocket"`
7979
}
@@ -88,16 +88,16 @@ type StdioTransportConfig struct {
8888
type TCPTransportConfig struct {
8989
// Address specifies the TCP listen address.
9090
Address string `json:"address" yaml:"address"`
91-
91+
9292
// Port specifies the TCP listen port.
9393
Port int `json:"port" yaml:"port"`
94-
94+
9595
// MaxConnections limits the number of concurrent TCP connections.
9696
MaxConnections int `json:"max_connections" yaml:"max_connections"`
97-
97+
9898
// ReadTimeout specifies the timeout for read operations.
9999
ReadTimeout Duration `json:"read_timeout" yaml:"read_timeout"`
100-
100+
101101
// WriteTimeout specifies the timeout for write operations.
102102
WriteTimeout Duration `json:"write_timeout" yaml:"write_timeout"`
103103
}
@@ -106,16 +106,16 @@ type TCPTransportConfig struct {
106106
type WebSocketTransportConfig struct {
107107
// Address specifies the WebSocket listen address.
108108
Address string `json:"address" yaml:"address"`
109-
109+
110110
// Port specifies the WebSocket listen port.
111111
Port int `json:"port" yaml:"port"`
112-
112+
113113
// Path specifies the WebSocket endpoint path.
114114
Path string `json:"path" yaml:"path"`
115-
115+
116116
// MaxConnections limits the number of concurrent WebSocket connections.
117117
MaxConnections int `json:"max_connections" yaml:"max_connections"`
118-
118+
119119
// MaxMessageSize limits the size of WebSocket messages.
120120
MaxMessageSize int64 `json:"max_message_size" yaml:"max_message_size"`
121121
}
@@ -124,16 +124,16 @@ type WebSocketTransportConfig struct {
124124
type RetryConfig struct {
125125
// Enabled determines whether retries are enabled.
126126
Enabled bool `json:"enabled" yaml:"enabled"`
127-
127+
128128
// MaxAttempts specifies the maximum number of retry attempts.
129129
MaxAttempts int `json:"max_attempts" yaml:"max_attempts"`
130-
130+
131131
// InitialDelay specifies the initial delay between retries.
132132
InitialDelay Duration `json:"initial_delay" yaml:"initial_delay"`
133-
133+
134134
// MaxDelay specifies the maximum delay between retries.
135135
MaxDelay Duration `json:"max_delay" yaml:"max_delay"`
136-
136+
137137
// Multiplier specifies the backoff multiplier.
138138
Multiplier float64 `json:"multiplier" yaml:"multiplier"`
139139
}
@@ -142,13 +142,13 @@ type RetryConfig struct {
142142
type LoggingConfig struct {
143143
// Level specifies the log level (debug, info, warn, error).
144144
Level string `json:"level" yaml:"level"`
145-
145+
146146
// Format specifies the log format (text, json).
147147
Format string `json:"format" yaml:"format"`
148-
148+
149149
// Output specifies the log output (stdout, stderr, file path).
150150
Output string `json:"output" yaml:"output"`
151-
151+
152152
// EnableRequestLogging enables detailed request/response logging.
153153
EnableRequestLogging bool `json:"enable_request_logging" yaml:"enable_request_logging"`
154154
}
@@ -267,7 +267,7 @@ func (c *Config) Validate() error {
267267
if len(c.Transport.EnabledTransports) == 0 {
268268
return fmt.Errorf("at least one transport must be enabled")
269269
}
270-
270+
271271
// Validate enabled transports
272272
validTransports := map[string]bool{
273273
"stdio": true,
@@ -279,7 +279,7 @@ func (c *Config) Validate() error {
279279
return fmt.Errorf("invalid transport: %s", transport)
280280
}
281281
}
282-
282+
283283
// Validate TCP config if TCP transport is enabled
284284
for _, transport := range c.Transport.EnabledTransports {
285285
if transport == "tcp" {
@@ -293,7 +293,7 @@ func (c *Config) Validate() error {
293293
}
294294
}
295295
}
296-
296+
297297
// Validate logging config
298298
validLevels := map[string]bool{
299299
"debug": true,
@@ -304,7 +304,7 @@ func (c *Config) Validate() error {
304304
if !validLevels[c.Logging.Level] {
305305
return fmt.Errorf("invalid logging level: %s", c.Logging.Level)
306306
}
307-
307+
308308
return nil
309309
}
310310

@@ -330,4 +330,4 @@ func LoadFromYAML(data []byte) (*Config, error) {
330330
return nil, fmt.Errorf("invalid config: %w", err)
331331
}
332332
return config, nil
333-
}
333+
}

pkg/mcp_server/dto.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package mcp_server
2+
3+
type GreetingInput struct {
4+
Name string `json:"name" jsonschema:"the name of the person to greet"`
5+
}
6+
7+
type GreetingOutput struct {
8+
Greeting string `json:"greeting" jsonschema:"the greeting to tell to the user"`
9+
}

0 commit comments

Comments
 (0)