File tree Expand file tree Collapse file tree 3 files changed +426
-0
lines changed Expand file tree Collapse file tree 3 files changed +426
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ The MCP Registry service provides a centralized repository for MCP server entrie
30
30
│ └── service/ # Business logic
31
31
├── pkg/ # Public libraries
32
32
├── scripts/ # Utility scripts
33
+ ├── tools/ # Command line tools
34
+ │ └── importer/ # MongoDB data importer tool
33
35
└── build/ # Build artifacts
34
36
```
35
37
@@ -109,6 +111,19 @@ The fake service is useful for:
109
111
- Testing API integrations
110
112
- Example data structure reference
111
113
114
+ ## Tools
115
+
116
+ ### Data Importer
117
+
118
+ A command-line tool for importing server data from a JSON file into a MongoDB database:
119
+
120
+ ``` bash
121
+ cd tools/importer
122
+ go run main.go -uri mongodb://localhost:27017 -db mcp_registry -collection servers -seed ../../data/seed.json
123
+ ```
124
+
125
+ For more details on the importer tool, see the [ importer README] ( ./tools/importer/README.md ) .
126
+
112
127
## API Documentation
113
128
114
129
The API is documented using Swagger/OpenAPI. You can access the interactive Swagger UI at:
Original file line number Diff line number Diff line change
1
+ # MCP Registry Importer Tool
2
+
3
+ This command-line tool imports server data from a JSON file into a MongoDB database for the Model Context Protocol Registry.
4
+
5
+ ## Usage
6
+
7
+ ``` bash
8
+ go run main.go [options]
9
+ ```
10
+
11
+ ### Options
12
+
13
+ - ` -uri string ` : MongoDB connection URI (default "mongodb://localhost:27017")
14
+ - ` -db string ` : MongoDB database name (default "mcp_registry")
15
+ - ` -collection string ` : MongoDB collection name (default "servers")
16
+ - ` -seed string ` : Path to seed.json file (default: looks for data/seed.json relative to current directory)
17
+ - ` -drop ` : Drop collection before importing (default false)
18
+
19
+ ### Examples
20
+
21
+ Import data using default settings:
22
+ ``` bash
23
+ go run main.go
24
+ ```
25
+
26
+ Import data into a specific MongoDB instance:
27
+ ``` bash
28
+ go run main.go -uri mongodb://username:
[email protected] :27017 -db registry
29
+ ```
30
+
31
+ Import data from a specific seed file and replace all existing data:
32
+ ``` bash
33
+ go run main.go -seed /path/to/custom-seed.json -drop
34
+ ```
35
+
36
+ ## Building
37
+
38
+ To build the tool as an executable:
39
+
40
+ ``` bash
41
+ go build -o registry-importer
42
+ ```
43
+
44
+ Then you can run it directly:
45
+
46
+ ``` bash
47
+ ./registry-importer [options]
48
+ ```
You can’t perform that action at this time.
0 commit comments