-
Notifications
You must be signed in to change notification settings - Fork 555
feat(config): specify to use in-memory database #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(config): specify to use in-memory database #74
Conversation
|
👋🏾 thanks for contributing! Once the merge conflicts are resolved and checks are passing, I'd be happy to merge this in. 🙇🏾 |
530dc30 to
0de1c98
Compare
|
Hey @sridharavinash , thanks for your reply! Review please. |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Add support for selecting either MongoDB or an in-memory database via a new DATABASE_TYPE configuration.
- Introduces a
DatabaseTypeenum inConfigwith a default of"mongodb" - Updates
main.goto initialize either MongoDB or memory-backed storage based oncfg.DatabaseType - Documents the new environment variable in
README.md
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/config/config.go | Defined DatabaseType constants and added a DatabaseType field |
| cmd/registry/main.go | Switched database initialization based on cfg.DatabaseType |
| README.md | Documented the MCP_REGISTRY_DATABASE_TYPE environment variable |
Comments suppressed due to low confidence (2)
README.md:292
- The README documents
MCP_REGISTRY_DATABASE_TYPE, but the code is readingDATABASE_TYPE. Update either the code or the docs so they stay in sync.
| `MCP_REGISTRY_DATABASE_TYPE` | Database type | `mongodb` |
cmd/registry/main.go:43
- The new in-memory database branch isn’t covered by any existing tests. Consider adding unit or integration tests to verify behavior when
DATABASE_TYPE=memory.
switch cfg.DatabaseType {
sridharavinash
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this ✨ ! 🙇🏾
|
thank you all for this great and timely work ❤️ |
<!-- Provide a brief summary of your changes --> Add support for specifying database type (MongoDB or in-memory database). ## Motivation and Context <!-- Why is this change needed? What problem does it solve? --> The README states that MCP Registry supports both MongoDB and in-memory databases, but does not provide the capability to specify which database type to use. https://github.com/modelcontextprotocol/registry/blob/5d9171bdccf579398273806a7067cda29e88363c/README.md?plain=1#L19 This PR addresses this limitation by adding explicit database type configuration through the `DATABASE_TYPE` environment variable, allowing users to choose between `mongodb` and `memory` database types in a standardized way. ## How Has This Been Tested? <!-- Have you tested this in a real application? Which scenarios were tested? --> Yes ```console $ export MCP_REGISTRY_DATABASE_TYPE="memory" $ ./scripts/test_endpoints.sh Testing health endpoint: http://localhost:8080/v0/health Status Code: 200 Response: { "status": "ok", "github_client_id": "" } Health check successful ------------------------------------- Testing servers endpoint: http://localhost:8080/v0/servers Status Code: 200 Response Summary: Total registries: 0 servers Names: Pagination Metadata: {} servers Details: { "servers": [], "metadata": {} } servers request successful ------------------------------------- Testing ping endpoint: http://localhost:8080/v0/ping Status Code: 200 Response: { "status": "ok", "version": "dev" } Ping successful ------------------------------------- All tests passed successfully! ``` ## Breaking Changes <!-- Will users need to update their code or configurations? --> No ## 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) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] 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 <!-- Add any other context, implementation notes, or design decisions --> Close #63 --------- Co-authored-by: Avinash Sridhar <[email protected]> Co-authored-by: Copilot <[email protected]>
Add support for specifying database type (MongoDB or in-memory database).
Motivation and Context
The README states that MCP Registry supports both MongoDB and in-memory databases, but does not provide the capability to specify which database type to use.
registry/README.md
Line 19 in 5d9171b
This PR addresses this limitation by adding explicit database type configuration through the
DATABASE_TYPEenvironment variable, allowing users to choose betweenmongodbandmemorydatabase types in a standardized way.How Has This Been Tested?
Yes
Breaking Changes
No
Types of changes
Checklist
Additional context
Close #63