Mock UDR created via 3GPP specs for testing purpose
  • Go 90.6%
  • Makefile 4.6%
  • Dockerfile 2.5%
  • Nix 2.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-06-20 19:03:13 +05:30
cmd security: validate session ID in dynamic routing middleware and MCP tool handlers 2026-06-20 19:03:03 +05:30
docs docs: move getting started and verification guide to separate file 2026-06-15 21:21:16 +05:30
internal test: add integration tests for nested patch, validation, and sub-resources 2026-06-20 19:03:13 +05:30
.env.example mcp: rename port env variable to MCP_PORT 2026-06-20 18:53:16 +05:30
.envrc nix: configure Nix Flakes devShell and direnv 2026-06-15 12:43:17 +05:30
.gitignore mcp: implement MongoDB MCP server for session management 2026-06-15 18:48:29 +05:30
codegen-config.yaml build: add Makefile, stubgen tool, and codegen configuration 2026-06-15 12:43:17 +05:30
docker-compose.yml mcp: rename port env variable to MCP_PORT 2026-06-20 18:53:16 +05:30
Dockerfile docker: add Dockerfile 2026-06-20 16:46:11 +05:30
flake.lock docs: add README.md documentation 2026-06-15 12:43:18 +05:30
flake.nix nix: configure Nix Flakes devShell and direnv 2026-06-15 12:43:17 +05:30
go.mod mcp: implement MongoDB MCP server for session management 2026-06-15 18:48:29 +05:30
go.sum mcp: implement MongoDB MCP server for session management 2026-06-15 18:48:29 +05:30
LICENSE nix: configure Nix Flakes devShell and direnv 2026-06-15 12:43:17 +05:30
Makefile mcp: implement MongoDB MCP server for session management 2026-06-15 18:48:29 +05:30
README.md docs: document environment variables in README 2026-06-20 18:53:24 +05:30

UDR Mock Server (5G Core)

A test Unified Data Repository (UDR) mock server in Go, compliant with 3GPP 5G Core Service-Based Architecture. The RESTful routes, models, and server stubs are dynamically generated from the official 3GPP OpenAPI specifications (TS29504_Nudr_DR.yaml).

Project Structure

  • flake.nix: Declares the Nix Flake environment containing packages (Go, Git, Make, NodeJS).
  • .envrc: Configures direnv to automatically activate the flake shell.
  • Makefile: Automates setup, code generation, compilation, and testing.
  • codegen-config.yaml: Configuration for oapi-codegen to output Go-Chi routing.
  • cmd/udr/main.go: Application entrypoint that connects to MongoDB and initializes routes.
  • cmd/stubgen/main.go: Generates Go stubs for the 150+ routes of ServerInterface from the OpenAPI spec.
  • internal/api/: Holds the generated OpenAPI types/stubs and dispatcher handler.
  • internal/datastore/mongo.go: Stateful, path-based MongoDB CRUD wrapper.

Prerequisites

  • nix package manager (with flakes enabled).
  • docker (for running local MongoDB instances).

Getting Started & Usage

For details on building, running, verifying, and cleaning up the mock server, please see the Getting Started and Verification Guide.


Configuration

Both the UDR Mock Server and the MongoDB MCP Server can be configured using environment variables. You can customize them in your local environment, via a .env file, or inside docker containers.

Common Configuration

Environment Variable Default Value Description
MONGODB_URI mongodb://localhost:27017 MongoDB connection URI string
MONGODB_DB udr Default MongoDB database name

UDR Mock Server Configuration

Environment Variable Default Value Description
PORT 8080 Port for the UDR HTTP server

MCP MongoDB Server Configuration

Environment Variable Default Value Description
MCP_TRANSPORT stdio MCP transport protocol mode (stdio or sse)
MCP_PORT 8081 Port for the MCP server (used ONLY when MCP_TRANSPORT=sse)