Skip to main content

uid-generator-mcp

Standalone MCP server that issues globally unique 64-bit IDs (snowflake layout). Inspired by baidu/uid-generator (Apache-2.0), preserved and re-implemented in pure Python — no JVM needed.

Layout

sign(1) | timestamp(41, ms since 2026-01-01) | worker(10) | sequence(12)
  • 4096 IDs per ms per worker, 1024 workers, ~69 years of headroom.
  • Clock-rollback policy follows the upstream spirit: small rollbacks (≤5 ms) spin-wait; larger rollbacks are refused with ClockRollbackError instead of risking duplicates.
  • Worker IDs auto-allocate against a local lease file so multiple processes on one machine do not collide; override with UID_MCP_WORKER_ID.

Tools

tool purpose
issue_id issue one unique ID
issue_batch issue 1–1000 IDs, increasing in issue order
decode parse an ID back to timestamp / worker / sequence
worker_info show worker id and bit layout

Run

pip install -e .
python run_server.py          # stdio transport

Tests

python3 -m unittest discover tests -v

Covers: single-thread burst uniqueness (5000 IDs), 8-thread concurrency uniqueness (4000 IDs), monotonicity, decode round-trip, worker range and lease allocation.

License

Apache-2.0. The upstream project is preserved under tanbopiao/uid-generator.

Metadata

Release files for uid-generator-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for uid-generator-mcp 0.1.0
File Size Uploaded Provenance Actions
uid_generator_mcp-0.1.0.tar.gz 9.3 kB Without provenance Details for uid_generator_mcp-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uid-generator-mcp 0.1.0
File Interpreter ABI Platform Actions
uid_generator_mcp-0.1.0-py3-none-any.whl Python 3 none any Details for uid_generator_mcp-0.1.0-py3-none-any.whl

Total release size: 18.9 kB

Release files / uid_generator_mcp-0.1.0.tar.gz

Download URL uid_generator_mcp-0.1.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9a169f6129acc5eac0696fd2cb9818e4126b3dc10a0d308bd59fa18b1f651254
BLAKE2b-256 checksum
How to use checksums
6ee53f095ceb1edb56d0f439cfae2a33ed6c71490c19904a3a8eaf17dd7b8296
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / uid_generator_mcp-0.1.0-py3-none-any.whl

Download URL uid_generator_mcp-0.1.0-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e63c8cefa31d6712f2c87c6d56867aed6c6ad61282f508fbcbec457d5c778fe
BLAKE2b-256 checksum
How to use checksums
263aa382d35af4faf995bae12ec0885da523cfb4513eafd530c5001e0d351bab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for uid-generator-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page