You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The easiest way to get the registry running is to use `docker compose`. This will setup the MCP Registry service, import the seed data and run MongoDB in a local Docker environment.
40
40
41
41
```bash
42
+
# Build the Docker image
43
+
make docker
44
+
42
45
# Run the registry and MongoDB with docker compose
43
-
docker compose up --build
46
+
make dev-compose
44
47
```
45
48
46
49
This will start the MCP Registry service and MongoDB with Docker, exposing it on port 8080.
@@ -51,27 +54,68 @@ If you prefer to run the service locally without Docker, you can build and run i
51
54
52
55
```bash
53
56
# Build a registry executable
54
-
go build ./cmd/registry
57
+
make build
55
58
```
56
59
This will create the `registry` binary in the current directory. You'll need to have MongoDB running locally or with Docker.
57
60
58
61
By default, the service will run on `http://localhost:8080`.
59
62
60
63
## Development
61
64
65
+
### Available Make Targets
66
+
67
+
To see all available make targets:
68
+
69
+
```bash
70
+
make help
71
+
```
72
+
73
+
Key development commands:
74
+
75
+
```bash
76
+
# Build targets
77
+
make build # Build the registry application
78
+
make publisher # Build the publisher tool
79
+
make docker # Build Docker image
80
+
81
+
# Development
82
+
make dev-compose # Start development environment with Docker Compose
83
+
make dev-local # Run registry locally (requires MongoDB)
84
+
85
+
# Testing
86
+
make test# Run unit tests with coverage
87
+
make integration-test # Run integration tests
88
+
make test-endpoints # Test API endpoints (requires running server)
89
+
make test-publish # Test publish endpoint (requires BEARER_TOKEN)
90
+
91
+
# Code quality
92
+
make lint # Run linter (same as CI)
93
+
make lint-fix # Run linter with auto-fix
94
+
95
+
# Validation
96
+
make validate-schemas # Validate JSON schemas
97
+
make validate-examples # Validate examples against schemas
98
+
make validate # Run all validation checks
99
+
100
+
# Combined workflows
101
+
make check # Run all checks (lint, validate, test)
102
+
make pre-commit # Run all pre-commit checks (includes integration tests)
103
+
104
+
# Utilities
105
+
make coverage # Generate test coverage report
106
+
make clean # Clean build artifacts and coverage files
107
+
```
108
+
62
109
### Linting
63
110
64
111
The project uses golangci-lint with extensive checks. Always run linting before pushing:
65
112
66
113
```bash
67
114
# Run all linters (same as CI)
68
-
golangci-lint run --timeout=5m
69
-
70
-
# Check formatting
71
-
gofmt -s -l .
115
+
make lint
72
116
73
-
#Fix formatting
74
-
gofmt -s -w .
117
+
#Run linter with auto-fix
118
+
make lint-fix
75
119
```
76
120
77
121
### Git Hooks (Optional)
@@ -333,19 +377,67 @@ The service can be configured using environment variables:
333
377
334
378
## Testing
335
379
336
-
Run the test script to validate API endpoints:
380
+
### Unit Tests
337
381
338
382
```bash
339
-
./scripts/test_endpoints.sh
383
+
# Run unit tests with coverage
384
+
make test
385
+
386
+
# Generate coverage report
387
+
make coverage
340
388
```
341
389
342
-
You can specify specific endpoints to test:
390
+
### Integration Tests
391
+
392
+
```bash
393
+
# Run integration tests
394
+
make integration-test
395
+
```
396
+
397
+
### API Endpoint Testing
398
+
399
+
```bash
400
+
# Test API endpoints (requires running server)
401
+
make test-endpoints
402
+
```
403
+
404
+
You can also run the script directly with specific endpoints:
343
405
344
406
```bash
345
407
./scripts/test_endpoints.sh --endpoint health
346
408
./scripts/test_endpoints.sh --endpoint servers
347
409
```
348
410
411
+
### Publish Endpoint Testing
412
+
413
+
```bash
414
+
# Test publish endpoint (requires BEARER_TOKEN env var)
415
+
make test-publish
416
+
```
417
+
418
+
### Validation
419
+
420
+
```bash
421
+
# Validate JSON schemas
422
+
make validate-schemas
423
+
424
+
# Validate examples against schemas
425
+
make validate-examples
426
+
427
+
# Run all validation checks
428
+
make validate
429
+
```
430
+
431
+
### Comprehensive Testing
432
+
433
+
```bash
434
+
# Run all checks (lint, validate, test)
435
+
make check
436
+
437
+
# Run all pre-commit checks (includes integration tests)
0 commit comments