registry
registry copied to clipboard
feat(config): specify to use in-memory database
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.
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?
Yes
$ 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
No
Types of changes
- [ ] 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
- [x] I have read the MCP Documentation
- [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
Close #63