Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/import-records.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,14 @@ jobs:
echo "--- Processing Entry $((${{ matrix.entry.index }} + 1)) ---"

CIDS_FILE="imported-cids-${{ matrix.entry.index }}.txt"
# TODO: Uncomment when the importer supports saving per-record JSON files.
# DRY_RUN_DIR="dry-run-output-${{ matrix.entry.index }}"
CMD=("${DIRCTL_PATH}" import --type=mcp-registry --url=https://registry.modelcontextprotocol.io/v0.1 --server-addr="${{ env.SERVER_ADDRESS }}" --auth-mode=oidc "--auth-token=${DIR_AUTH_TOKEN}" --enrich-config=mcphost_ci.json --enrich-rate-limit="${{ env.RATE_LIMIT }}")

if [[ "${{ env.DRY_RUN }}" == "true" ]]; then
CMD+=("--dry-run")
# TODO: Replace with the following block when the importer supports saving per-record JSON files.
# CMD+=("--dry-run" "--output-dir=$DRY_RUN_DIR")
else
# Output CIDs for deferred signing (only in non-dry-run mode)
CMD+=("--output-cids=$CIDS_FILE")
Expand Down Expand Up @@ -209,6 +213,20 @@ jobs:
cat "$JSONL_FILE"
fi

# TODO: Replace print above with the following block when the importer supports saving per-record JSON files.
# # Print per-record JSON files (dry-run mode). The importer writes one
# # <cid>.record.json per record into $DRY_RUN_DIR.
# if [[ "${{ env.DRY_RUN }}" == "true" ]] && [ -d "$DRY_RUN_DIR" ]; then
# shopt -s nullglob
# RECORD_FILES=("$DRY_RUN_DIR"/*.record.json)
# echo "--- Dry-run records ($DRY_RUN_DIR): ${#RECORD_FILES[@]} file(s) ---"
# for f in "${RECORD_FILES[@]}"; do
# echo "=== $(basename "$f") ==="
# cat "$f"
# echo
# done
# fi

# Output CIDs file path for signing step
echo "cids_file=$CIDS_FILE" >> $GITHUB_OUTPUT

Expand Down
6 changes: 4 additions & 2 deletions cli/cmd/import/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Examples (Agent Skill directory):

Preview and output:
dirctl import --type=mcp-registry --url=https://registry.modelcontextprotocol.io/v0.1 --dry-run
dirctl import --type=mcp-registry --url=https://registry.modelcontextprotocol.io/v0.1 --dry-run --output-dir=./out
dirctl import --type=mcp-registry --url=https://registry.modelcontextprotocol.io/v0.1 --output-cids=./imported.cids

Enrichment (MCPHost / LLM):
Expand Down Expand Up @@ -156,8 +157,9 @@ func printSummary(cmd *cobra.Command, result *types.ImportResult) {
if opts.DryRun {
presenter.Printf(cmd, "\nNote: This was a dry run. No records were actually imported.\n")

if result.OutputFile != "" {
presenter.Printf(cmd, "Records saved to: %s\n", result.OutputFile)
if result.OutputDir != "" {
presenter.Printf(cmd, "Records saved to directory: %s\n", result.OutputDir)
presenter.Printf(cmd, "Each record is written as <cid>.record.json and can be re-imported via dirctl push.\n")
}
}
}
3 changes: 2 additions & 1 deletion cli/cmd/import/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ func init() {
signcmd.AddSigningFlags(flags)

// Common flags
flags.BoolVar(&opts.DryRun, "dry-run", false, "Preview without importing")
flags.BoolVar(&opts.DryRun, "dry-run", false, "Preview without importing; transformed records are written to --output-dir (one JSON file per record) so they can be re-imported later via `dirctl import`")
flags.StringVar(&opts.OutputDir, "output-dir", "", "Directory to write per-record JSON files when --dry-run is set (defaults to ./import-dry-run-<timestamp> in the current working directory)")
flags.BoolVar(&opts.Force, "force", false, "Force push even if record already exists")
flags.BoolVar(&opts.Debug, "debug", false, "Enable debug output for deduplication and validation failures")

Expand Down
4 changes: 2 additions & 2 deletions cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ replace (

require (
buf.build/gen/go/agntcy/oasf/protocolbuffers/go v1.36.11-20260427075301-21bf512e44c9.1
github.com/agntcy/dir-importer v1.3.0
github.com/agntcy/dir-importer v1.3.1-0.20260513134649-3276412ac13b
github.com/agntcy/dir-mcp v1.3.0
github.com/agntcy/dir-runtime/discovery v1.3.0
github.com/agntcy/dir-runtime/server v1.3.0
Expand Down Expand Up @@ -499,7 +499,7 @@ require (
github.com/libp2p/go-reuseport v0.4.0 // indirect
github.com/libp2p/go-yamux/v5 v5.1.0 // indirect
github.com/libp2p/zeroconf/v2 v2.2.0 // indirect
github.com/mark3labs/mcp-go v0.52.0 // indirect
github.com/mark3labs/mcp-go v0.53.0 // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/mattn/go-isatty v0.0.22 // indirect
github.com/miekg/dns v1.1.72 // indirect
Expand Down
8 changes: 4 additions & 4 deletions cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7l
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/agnivade/levenshtein v1.2.1 h1:EHBY3UOn1gwdy/VbFwgo4cxecRznFk7fKWN1KOX7eoM=
github.com/agnivade/levenshtein v1.2.1/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU=
github.com/agntcy/dir-importer v1.3.0 h1:biojlL4BQI6xoaem3/uZuWZ8E+ud/r2O3KyErUM0oQU=
github.com/agntcy/dir-importer v1.3.0/go.mod h1:AUIqEJONjwI+W3fI3q7UGuHTu9TR9TRgJcQwlJcV+Ig=
github.com/agntcy/dir-importer v1.3.1-0.20260513134649-3276412ac13b h1:BmhkPF1nUFhRrR8wz5txVQ1EyOKdwYP5dVaPqLug0Rg=
github.com/agntcy/dir-importer v1.3.1-0.20260513134649-3276412ac13b/go.mod h1:EYqzt4Cqz+1iid4/aTWUNbzqVLvRStyy2VCEqe8l6FM=
github.com/agntcy/dir-mcp v1.3.0 h1:xG7qkcsile69u0I7x3VrSvyVKT0NuBlgDK29WrHo5dg=
github.com/agntcy/dir-mcp v1.3.0/go.mod h1:4GqrwnqlzBvzkrnd0DV3N0iq7rRANtOlQ2aMIzrLQHo=
github.com/agntcy/dir-runtime/discovery v1.3.0 h1:sQuSA/QyxeHES9ayVVVhX1NuTGwNuRmioXk2mZgXFmc=
Expand Down Expand Up @@ -1174,8 +1174,8 @@ github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8S
github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/marcopolo/simnet v0.0.4 h1:50Kx4hS9kFGSRIbrt9xUS3NJX33EyPqHVmpXvaKLqrY=
github.com/marcopolo/simnet v0.0.4/go.mod h1:tfQF1u2DmaB6WHODMtQaLtClEf3a296CKQLq5gAsIS0=
github.com/mark3labs/mcp-go v0.52.0 h1:uRSzupNSUyPGDpF4owY5X4zEpACPwBnlM3FAFuXN6gQ=
github.com/mark3labs/mcp-go v0.52.0/go.mod h1:Zg9cB2HdwdMMVgY0xtTzq3KvYIOJQDsaut+jWjwDaQY=
github.com/mark3labs/mcp-go v0.53.0 h1:nzjUi/L448XxwrfmVjiZ03vWgYOWVBrJK0wkZH7fVWo=
github.com/mark3labs/mcp-go v0.53.0/go.mod h1:Zg9cB2HdwdMMVgY0xtTzq3KvYIOJQDsaut+jWjwDaQY=
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk=
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU=
github.com/masahiro331/go-disk v0.0.0-20260423015231-f7a470ebd472 h1:QAY4If99Ee10TUP4mdcB6Qlm036ayfYruTLjvlaczbs=
Expand Down
4 changes: 2 additions & 2 deletions tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ replace (
replace github.com/ThalesIgnite/crypto11 => github.com/ThalesGroup/crypto11 v1.6.0

require (
github.com/agntcy/dir-importer v1.3.0
github.com/agntcy/dir-importer v1.3.1-0.20260513134649-3276412ac13b
github.com/agntcy/dir/api v1.3.0
github.com/agntcy/dir/cli v1.3.0
github.com/agntcy/dir/client v1.3.0
Expand Down Expand Up @@ -366,7 +366,7 @@ require (
github.com/libp2p/zeroconf/v2 v2.2.0 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/lunixbochs/struc v0.0.0-20241101090106-8d528fa2c543 // indirect
github.com/mark3labs/mcp-go v0.52.0 // indirect
github.com/mark3labs/mcp-go v0.53.0 // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/masahiro331/go-disk v0.0.0-20260423015231-f7a470ebd472 // indirect
github.com/masahiro331/go-ebs-file v0.0.0-20260422020928-9d24e29aac27 // indirect
Expand Down
8 changes: 4 additions & 4 deletions tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7l
github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/agnivade/levenshtein v1.2.1 h1:EHBY3UOn1gwdy/VbFwgo4cxecRznFk7fKWN1KOX7eoM=
github.com/agnivade/levenshtein v1.2.1/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU=
github.com/agntcy/dir-importer v1.3.0 h1:biojlL4BQI6xoaem3/uZuWZ8E+ud/r2O3KyErUM0oQU=
github.com/agntcy/dir-importer v1.3.0/go.mod h1:AUIqEJONjwI+W3fI3q7UGuHTu9TR9TRgJcQwlJcV+Ig=
github.com/agntcy/dir-importer v1.3.1-0.20260513134649-3276412ac13b h1:BmhkPF1nUFhRrR8wz5txVQ1EyOKdwYP5dVaPqLug0Rg=
github.com/agntcy/dir-importer v1.3.1-0.20260513134649-3276412ac13b/go.mod h1:EYqzt4Cqz+1iid4/aTWUNbzqVLvRStyy2VCEqe8l6FM=
github.com/agntcy/dir-mcp v1.3.0 h1:xG7qkcsile69u0I7x3VrSvyVKT0NuBlgDK29WrHo5dg=
github.com/agntcy/dir-mcp v1.3.0/go.mod h1:4GqrwnqlzBvzkrnd0DV3N0iq7rRANtOlQ2aMIzrLQHo=
github.com/agntcy/dir-runtime/discovery v1.3.0 h1:sQuSA/QyxeHES9ayVVVhX1NuTGwNuRmioXk2mZgXFmc=
Expand Down Expand Up @@ -1183,8 +1183,8 @@ github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8S
github.com/magiconair/properties v1.8.10/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/marcopolo/simnet v0.0.4 h1:50Kx4hS9kFGSRIbrt9xUS3NJX33EyPqHVmpXvaKLqrY=
github.com/marcopolo/simnet v0.0.4/go.mod h1:tfQF1u2DmaB6WHODMtQaLtClEf3a296CKQLq5gAsIS0=
github.com/mark3labs/mcp-go v0.52.0 h1:uRSzupNSUyPGDpF4owY5X4zEpACPwBnlM3FAFuXN6gQ=
github.com/mark3labs/mcp-go v0.52.0/go.mod h1:Zg9cB2HdwdMMVgY0xtTzq3KvYIOJQDsaut+jWjwDaQY=
github.com/mark3labs/mcp-go v0.53.0 h1:nzjUi/L448XxwrfmVjiZ03vWgYOWVBrJK0wkZH7fVWo=
github.com/mark3labs/mcp-go v0.53.0/go.mod h1:Zg9cB2HdwdMMVgY0xtTzq3KvYIOJQDsaut+jWjwDaQY=
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk=
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU=
github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo=
Expand Down
Loading