Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ jobs:

- name: Upload coverage to Codecov
if: success() && github.repository_owner == 'withtwoemms'
run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: false

- name: Archive coverage report
if: always()
Expand All @@ -61,6 +65,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
submodules: true

- name: Install uv
uses: astral-sh/setup-uv@v5
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/external/ucon-tools"]
path = docs/external/ucon-tools
url = https://github.com/withtwoemms/ucon-tools.git
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.9.4] - 2026-02-28

### Changed

- MCP subpackage extracted to [ucon-tools](https://github.com/withtwoemms/ucon-tools) (#212)
- Install MCP server via `pip install ucon-tools[mcp]`
- Core ucon package no longer has MCP dependencies
- Namespace package support via `pkgutil.extend_path()` enables coexistence

### Removed

- `ucon.mcp` subpackage (moved to ucon-tools)
- `ucon-mcp` CLI entry point (now in ucon-tools)
- `mcp` optional dependency
- MCP documentation (moved to ucon-tools, sourced via submodule)

## [0.9.3] - 2026-02-26

### Added
Expand Down Expand Up @@ -438,7 +454,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial commit

<!-- Links -->
[Unreleased]: https://github.com/withtwoemms/ucon/compare/0.9.3...HEAD
[Unreleased]: https://github.com/withtwoemms/ucon/compare/0.9.4...HEAD
[0.9.4]: https://github.com/withtwoemms/ucon/compare/0.9.3...0.9.4
[0.9.3]: https://github.com/withtwoemms/ucon/compare/0.9.2...0.9.3
[0.9.2]: https://github.com/withtwoemms/ucon/compare/0.9.1...0.9.2
[0.9.1]: https://github.com/withtwoemms/ucon/compare/0.9.0...0.9.1
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ${UV_VENV}: ${UV_INSTALLED}

${DEPS_INSTALLED}: pyproject.toml uv.lock | ${UV_VENV}
@echo "${GREEN}Syncing dependencies into ${UV_VENV}...${RESET}"
@UV_PROJECT_ENVIRONMENT=${UV_VENV} uv sync --python ${PYTHON} --extra test --extra pydantic --extra mcp
@UV_PROJECT_ENVIRONMENT=${UV_VENV} uv sync --python ${PYTHON} --extra test --extra pydantic
@touch ${DEPS_INSTALLED}

.PHONY: venv
Expand All @@ -74,7 +74,7 @@ install-test: ${UV_VENV}
.PHONY: install
install: ${UV_VENV}
@echo "${GREEN}Installing with all extras into ${UV_VENV}...${RESET}"
@UV_PROJECT_ENVIRONMENT=${UV_VENV} uv sync --python ${PYTHON} --extra test --extra pydantic --extra mcp
@UV_PROJECT_ENVIRONMENT=${UV_VENV} uv sync --python ${PYTHON} --extra test --extra pydantic

# --- Testing ---
.PHONY: test
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ With extras:

```bash
pip install ucon[pydantic] # Pydantic v2 integration
pip install ucon[mcp] # MCP server for AI agents
pip install ucon-tools[mcp] # MCP server for AI agents (separate package)
```

---
Expand Down Expand Up @@ -108,14 +108,18 @@ print(m.model_dump_json())

### MCP Server for AI Agents

Configure in Claude Desktop:
Install `ucon-tools` and configure in Claude Desktop:

```bash
pip install ucon-tools[mcp]
```

```json
{
"mcpServers": {
"ucon": {
"command": "uvx",
"args": ["--from", "ucon[mcp]", "ucon-mcp"]
"args": ["--from", "ucon-tools[mcp]", "ucon-mcp"]
}
}
}
Expand All @@ -128,7 +132,7 @@ AI agents can then convert units, check dimensions, and perform factor-label cal
## Features

- **Physical constants** — CODATA 2022 values with uncertainty propagation (`E = m * c**2`)
- **Custom constants** — Define domain-specific constants with uncertainty propagation via MCP or Python API
- **Custom constants** — Define domain-specific constants with uncertainty propagation
- **String parsing** — `parse("9.81 m/s^2")` with uncertainty support (`1.234 ± 0.005 m`)
- **Dimensional algebra** — Units combine through multiplication/division with automatic dimension tracking
- **Scale prefixes** — Full SI (kilo, milli, micro, etc.) and binary (kibi, mebi) prefix support
Expand Down
30 changes: 25 additions & 5 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ ucon is a dimensional analysis library for engineers building systems where unit
| v0.9.1 | Logarithmic Units | Complete |
| v0.9.2 | MCP Constants Tools | Complete |
| v0.9.3 | Natural Units + MCP Session Fixes | Complete |
| v0.9.4 | MCP Extraction | Complete |
| v0.10.0 | Scientific Computing | Planned |
| v1.0.0 | API Stability | Planned |

---

## Current Version: **v0.9.3** (complete)
## Current Version: **v0.9.4** (complete)

Building on v0.9.2 baseline:
Building on v0.9.3 baseline:
- `ucon.basis` (`Basis`, `BasisComponent`, `Vector`, `BasisTransform`, `BasisGraph`, `ConstantAwareBasisTransform`)
- `ucon.bases` (standard bases: `SI`, `CGS`, `CGS_ESU`, `NATURAL`; standard transforms including `SI_TO_NATURAL`)
- `ucon.dimension` (`Dimension` as frozen dataclass backed by basis-aware `Vector`)
Expand All @@ -63,7 +64,6 @@ Building on v0.9.2 baseline:
- `ucon.graph` (`ConversionGraph`, default graph, `get_default_graph()`, `using_graph()`, cross-basis conversion)
- `ucon.units` (SI + imperial + information + angle + ratio units, callable syntax, `si` and `imperial` systems, `get_unit_by_name()`)
- `ucon.pydantic` (`Number` type for Pydantic v2 models)
- `ucon.mcp` (`SessionState`, `DefaultSessionState` for injectable session management)
- Callable unit API: `meter(5)`, `(mile / hour)(60)`
- `Number.simplify()` for base-scale normalization
- Pseudo-dimensions: `ANGLE`, `SOLID_ANGLE`, `RATIO`, `COUNT` with semantic isolation
Expand All @@ -77,9 +77,8 @@ Building on v0.9.2 baseline:
- Quantity string parsing: `parse("1.234 ± 0.005 m")` → `Number` with uncertainty
- Physical constants: `Constant` class with CODATA 2022 values and uncertainty propagation
- Logarithmic units: pH with concentration dimension, dBm, dBW, dBV, dBSPL
- MCP constants tools: `list_constants()`, `define_constant()` for AI agent access
- Natural units: `NATURAL` basis with c=ℏ=k_B=1, `ConstantAwareBasisTransform` for non-square transforms
- MCP session persistence: lifespan-scoped session state across tool calls
- Namespace package support: `pkgutil.extend_path` enables coexistence with ucon-tools

---

Expand Down Expand Up @@ -213,6 +212,9 @@ Building on v0.9.2 baseline:

**Theme:** AI agent integration.

> **Note:** MCP functionality moved to [ucon-tools](https://github.com/withtwoemms/ucon-tools) in v0.9.4.
> Install via `pip install ucon-tools[mcp]`.

- [x] MCP server exposing unit conversion tools
- [x] `convert` tool with dimensional validation
- [x] `list_units`, `list_scales`, `list_dimensions` discovery tools
Expand Down Expand Up @@ -655,6 +657,24 @@ Prerequisite for factor-label chains with countable items (tablets, doses).

---

## v0.9.4 — MCP Extraction (Complete)

**Theme:** Separate MCP tooling into ucon-tools package.

- [x] Extract `ucon.mcp` subpackage to `ucon-tools` repository
- [x] Add `pkgutil.extend_path()` for namespace package coexistence
- [x] Remove MCP optional dependency and entry point from pyproject.toml
- [x] Update documentation to reference `ucon-tools[mcp]` for MCP features
- [x] MCP docs moved to ucon-tools (sourced via git submodule)

**Outcomes:**
- Core ucon package has no MCP dependencies (simpler install, broader compatibility)
- MCP tooling available via `pip install ucon-tools[mcp]`
- Namespace package allows both packages to coexist under `ucon.*`
- ucon-tools can iterate independently on AI agent features

---

## v0.10.0 — Scientific Computing

**Theme:** NumPy and DataFrame integration.
Expand Down
1 change: 1 addition & 0 deletions docs/external/ucon-tools
Submodule ucon-tools added at ed67aa
2 changes: 1 addition & 1 deletion docs/guides/custom-units-and-graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ucon's unit system is extensible. You can define domain-specific units and conversions for aerospace, medicine, finance, or any specialized field.

!!! tip "MCP Users"
For AI agent use cases, see [Custom Units via MCP](mcp-server/custom-units.md).
For AI agent use cases, see [Custom Units via MCP](../external/ucon-tools/docs/guides/mcp-server/custom-units.md).

## Unit Definition

Expand Down
6 changes: 3 additions & 3 deletions docs/guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Task-oriented guides for common use cases.

## MCP Server

- **[Overview](mcp-server/index.md)** - Setup and available tools
- **[Custom Units](mcp-server/custom-units.md)** - Define domain-specific units at runtime
- **[Registering Formulas](mcp-server/registering-formulas.md)** - Expose dimensionally-typed calculations to agents
- **[Overview](../external/ucon-tools/docs/guides/mcp-server/index.md)** - Setup and available tools
- **[Custom Units](../external/ucon-tools/docs/guides/mcp-server/custom-units.md)** - Define domain-specific units at runtime
- **[Registering Formulas](../external/ucon-tools/docs/guides/mcp-server/registering-formulas.md)** - Expose dimensionally-typed calculations to agents

## Integration Guides

Expand Down
85 changes: 0 additions & 85 deletions docs/guides/mcp-server/custom-units.md

This file was deleted.

Loading