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
Refactor database implementation to use PostgreSQL instead of MongoDB (#289)
Fixes#228
## Motivation and Context
See #19
## How Has This Been Tested?
- Run locally
- Run in docker compose
- Run infra in minikube
- Unit and integration tests all passing :)
## Breaking Changes
Yes: users will not be able to access any data they used to have in
custom mongodb. We are accepting this breaking change, given the
registry is in experimental development status.
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes
that apply. -->
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [x] I have added appropriate error handling
- [x] I have added or updated documentation as needed
## Additional context
I have not implemented connection pooling support for simplicity, and
because cloudnative-pg already provides built-in connection pooling with
pgBouncer so if we want it later we can switch to this endpoint easily.
Copy file name to clipboardExpand all lines: README.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ The MCP Registry service provides a centralized repository for MCP server entrie
24
24
- Health check endpoint for service monitoring
25
25
- Support for various environment configurations
26
26
- Graceful shutdown handling
27
-
-MongoDB and in-memory database support
27
+
-PostgreSQL and in-memory database support
28
28
- Comprehensive API documentation
29
29
- Pagination support for listing registry entries
30
30
- Seed data export/import composability with HTTP support
@@ -35,7 +35,7 @@ The MCP Registry service provides a centralized repository for MCP server entrie
35
35
### Prerequisites
36
36
37
37
- Go 1.24.x (required - check with `go version`)
38
-
-MongoDB
38
+
-PostgreSQL
39
39
- Docker (optional, but recommended for development)
40
40
41
41
For development:
@@ -46,14 +46,13 @@ For development:
46
46
47
47
## Running
48
48
49
-
The easiest way to get the registry running is uses docker compose. This will setup the MCP Registry service, import the seed data and run MongoDB in a local Docker environment.
49
+
The easiest way to get the registry running is uses docker compose. This will setup the MCP Registry service, import the seed data and run PostgreSQL in a local Docker environment.
50
50
51
51
```bash
52
-
# Run the registry and MongoDB with docker compose
53
52
make dev-compose
54
53
```
55
54
56
-
This will start the MCP Registry service and MongoDB with Docker, running at [`localhost:8080`](http://localhost:8080).
55
+
This will start the MCP Registry service running at [`localhost:8080`](http://localhost:8080).
57
56
58
57
## Building
59
58
@@ -63,15 +62,15 @@ If you prefer to run the service locally without Docker, you can build and run i
63
62
# Build a registry executable
64
63
make build
65
64
```
66
-
This will create the `registry` binary in the current directory. You'll need to have MongoDB running locally or with Docker.
65
+
This will create the `registry` binary in the current directory.
67
66
68
67
To run the service locally:
69
68
```bash
70
-
# Run registry locally (requires MongoDB)
69
+
# Run registry locally
71
70
make dev-local
72
71
```
73
72
74
-
By default, the service will run on [`localhost:8080`](http://localhost:8080).
73
+
By default, the service will run on [`localhost:8080`](http://localhost:8080). You'll need to use the in-memory database or have PostgreSQL running.
75
74
76
75
To build the CLI tool for publishing MCP servers to the registry:
77
76
@@ -95,11 +94,12 @@ Key development commands:
95
94
```bash
96
95
# Development
97
96
make dev-compose # Start development environment with Docker Compose
98
-
make dev-local # Run registry locally (requires MongoDB)
97
+
make dev-local # Run registry locally
99
98
100
99
# Build targets
101
100
make build # Build the registry application
102
101
make publisher # Build the publisher tool
102
+
make migrate # Build the database migration tool
103
103
104
104
# Testing
105
105
make test-unit # Run unit tests with coverage report
@@ -156,7 +156,7 @@ This will prevent commits that fail linting or have formatting issues.
156
156
│ ├── api/ # HTTP server and request handlers (routing)
157
157
│ ├── auth/ # GitHub OAuth integration
158
158
│ ├── config/ # Configuration management
159
-
│ ├── database/ # Data persistence abstraction (MongoDB and in-memory)
159
+
│ ├── database/ # Data persistence abstraction
160
160
│ ├── model/ # Data models and domain structures
161
161
│ └── service/ # Business logic implementation
162
162
├── pkg/ # Public libraries
@@ -175,9 +175,9 @@ This will prevent commits that fail linting or have formatting issues.
175
175
5. JSON responses returned to clients
176
176
177
177
### Key Interfaces
178
-
-**Database Interface** (`internal/database/database.go`) - Abstracts data persistence with MongoDB and memory implementations
178
+
-**Database Interface** (`internal/database/database.go`) - Abstracts data persistence with PostgreSQL and in-memory implementations
179
179
-**RegistryService** (`internal/service/service.go`) - Business logic abstraction over database
Copy file name to clipboardExpand all lines: deploy/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Pre-requisites:
11
11
- Access to a Kubernetes cluster via kubeconfig. You can run a cluster locally with [minikube](https://minikube.sigs.k8s.io/docs/start/).
12
12
13
13
1. Ensure your kubeconfig is configured at the cluster you want to use. For minikube, run `minikube start && minikube tunnel`.
14
-
2. Run `make local-up` to deploy the stack. Run this again if the first attempt fails.
14
+
2. Run `make local-up` to deploy the stack.
15
15
3. Access the repository via the ingress load balancer. You can find its external IP with `kubectl get svc ingress-nginx-controller -n ingress-nginx`. Then run `curl -H "Host: local.registry.modelcontextprotocol.io" -k https://<EXTERNAL-IP>/v0/ping` to check that the service is up.
0 commit comments