Skip to content

Commit 3a4886d

Browse files
authored
Merge pull request #3 from Minitour/develop
Add CLI mode: all tools available as direct subcommands
2 parents 6168a60 + 3811acc commit 3a4886d

6 files changed

Lines changed: 916 additions & 46 deletions

File tree

README.md

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
[![Rust](https://img.shields.io/badge/rust-1.75%2B-orange.svg)](https://www.rust-lang.org/)
77
[![Node](https://img.shields.io/badge/node-%3E%3D18-green.svg)](https://nodejs.org/)
88

9-
A high-performance [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server for OWL ontology management, written in Rust.
9+
A high-performance [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server **and CLI** for OWL ontology management, written in Rust.
1010

1111
Built as a drop-in replacement for [ai4curation/owl-mcp](https://github.com/ai4curation/owl-mcp), designed to eliminate the crashes and timeouts inherent to the Python implementation. Axioms are expressed in [OWL Functional Syntax](https://www.w3.org/TR/owl2-syntax/).
1212

1313
## Features
1414

15-
- **19 MCP tools** — add, remove, search, and inspect axioms; manage prefixes and labels; register and configure ontologies
15+
- **22 MCP tools** — add, remove, search, and inspect axioms; manage prefixes, labels, and ontology IRI; register and configure ontologies; scan for pitfalls
16+
- **CLI mode** — every tool is also available as a direct CLI subcommand (`owl-mcp find-axioms ...`)
1617
- **2 transport modes**`stdio` (default, for Cursor/Claude Desktop) and `http` (Streamable HTTP + SSE)
1718
- **Persistent configuration** — register ontologies by name in `~/.owl-mcp/config.yaml`
1819
- **Live file watching** — automatically reloads ontology files modified externally
@@ -24,7 +25,7 @@ Built as a drop-in replacement for [ai4curation/owl-mcp](https://github.com/ai4c
2425
### via npx (recommended)
2526

2627
```bash
27-
npx owl-mcp
28+
npx owl-mcp serve
2829
```
2930

3031
### via npm (global install)
@@ -47,18 +48,35 @@ cargo build --release
4748

4849
## Usage
4950

50-
```
51-
owl-mcp [OPTIONS]
51+
owl-mcp has two modes: **serve** (MCP server) and **CLI** (direct commands).
52+
53+
### MCP server mode
54+
55+
```bash
56+
owl-mcp serve [OPTIONS]
5257

5358
Options:
54-
--transport <stdio|http> Transport to use [default: stdio] [env: OWL_MCP_TRANSPORT]
55-
--host <HOST> Host to bind (HTTP only) [default: 127.0.0.1] [env: OWL_MCP_HOST]
56-
--port <PORT> Port to bind (HTTP only) [default: 8080] [env: OWL_MCP_PORT]
57-
--sse-support Enable legacy SSE endpoint alongside Streamable HTTP [env: OWL_MCP_SSE_SUPPORT]
58-
-h, --help Print help
59-
-V, --version Print version
59+
--transport <stdio|http> Transport to use [default: stdio]
60+
--host <HOST> Host to bind (HTTP only) [default: 127.0.0.1]
61+
--port <PORT> Port to bind (HTTP only) [default: 8080]
62+
--sse-support Enable legacy SSE endpoint [default: true]
63+
```
64+
65+
### CLI mode
66+
67+
Every MCP tool is available as a subcommand:
68+
69+
```bash
70+
owl-mcp add-axiom --file ontology.owl --axiom "SubClassOf(:Dog :Animal)"
71+
owl-mcp find-axioms --file ontology.owl --pattern "Dog" --limit 50
72+
owl-mcp get-all-axioms --file ontology.owl --include-labels
73+
owl-mcp test-pitfalls --file ontology.owl
74+
owl-mcp list-configured-ontologies
75+
owl-mcp find-axioms-by-name --name pizza --pattern "Topping"
6076
```
6177

78+
Run `owl-mcp --help` for a full list of commands, or `owl-mcp <command> --help` for details on a specific command.
79+
6280
## Cursor / Claude Desktop integration
6381

6482
Add the server to your MCP client configuration.
@@ -70,7 +88,7 @@ Add the server to your MCP client configuration.
7088
"mcpServers": {
7189
"owl-mcp": {
7290
"command": "npx",
73-
"args": ["-y", "owl-mcp"]
91+
"args": ["-y", "owl-mcp", "serve"]
7492
}
7593
}
7694
}
@@ -91,7 +109,7 @@ Add the server to your MCP client configuration.
91109
Start the server with:
92110

93111
```bash
94-
owl-mcp --transport http --port 8080
112+
owl-mcp serve --transport http --port 8080
95113
```
96114

97115
## Tools
@@ -123,6 +141,8 @@ owl-mcp --transport http --port 8080
123141
| `ontology_metadata` | Return ontology-level annotation axioms |
124142
| `get_labels_for_iri` | Look up `rdfs:label` (or custom property) values for an IRI |
125143
| `get_labels_for_iri_by_name` | Same, for a configured ontology |
144+
| `set_ontology_iri` | Set or update the ontology IRI and version IRI |
145+
| `set_ontology_iri_by_name` | Same, for a configured ontology |
126146

127147
### Configuration
128148

@@ -135,6 +155,12 @@ owl-mcp --transport http --port 8080
135155
| `register_ontology_in_config` | Register an existing file by name |
136156
| `load_and_register_ontology` | Load (or create) a file and register it |
137157

158+
### Quality checks
159+
160+
| Tool | Description |
161+
|---|---|
162+
| `test_pitfalls` | Scan an ontology for common modeling pitfalls (31 checks) |
163+
138164
All `find_axioms` and `get_all_axioms` tools accept `include_labels: true` to annotate each axiom with human-readable labels appended as `## <IRI> # label` comments.
139165

140166
## Configuration file

0 commit comments

Comments
 (0)