mcp-molecules 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. mcp_molecules-0.1.0/.githooks/pre-commit +21 -0
  2. mcp_molecules-0.1.0/.github/FUNDING.yml +11 -0
  3. mcp_molecules-0.1.0/.github/workflows/ci.yml +37 -0
  4. mcp_molecules-0.1.0/.github/workflows/release.yml +45 -0
  5. mcp_molecules-0.1.0/.gitignore +36 -0
  6. mcp_molecules-0.1.0/.mcp.json +10 -0
  7. mcp_molecules-0.1.0/CHANGELOG.md +24 -0
  8. mcp_molecules-0.1.0/LICENSE +674 -0
  9. mcp_molecules-0.1.0/PKG-INFO +118 -0
  10. mcp_molecules-0.1.0/README.md +98 -0
  11. mcp_molecules-0.1.0/TODO.txt +361 -0
  12. mcp_molecules-0.1.0/databases.txt +242 -0
  13. mcp_molecules-0.1.0/glama.json +4 -0
  14. mcp_molecules-0.1.0/pyproject.toml +54 -0
  15. mcp_molecules-0.1.0/src/mcp_molecules/__init__.py +11 -0
  16. mcp_molecules-0.1.0/src/mcp_molecules/__main__.py +15 -0
  17. mcp_molecules-0.1.0/src/mcp_molecules/cache.py +377 -0
  18. mcp_molecules-0.1.0/src/mcp_molecules/data/names_pubchem.db +0 -0
  19. mcp_molecules-0.1.0/src/mcp_molecules/data/nist_atomic_weights.json +54207 -0
  20. mcp_molecules-0.1.0/src/mcp_molecules/formula.py +117 -0
  21. mcp_molecules-0.1.0/src/mcp_molecules/isotopes.py +225 -0
  22. mcp_molecules-0.1.0/src/mcp_molecules/names.py +290 -0
  23. mcp_molecules-0.1.0/src/mcp_molecules/naming.py +67 -0
  24. mcp_molecules-0.1.0/src/mcp_molecules/remote.py +192 -0
  25. mcp_molecules-0.1.0/src/mcp_molecules/server.py +344 -0
  26. mcp_molecules-0.1.0/src/mcp_molecules/weights.py +160 -0
  27. mcp_molecules-0.1.0/tests/conftest.py +26 -0
  28. mcp_molecules-0.1.0/tests/test_cache_remote.py +411 -0
  29. mcp_molecules-0.1.0/tests/test_compound_lookup_functional.py +225 -0
  30. mcp_molecules-0.1.0/tests/test_functional_wikidata.py +82 -0
  31. mcp_molecules-0.1.0/tests/test_isotopes_functional.py +207 -0
  32. mcp_molecules-0.1.0/tests/test_mwc_functional.py +248 -0
  33. mcp_molecules-0.1.0/tests/test_names.py +203 -0
  34. mcp_molecules-0.1.0/tests/test_server.py +253 -0
  35. mcp_molecules-0.1.0/tools/build_namedb.py +177 -0
  36. mcp_molecules-0.1.0/tools/curate.py +89 -0
  37. mcp_molecules-0.1.0/tools/fetch_pubchem.py +117 -0
  38. mcp_molecules-0.1.0/tools/fetch_wikidata.py +143 -0
  39. mcp_molecules-0.1.0/tools/name_filter.py +133 -0
  40. mcp_molecules-0.1.0/tools/verify_names.py +32 -0
  41. mcp_molecules-0.1.0/uv.lock +1244 -0
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env bash
2
+ # Mirror the CI gate locally: format staged Python files and lint them before
3
+ # the commit lands, so unformatted code can't reach CI.
4
+ # Enable with: git config core.hooksPath .githooks
5
+ set -euo pipefail
6
+
7
+ # Staged Python files (Added/Copied/Modified/Renamed), NUL-delimited for safety.
8
+ mapfile -d '' -t files < <(
9
+ git diff --cached --name-only --diff-filter=ACMR -z -- '*.py'
10
+ )
11
+ [ ${#files[@]} -eq 0 ] && exit 0
12
+
13
+ # Auto-format, then re-stage anything ruff changed.
14
+ uv run ruff format -- "${files[@]}"
15
+ git add -- "${files[@]}"
16
+
17
+ # Lint with the same ruleset CI uses; block the commit on any remaining issue.
18
+ if ! uv run ruff check -- "${files[@]}"; then
19
+ echo "pre-commit: ruff check failed -- fix the issues above and re-commit." >&2
20
+ exit 1
21
+ fi
@@ -0,0 +1,11 @@
1
+ # GitHub Sponsors / funding configuration.
2
+ # This enables the "Sponsor" button on the repository.
3
+ # Sponsorship tiers (and their perks) are configured in the GitHub Sponsors
4
+ # dashboard, not in this file.
5
+
6
+ github: [laszlopere]
7
+
8
+ # Other funding platforms are also supported, e.g.:
9
+ # ko_fi: your_kofi_name
10
+ # liberapay: your_liberapay_name
11
+ # custom: ["https://example.com/donate"]
@@ -0,0 +1,37 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master, main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v6
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v7
21
+
22
+ - name: Install the project
23
+ # Let uv manage a project venv; installing into the runner's system
24
+ # Python fails under PEP 668 (externally managed).
25
+ run: uv sync --all-extras --python ${{ matrix.python-version }}
26
+
27
+ - name: Lint (ruff)
28
+ run: uv run ruff check .
29
+
30
+ - name: Format check (ruff)
31
+ run: uv run ruff format --check .
32
+
33
+ - name: Type-check (mypy)
34
+ run: uv run mypy
35
+
36
+ - name: Test (pytest)
37
+ run: uv run pytest -v
@@ -0,0 +1,45 @@
1
+ name: Release
2
+
3
+ # Publishes to PyPI via Trusted Publishing (OIDC) on a version tag, e.g. v0.2.0.
4
+ # No API tokens are stored: PyPI verifies the GitHub OIDC identity instead.
5
+ on:
6
+ push:
7
+ tags: ["v*"]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v6
14
+
15
+ - name: Install uv
16
+ uses: astral-sh/setup-uv@v7
17
+
18
+ - name: Build sdist and wheel
19
+ run: uv build
20
+
21
+ - name: Check distributions
22
+ run: uvx twine check dist/*
23
+
24
+ - name: Upload dist artifact
25
+ uses: actions/upload-artifact@v4
26
+ with:
27
+ name: dist
28
+ path: dist/
29
+
30
+ publish:
31
+ needs: build
32
+ runs-on: ubuntu-latest
33
+ # The trusted publisher on PyPI is bound to this environment name.
34
+ environment: pypi
35
+ permissions:
36
+ id-token: write # required for OIDC
37
+ steps:
38
+ - name: Download dist artifact
39
+ uses: actions/download-artifact@v4
40
+ with:
41
+ name: dist
42
+ path: dist/
43
+
44
+ - name: Publish to PyPI
45
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,36 @@
1
+ # Byte-compiled / optimized
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ build/
8
+ dist/
9
+ *.egg-info/
10
+ .eggs/
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ venv/
15
+
16
+ # Test / tooling caches
17
+ .pytest_cache/
18
+ .ruff_cache/
19
+ .mypy_cache/
20
+ .coverage
21
+ htmlcov/
22
+
23
+ # Build artifacts: raw datasets fetched by tools/ and generated scratch/cache DBs
24
+ *.jsonl
25
+ *.db
26
+ # ...except the bundled name subset, which IS version-tracked and ships in the
27
+ # wheel (regenerate with tools/build_namedb.py, then commit the result).
28
+ !src/mcp_molecules/data/names_pubchem.db
29
+
30
+ # Editors
31
+ .idea/
32
+ .vscode/
33
+ *.swp
34
+
35
+ # Claude Code local settings (personal, not shared)
36
+ .claude/settings.local.json
@@ -0,0 +1,10 @@
1
+ {
2
+ "mcpServers": {
3
+ "molecules": {
4
+ "type": "stdio",
5
+ "command": "mcp-molecules",
6
+ "args": [],
7
+ "env": {}
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,24 @@
1
+ # Changelog
2
+
3
+ All notable changes to **mcp-molecules** are documented here.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0.dev0] - 2026-06-15
9
+
10
+ Initial scaffold.
11
+
12
+ ### Added
13
+ - Project skeleton modelled on the other `mcp-*` servers: src-layout,
14
+ hatchling build, FastMCP server, CI + PyPI Trusted Publishing workflows,
15
+ GitHub Sponsors and Glama configuration.
16
+ - `info` tool — server availability / version / environment health check.
17
+ - `molecular_weight_calculator` tool — molar-mass calculation ported from the C
18
+ `mwc` tool (byte-for-byte parity): recursive-descent formula parser with nested
19
+ groups and isotope labels (`D`, `T`), unit selection (g/mol, kg/mol, Da, u,
20
+ kDa), propagated NIST uncertainties, monoisotopic masses, and percent
21
+ composition by mass.
22
+ - Bundled NIST Atomic Weights and Isotopic Compositions data
23
+ (`nist_atomic_weights.json`) as package data for the forthcoming
24
+ implementation.