Skip to content

Commit 17a5ccd

Browse files
committed
ai: mcp server and slack bot
1 parent d4c1032 commit 17a5ccd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+13720
-52
lines changed

.cursor/mcp.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"mcpServers": {
3+
"doublezero": {
4+
"url": "http://host.docker.internal:8010"
5+
}
6+
}
7+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ controlplane/funder/cmd/funder/funder
1717
.vscode/*
1818
.vscode
1919
.zed
20+
.tmp
2021

2122
dist/
2223

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ RUN --mount=type=cache,target=/go/pkg/mod \
9595
--mount=type=cache,target=/root/.cache/go-build \
9696
go build -ldflags "${GO_LDFLAGS}" -o ${BIN_DIR}/doublezero-telemetry-state-ingest telemetry/state-ingest/cmd/server/main.go
9797

98+
# Build the DZ-AI MCP server (golang)
99+
RUN --mount=type=cache,target=/go/pkg/mod \
100+
--mount=type=cache,target=/root/.cache/go-build \
101+
CGO_ENABLED=1 go build -ldflags "${GO_LDFLAGS}" -o ${BIN_DIR}/doublezero-ai-mcp-server tools/dz-ai/cmd/mcp-server/main.go
102+
103+
# Build the DZ-AI Slack bot (golang)
104+
RUN --mount=type=cache,target=/go/pkg/mod \
105+
--mount=type=cache,target=/root/.cache/go-build \
106+
CGO_ENABLED=1 go build -ldflags "${GO_LDFLAGS}" -o ${BIN_DIR}/doublezero-ai-slack-bot tools/dz-ai/cmd/slack-bot/main.go
107+
98108
# Force COPY in later stages to always copy the binaries, even if they appear to be the same.
99109
ARG CACHE_BUSTER=1
100110
RUN echo "$CACHE_BUSTER" > ${BIN_DIR}/.cache-buster && \

controlplane/telemetry/pkg/config/constants.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@ const (
1010
// InternetTelemetryDataProviderNameWheresitup is the name of the WhereIsItUp data provider.
1111
InternetTelemetryDataProviderNameWheresitup = "wheresitup"
1212
)
13+
14+
var (
15+
InternetTelemetryDataProviders = []string{
16+
InternetTelemetryDataProviderNameRIPEAtlas,
17+
InternetTelemetryDataProviderNameWheresitup,
18+
}
19+
)

go.mod

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.25
55
require (
66
github.com/ClickHouse/clickhouse-go/v2 v2.40.3
77
github.com/alitto/pond/v2 v2.6.0
8+
github.com/anthropics/anthropic-sdk-go v1.19.0
89
github.com/aristanetworks/goeapi v1.0.1-0.20250411124937-7090068b8735
910
github.com/aws/aws-sdk-go-v2 v1.41.0
1011
github.com/aws/aws-sdk-go-v2/config v1.32.6
@@ -14,11 +15,13 @@ require (
1415
github.com/dgraph-io/ristretto v0.2.0
1516
github.com/docker/docker v28.5.2+incompatible
1617
github.com/docker/go-connections v0.6.0
18+
github.com/duckdb/duckdb-go/v2 v2.5.4
1719
github.com/gagliardetto/binary v0.8.0
1820
github.com/gagliardetto/solana-go v1.14.0
1921
github.com/gogo/protobuf v1.3.2
2022
github.com/google/go-cmp v0.7.0
2123
github.com/google/gopacket v1.1.19
24+
github.com/google/jsonschema-go v0.3.0
2225
github.com/gopacket/gopacket v1.5.0
2326
github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0
2427
github.com/hexops/gotextdiff v1.0.3
@@ -31,6 +34,7 @@ require (
3134
github.com/lmittmann/tint v1.1.2
3235
github.com/maxmind/mmdbwriter v1.1.0
3336
github.com/minio/minio-go v6.0.14+incompatible
37+
github.com/modelcontextprotocol/go-sdk v1.1.0
3438
github.com/mr-tron/base58 v1.2.0
3539
github.com/near/borsh-go v0.3.1
3640
github.com/netsampler/goflow2/v2 v2.2.3
@@ -42,19 +46,21 @@ require (
4246
github.com/prometheus/client_model v0.6.2
4347
github.com/prometheus/common v0.67.4
4448
github.com/quic-go/quic-go v0.57.1
49+
github.com/slack-go/slack v0.17.3
4550
github.com/spf13/cobra v1.10.1
4651
github.com/spf13/pflag v1.0.10
4752
github.com/stretchr/testify v1.11.1
53+
github.com/takara2314/slack-go-util v0.2.0
4854
github.com/testcontainers/testcontainers-go v0.40.0
4955
github.com/testcontainers/testcontainers-go/modules/clickhouse v0.40.0
5056
github.com/testcontainers/testcontainers-go/modules/redpanda v0.40.0
5157
github.com/twmb/franz-go v1.20.5
5258
github.com/twmb/franz-go/pkg/kadm v1.17.1
5359
github.com/vishvananda/netlink v1.3.1
5460
github.com/vishvananda/netns v0.0.5
55-
golang.org/x/mod v0.30.0
56-
golang.org/x/net v0.47.0
57-
golang.org/x/sys v0.38.0
61+
golang.org/x/mod v0.31.0
62+
golang.org/x/net v0.48.0
63+
golang.org/x/sys v0.39.0
5864
google.golang.org/grpc v1.77.0
5965
google.golang.org/protobuf v1.36.10
6066
gopkg.in/yaml.v3 v3.0.1
@@ -68,6 +74,7 @@ require (
6874
github.com/Microsoft/go-winio v0.6.2 // indirect
6975
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect
7076
github.com/andybalholm/brotli v1.2.0 // indirect
77+
github.com/apache/arrow-go/v18 v18.4.1 // indirect
7178
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
7279
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4 // indirect
7380
github.com/aws/aws-sdk-go-v2/credentials v1.19.6 // indirect
@@ -93,9 +100,22 @@ require (
93100
github.com/containerd/log v0.1.0 // indirect
94101
github.com/containerd/platforms v0.2.1 // indirect
95102
github.com/cpuguy83/dockercfg v0.3.2 // indirect
96-
github.com/davecgh/go-spew v1.1.1 // indirect
103+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
97104
github.com/distribution/reference v0.6.0 // indirect
98105
github.com/docker/go-units v0.5.0 // indirect
106+
github.com/duckdb/duckdb-go-bindings v0.3.0 // indirect
107+
github.com/duckdb/duckdb-go-bindings/darwin-amd64 v0.1.24 // indirect
108+
github.com/duckdb/duckdb-go-bindings/darwin-arm64 v0.1.24 // indirect
109+
github.com/duckdb/duckdb-go-bindings/lib/darwin-amd64 v0.3.0 // indirect
110+
github.com/duckdb/duckdb-go-bindings/lib/darwin-arm64 v0.3.0 // indirect
111+
github.com/duckdb/duckdb-go-bindings/lib/linux-amd64 v0.3.0 // indirect
112+
github.com/duckdb/duckdb-go-bindings/lib/linux-arm64 v0.3.0 // indirect
113+
github.com/duckdb/duckdb-go-bindings/lib/windows-amd64 v0.3.0 // indirect
114+
github.com/duckdb/duckdb-go-bindings/linux-amd64 v0.1.24 // indirect
115+
github.com/duckdb/duckdb-go-bindings/linux-arm64 v0.1.24 // indirect
116+
github.com/duckdb/duckdb-go-bindings/windows-amd64 v0.1.24 // indirect
117+
github.com/duckdb/duckdb-go/arrowmapping v0.0.27 // indirect
118+
github.com/duckdb/duckdb-go/mapping v0.0.27 // indirect
99119
github.com/dustin/go-humanize v1.0.1 // indirect
100120
github.com/ebitengine/purego v0.8.4 // indirect
101121
github.com/fatih/color v1.18.0 // indirect
@@ -107,11 +127,16 @@ require (
107127
github.com/go-logr/logr v1.4.3 // indirect
108128
github.com/go-logr/stdr v1.2.2 // indirect
109129
github.com/go-ole/go-ole v1.3.0 // indirect
130+
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
131+
github.com/goccy/go-json v0.10.5 // indirect
132+
github.com/google/flatbuffers v25.9.23+incompatible // indirect
110133
github.com/google/uuid v1.6.0 // indirect
134+
github.com/gorilla/websocket v1.5.3 // indirect
111135
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 // indirect
112136
github.com/inconshreveable/mousetrap v1.1.0 // indirect
113137
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect
114138
github.com/json-iterator/go v1.1.12 // indirect
139+
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
115140
github.com/kylelemons/godebug v1.1.0 // indirect
116141
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
117142
github.com/lufia/plan9stats v0.0.0-20250317134145-8bc96cf8fc35 // indirect
@@ -142,7 +167,7 @@ require (
142167
github.com/paulmach/orb v0.11.1 // indirect
143168
github.com/pierrec/lz4/v4 v4.1.22 // indirect
144169
github.com/pkg/errors v0.9.1 // indirect
145-
github.com/pmezard/go-difflib v1.0.0 // indirect
170+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
146171
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
147172
github.com/prometheus/procfs v0.16.1 // indirect
148173
github.com/rivo/uniseg v0.4.7 // indirect
@@ -151,11 +176,18 @@ require (
151176
github.com/shopspring/decimal v1.4.0 // indirect
152177
github.com/sirupsen/logrus v1.9.3 // indirect
153178
github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091 // indirect
179+
github.com/tidwall/gjson v1.18.0 // indirect
180+
github.com/tidwall/match v1.1.1 // indirect
181+
github.com/tidwall/pretty v1.2.1 // indirect
182+
github.com/tidwall/sjson v1.2.5 // indirect
154183
github.com/tklauser/go-sysconf v0.3.15 // indirect
155184
github.com/tklauser/numcpus v0.10.0 // indirect
156185
github.com/twmb/franz-go/pkg/kmsg v1.12.0 // indirect
157186
github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec // indirect
187+
github.com/yosida95/uritemplate/v3 v3.0.2 // indirect
188+
github.com/yuin/goldmark v1.7.12 // indirect
158189
github.com/yusufpapurcu/wmi v1.2.4 // indirect
190+
github.com/zeebo/xxh3 v1.0.2 // indirect
159191
go.mongodb.org/mongo-driver v1.12.2 // indirect
160192
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
161193
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
@@ -169,11 +201,15 @@ require (
169201
go.yaml.in/yaml/v2 v2.4.3 // indirect
170202
go.yaml.in/yaml/v3 v3.0.4 // indirect
171203
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
172-
golang.org/x/crypto v0.45.0 // indirect
173-
golang.org/x/sync v0.18.0 // indirect
174-
golang.org/x/term v0.37.0 // indirect
175-
golang.org/x/text v0.31.0 // indirect
204+
golang.org/x/crypto v0.46.0 // indirect
205+
golang.org/x/exp v0.0.0-20251209150349-8475f28825e9 // indirect
206+
golang.org/x/oauth2 v0.32.0 // indirect
207+
golang.org/x/sync v0.19.0 // indirect
208+
golang.org/x/telemetry v0.0.0-20251208220230-2638a1023523 // indirect
209+
golang.org/x/term v0.38.0 // indirect
210+
golang.org/x/text v0.32.0 // indirect
176211
golang.org/x/time v0.12.0 // indirect
212+
golang.org/x/tools v0.40.0 // indirect
177213
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
178214
google.golang.org/genproto/googleapis/rpc v0.0.0-20251022142026-3a174f9686a8 // indirect
179215
)

0 commit comments

Comments
 (0)