Skip to content

Commit be05dcc

Browse files
Deployed aafbe22 to dev with Zensical 0.0.47 and mike 2.2.0+zensical-0.1.0
1 parent 6b9d628 commit be05dcc

3 files changed

Lines changed: 117 additions & 16 deletions

File tree

‎dev/search.json‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎dev/tools/index.html‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -883,21 +883,30 @@ <h1 id="tools">Tools<a class="headerlink" href="#tools" title="Permanent link">&
883883
(<code>osw.service</code>), so a command and its matching tool behave identically. They
884884
differ in exactly one way: only the CLI accepts filesystem paths.</p>
885885
<h2 id="setup">Setup<a class="headerlink" href="#setup" title="Permanent link">&para;</a></h2>
886-
<p>Install one of the two; the second includes the first:</p>
886+
<p>Install <code>osw</code> as a uv tool. The <code>mcp</code> extra adds the server to the same install:</p>
887887
<div class="highlight"><pre><span></span><code>uv<span class="w"> </span>tool<span class="w"> </span>install<span class="w"> </span>osw<span class="w"> </span><span class="c1"># the `osw` command</span>
888888
uv<span class="w"> </span>tool<span class="w"> </span>install<span class="w"> </span><span class="s2">&quot;osw[mcp]&quot;</span><span class="w"> </span><span class="c1"># the same, plus the `osw-mcp` server</span>
889889
</code></pre></div>
890+
<p>uv writes both console scripts to its tool bin directory, <code>~/.local/bin</code> by
891+
default. Run <code>uv tool update-shell</code> once if that directory is not on your PATH
892+
yet, and <code>uv tool upgrade osw</code> to update them later. Quote the argument:
893+
<code>osw[mcp]</code> contains brackets, which zsh reads as a glob pattern and then refuses
894+
to run.</p>
895+
<p>Without the <code>mcp</code> extra, uv still writes <code>osw-mcp</code> to the bin directory, but
896+
that copy raises <code>ModuleNotFoundError</code> at startup. Install <code>osw[mcp]</code> before you
897+
register the server with a client.</p>
890898
<details>
891899
<summary>Other ways to install</summary>
892900
<div class="highlight"><pre><span></span><code>pip<span class="w"> </span>install<span class="w"> </span><span class="s2">&quot;osw[mcp]&quot;</span><span class="w"> </span><span class="c1"># into the active environment</span>
893901
uv<span class="w"> </span>add<span class="w"> </span><span class="s2">&quot;osw[mcp]&quot;</span><span class="w"> </span><span class="c1"># as a dependency of the current uv project</span>
894902
uvx<span class="w"> </span>--from<span class="w"> </span><span class="s2">&quot;osw[mcp]&quot;</span><span class="w"> </span>osw-mcp<span class="w"> </span><span class="c1"># run the server without installing it</span>
895903
</code></pre></div>
896-
<p><code>uvx</code> is what the registration examples further down use, so the server needs
897-
no install of its own.</p>
904+
<p><code>uvx</code> needs no install of its own.
905+
<a href="mcp/#which-command-to-register-for-the-mcp-server">Which command to register</a>
906+
explains when to prefer it over the installed command.</p>
898907
</details>
899-
<p><code>osw[mcp]</code> is also part of <code>osw[all]</code>. The other extras are listed in the
900-
<a href="../get-started/#optional-extras">Get Started guide</a>.</p>
908+
<p><code>osw[mcp]</code> includes <code>osw[wikitext]</code>, and is itself part of <code>osw[all]</code>. The other
909+
extras are listed in the <a href="../get-started/#optional-extras">Get Started guide</a>.</p>
901910
<h2 id="in-this-section">In this section<a class="headerlink" href="#in-this-section" title="Permanent link">&para;</a></h2>
902911
<table>
903912
<thead>

‎dev/tools/mcp/index.html‎

Lines changed: 102 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,23 @@
639639
</span>
640640
</a>
641641

642+
<nav class="md-nav" aria-label="Quick install">
643+
<ul class="md-nav__list">
644+
645+
<li class="md-nav__item">
646+
<a href="#which-command-to-register-for-the-mcp-server" class="md-nav__link">
647+
<span class="md-ellipsis">
648+
<span class="md-typeset">
649+
Which command to register for the MCP server
650+
</span>
651+
</span>
652+
</a>
653+
654+
</li>
655+
656+
</ul>
657+
</nav>
658+
642659
</li>
643660

644661
<li class="md-nav__item">
@@ -880,6 +897,23 @@
880897
</span>
881898
</a>
882899

900+
<nav class="md-nav" aria-label="Quick install">
901+
<ul class="md-nav__list">
902+
903+
<li class="md-nav__item">
904+
<a href="#which-command-to-register-for-the-mcp-server" class="md-nav__link">
905+
<span class="md-ellipsis">
906+
<span class="md-typeset">
907+
Which command to register for the MCP server
908+
</span>
909+
</span>
910+
</a>
911+
912+
</li>
913+
914+
</ul>
915+
</nav>
916+
883917
</li>
884918

885919
<li class="md-nav__item">
@@ -1041,6 +1075,10 @@ <h1 id="mcp-server">MCP server<a class="headerlink" href="#mcp-server" title="Pe
10411075
introspect category schemas, read entities and every page slot, create/update
10421076
and delete entities, and read and write file pages as text. The transport is
10431077
stdio; SSE and HTTP are not supported.</p>
1078+
<p>A registered server runs the <code>osw-mcp</code> console script, and there are two ways to
1079+
reach it: let <code>uvx</code> fetch it for each server, or install <code>osw[mcp]</code> once and
1080+
register the command directly. See
1081+
<a href="#which-command-to-register-for-the-mcp-server">Which command to register for the MCP server</a>.</p>
10441082
<p><strong>No filesystem access:</strong> no MCP tool takes or returns a local path. File
10451083
content moves inline as text (<code>get_file_info</code>, <code>read_file_text</code>,
10461084
<code>write_file_text</code>), and everything path-based lives in the CLI instead
@@ -1075,6 +1113,35 @@ <h2 id="quick-install">Quick install<a class="headerlink" href="#quick-install"
10751113
for every project, or <code>-s project</code> to write a shared <code>.mcp.json</code>.</li>
10761114
<li>List what is registered with <code>claude mcp list</code>.</li>
10771115
</ul>
1116+
<h3 id="which-command-to-register-for-the-mcp-server">Which command to register for the MCP server<a class="headerlink" href="#which-command-to-register-for-the-mcp-server" title="Permanent link">&para;</a></h3>
1117+
<ul>
1118+
<li>
1119+
<p><strong>To pin the <code>osw</code> version per server, register the <code>uvx</code> command</strong>, as in the
1120+
example above and in every other example on this page. The package
1121+
specification is part of the entry, so one server can name a version or a
1122+
checkout that the others do not use. <code>uvx</code> needs no install of its own. The
1123+
cost is that changing the version means editing every entry that should
1124+
change. Note that <code>uvx</code> reuses an installed <code>osw</code> tool whenever that
1125+
installation satisfies the specification, so an unpinned <code>osw[mcp]</code> runs the
1126+
installed version if there is one. Write an explicit version, for example
1127+
<code>osw[mcp]==2.6.2</code>, when a server must be independent of it.</p>
1128+
</li>
1129+
<li>
1130+
<p><strong>To let all servers share one <code>osw</code> version, register the installed
1131+
<code>osw-mcp</code> command.</strong> Install <code>osw[mcp]</code> as a uv tool (<a href="../#setup">Setup</a>),
1132+
then register that command in place of the whole <code>uvx --from ...</code> invocation:</p>
1133+
<div class="highlight"><pre><span></span><code>claude<span class="w"> </span>mcp<span class="w"> </span>add<span class="w"> </span>osw-dev<span class="w"> </span><span class="se">\</span>
1134+
<span class="w"> </span>-e<span class="w"> </span><span class="nv">OSW_DOMAIN</span><span class="o">=</span>wiki-dev.open-semantic-lab.org<span class="w"> </span><span class="se">\</span>
1135+
<span class="w"> </span>-e<span class="w"> </span><span class="nv">OSW_CRED_FILEPATH</span><span class="o">=</span>/abs/path/to/accounts.pwd.yaml<span class="w"> </span><span class="se">\</span>
1136+
<span class="w"> </span>--<span class="w"> </span>osw-mcp
1137+
</code></pre></div>
1138+
<p>In JSON that entry is <code>"command": "osw-mcp"</code> with an empty <code>args</code> array.
1139+
<code>uv tool upgrade osw</code> then changes the version for every server at once. The
1140+
cost is that <code>osw-mcp</code> has to be on the PATH of the client, and that no
1141+
server can keep an older version.</p>
1142+
</li>
1143+
</ul>
1144+
<p>Everything else about an entry, <code>env</code> included, is the same either way.</p>
10781145
<h2 id="registering-a-server">Registering a server<a class="headerlink" href="#registering-a-server" title="Permanent link">&para;</a></h2>
10791146
<p>A server entry can carry its settings in two ways:</p>
10801147
<ul>
@@ -1178,20 +1245,45 @@ <h2 id="design-notes">Design notes<a class="headerlink" href="#design-notes" tit
11781245
needs, so only users who actually run the server pay for it.</li>
11791246
</ul>
11801247
<h2 id="notes-for-developers">Notes for developers<a class="headerlink" href="#notes-for-developers" title="Permanent link">&para;</a></h2>
1181-
<p>To try an unreleased branch against a real client, point <code>uvx</code> at the checkout
1182-
instead of at PyPI. Everything else about the registration stays the same:</p>
1248+
<p>To try an unreleased branch against a real client, run it from the checkout. The
1249+
same two options apply as above.</p>
1250+
<p>Point <code>uvx</code> at the checkout instead of at PyPI. Everything else about the
1251+
registration stays the same:</p>
11831252
<div class="highlight"><pre><span></span><code>uvx<span class="w"> </span>--reinstall<span class="w"> </span>--from<span class="w"> </span><span class="s2">&quot;/abs/path/to/osw-python[mcp]&quot;</span><span class="w"> </span>osw-mcp
11841253
</code></pre></div>
1185-
<p><code>--reinstall</code> is what picks up your latest edits, since <code>uvx</code> caches the wheel
1186-
it builds. In a JSON <code>args</code> array, a Windows path needs forward slashes or
1254+
<p><code>--reinstall</code> is what makes <code>uvx</code> use your latest edits, since it caches the
1255+
wheel it builds. In a JSON <code>args</code> array, a Windows path needs forward slashes or
11871256
doubled backslashes.</p>
1188-
<p>Prefer that over an editable install for the server. <code>create_or_update_entity</code>
1189-
and <code>export_entity_jsonld</code> call <code>fetch_schema</code>, which regenerates
1190-
<code>src/osw/model/entity.py</code> inside the installed package: <code>uvx</code> builds a
1191-
non-editable wheel, so the write lands in the uv cache, while under
1192-
<code>pip install -e</code> or <code>uv sync</code> it lands in your working tree. The read tools
1257+
<p>Or install the checkout as an editable uv tool. The server then registers as
1258+
plain <code>osw-mcp</code>, no client config contains the checkout path, and edits take
1259+
effect at the next server start without a reinstall:</p>
1260+
<div class="highlight"><pre><span></span><code><span class="nb">cd</span><span class="w"> </span>/path/to/osw-python
1261+
uv<span class="w"> </span>tool<span class="w"> </span>install<span class="w"> </span>--reinstall<span class="w"> </span>--editable<span class="w"> </span><span class="s2">&quot;.[mcp]&quot;</span>
1262+
</code></pre></div>
1263+
<p><code>osw</code> and <code>osw-mcp</code> then import from <code>src/</code> in that checkout. Four consequences:</p>
1264+
<ul>
1265+
<li>Both commands follow the checked-out branch, so switching branches changes
1266+
what a registered server runs.</li>
1267+
<li>Run the install command again after a change to <code>pyproject.toml</code>. uv
1268+
re-resolves from the checkout and installs the difference.</li>
1269+
<li>Returning to a released version needs <code>--reinstall</code>. Without it uv finds the
1270+
requirement satisfied, keeps the editable environment and rewrites only the
1271+
tool receipt, so receipt and environment disagree.</li>
1272+
<li>On Windows, an install that has to replace the tool environment fails with
1273+
<code>os error 5</code> while an <code>osw-mcp</code> server from it is running, because the running
1274+
process locks the tool's <code>Scripts</code> directory. Stop the MCP clients first.</li>
1275+
</ul>
1276+
<p>One difference decides between <code>uvx</code> and the editable install.
1277+
<code>create_or_update_entity</code> and
1278+
<code>export_entity_jsonld</code> call <code>fetch_schema</code>, which regenerates
1279+
<code>src/osw/model/entity.py</code> inside the installed package. <code>uvx</code> builds a
1280+
non-editable wheel, so the regenerated file is written into the uv cache. Under
1281+
an editable install, as under <code>pip install -e</code> or <code>uv sync</code>, it is written into
1282+
your working tree, where git tracks it. Note that <code>export_entity_jsonld</code> is
1283+
declared read-only and still triggers this. The remaining read tools
11931284
(<code>get_entity</code>, <code>get_slot</code>, <code>get_category_schema</code>, ...) read raw page slots and
1194-
never trigger it.</p>
1285+
never trigger it. So choose <code>uvx</code> whenever a client may call either of those two
1286+
operations, and the editable install otherwise.</p>
11951287

11961288

11971289

0 commit comments

Comments
 (0)