xippios-mcp 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.
@@ -0,0 +1,23 @@
1
+ # environments and caches
2
+ .venv/
3
+ __pycache__/
4
+ *.py[cod]
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .pytest_cache/
8
+ .hypothesis/
9
+
10
+ # build artefacts
11
+ dist/
12
+ build/
13
+ *.egg-info/
14
+
15
+ # local secrets are never files, but belt and braces
16
+ .env
17
+ .env.*
18
+ .envrc
19
+ .envrc.*
20
+
21
+ # editors
22
+ .idea/
23
+ .vscode/
@@ -0,0 +1,57 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5
+ [Semantic Versioning](https://semver.org/) (pre-1.0: breaking changes bump the minor).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.1.0] - 2026-10-29
10
+
11
+ The first release of xippios-mcp, the self-hosted MCP host of the xippios SDK family. It
12
+ serves the MCP tools of the family's packages from one process, by endpoint and group:
13
+ an endpoint serves one package's own server, or a server the host builds from one or
14
+ several packages' tools, never read and write tools together. It runs on stdio, or on
15
+ streamable HTTP, each endpoint with its own bearer token or none, and a Docker image
16
+ built from the repository serves it from a container.
17
+
18
+ ### Added
19
+
20
+ - The scaffold, by hand from [sdk-template](https://github.com/xippios/sdk-template)
21
+ v0.3.0: the package `xippios.mcp` on `xippios-core[mcp]` 0.3, the `xippios-mcp` entry
22
+ point with `--config`, the host's package checks, CI, and the release workflow, in
23
+ which the merge of a release pull request tags the version and publishes it to PyPI.
24
+ - One extra per source package, each with a lower bound and no upper bound, so that the
25
+ host installs every package at its latest release, and `all` their union: `cashctrl`
26
+ (`xippios-cashctrl>=0.3.0`), `comtrade` (`xippios-comtrade>=0.2.0`), `eurostat`
27
+ (`xippios-eurostat>=0.2.0`), `faostat` (`xippios-faostat>=0.1.0`), `usda-esmis`
28
+ (`xippios-usda-esmis>=0.2.0`), `usda-esr` (`xippios-usda-esr>=0.2.0`), `usda-gats`
29
+ (`xippios-usda-gats>=0.2.0`), `usda-nass` (`xippios-usda-nass>=0.2.0`) and `usda-psd`
30
+ (`xippios-usda-psd>=0.3.0`). `xippios-usda-wasde` joins in a later release, once its
31
+ 0.2.0 ships: its 0.1.1 needs `xippios-usda-esmis` below 0.2, so it does not install
32
+ beside the other nine.
33
+ - The config, its startup checks and the mount: `xippios-mcp --config <path>` reads a
34
+ TOML file of `[endpoints.<name>]` tables, checks every key, builds each endpoint's
35
+ server and prints one line per endpoint; a refusal names the file, the endpoint and
36
+ the key and exits with status 2. One package without a list serves the package's own
37
+ server; a group or an endpoint with an `include` or `exclude` list is a server the
38
+ host builds, named `xippios-<endpoint>`, with the packages' tools under their own
39
+ names and their result caps. Read and write never share an endpoint, a list names
40
+ exact task names, and `token_env` names a variable ending in `_TOKEN`. A sample config
41
+ is in `docs/host.example.toml`.
42
+ - The transports and the bearer: `--stdio <endpoint>` serves one endpoint on stdio,
43
+ without auth, and `--http` serves every endpoint at `/<name>/mcp` from one process on
44
+ `--host` (default `127.0.0.1`) and `--port` (default 8000). An endpoint with
45
+ `auth = "bearer"` answers a missing or wrong token with `401` and
46
+ `WWW-Authenticate: Bearer realm="xippios-mcp"`; the token is read once from the
47
+ variable `token_env` names, and an unset or empty one, or one with leading or trailing
48
+ whitespace, stops the host with exit status 2. An `auth = "none"` write endpoint is
49
+ served on a loopback host only, unless it sets `allow_remote = true`; a package's own
50
+ server serves one HTTP endpoint; and an optional `[http]` table names the `Host` and
51
+ `Origin` values accepted behind a reverse proxy.
52
+ - The Docker image: `docker build -t xippios-mcp .` installs this checkout with
53
+ `uv.lock`, every package of `all`, on `python:3.12-slim` and uv 0.13.6, both pinned by
54
+ digest. It runs as the non-root user `xippios`, reads the config the operator mounts
55
+ at `/etc/xippios-mcp/host.toml`, serves `--http` on `0.0.0.0:8000`, and takes every
56
+ token from the environment by name. CI builds the image and runs `--help` in a
57
+ `docker` job that the `ci` check requires; no image is published to a registry.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,330 @@
1
+ Metadata-Version: 2.5
2
+ Name: xippios-mcp
3
+ Version: 0.1.0
4
+ Summary: The self-hosted MCP host for the xippios SDKs
5
+ Project-URL: Homepage, https://github.com/xippios/xippios-mcp
6
+ Project-URL: Changelog, https://github.com/xippios/xippios-mcp/blob/main/CHANGELOG.md
7
+ Project-URL: Issues, https://github.com/xippios/xippios-mcp/issues
8
+ Author: XIPPIOS GmbH
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: host,mcp,sdk,xippios
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Typing :: Typed
19
+ Requires-Python: >=3.12
20
+ Requires-Dist: mcp>=2.3.0
21
+ Requires-Dist: starlette>=1.9.0
22
+ Requires-Dist: uvicorn>=0.54.0
23
+ Requires-Dist: xippios-core[mcp]~=0.3.0
24
+ Provides-Extra: all
25
+ Requires-Dist: xippios-cashctrl>=0.3.0; extra == 'all'
26
+ Requires-Dist: xippios-comtrade>=0.2.0; extra == 'all'
27
+ Requires-Dist: xippios-eurostat>=0.2.0; extra == 'all'
28
+ Requires-Dist: xippios-faostat>=0.1.0; extra == 'all'
29
+ Requires-Dist: xippios-usda-esmis>=0.2.0; extra == 'all'
30
+ Requires-Dist: xippios-usda-esr>=0.2.0; extra == 'all'
31
+ Requires-Dist: xippios-usda-gats>=0.2.0; extra == 'all'
32
+ Requires-Dist: xippios-usda-nass>=0.2.0; extra == 'all'
33
+ Requires-Dist: xippios-usda-psd>=0.3.0; extra == 'all'
34
+ Provides-Extra: cashctrl
35
+ Requires-Dist: xippios-cashctrl>=0.3.0; extra == 'cashctrl'
36
+ Provides-Extra: comtrade
37
+ Requires-Dist: xippios-comtrade>=0.2.0; extra == 'comtrade'
38
+ Provides-Extra: eurostat
39
+ Requires-Dist: xippios-eurostat>=0.2.0; extra == 'eurostat'
40
+ Provides-Extra: faostat
41
+ Requires-Dist: xippios-faostat>=0.1.0; extra == 'faostat'
42
+ Provides-Extra: usda-esmis
43
+ Requires-Dist: xippios-usda-esmis>=0.2.0; extra == 'usda-esmis'
44
+ Provides-Extra: usda-esr
45
+ Requires-Dist: xippios-usda-esr>=0.2.0; extra == 'usda-esr'
46
+ Provides-Extra: usda-gats
47
+ Requires-Dist: xippios-usda-gats>=0.2.0; extra == 'usda-gats'
48
+ Provides-Extra: usda-nass
49
+ Requires-Dist: xippios-usda-nass>=0.2.0; extra == 'usda-nass'
50
+ Provides-Extra: usda-psd
51
+ Requires-Dist: xippios-usda-psd>=0.3.0; extra == 'usda-psd'
52
+ Description-Content-Type: text/markdown
53
+
54
+ # xippios-mcp
55
+
56
+ The self-hosted MCP host of the [xippios SDK family](https://github.com/xippios). It
57
+ serves the MCP tools of the family's packages from one process, by endpoint and group:
58
+ an endpoint mounts a package's own server, read or write, and a group combines several
59
+ packages' tools on one endpoint, never read and write tools together. It runs on stdio
60
+ locally and on streamable HTTP on a server, each endpoint with its own auth, a bearer
61
+ token by default; the secrets stay in the environment, never in the config file.
62
+
63
+ `xippios-mcp --config <path>` checks a config, builds every endpoint's server and lists
64
+ the endpoints; `--stdio <endpoint>` serves one endpoint on stdio, and `--http` serves
65
+ every endpoint over streamable HTTP, each with its bearer (see Serving). A Docker image,
66
+ built from this repository, serves them from a container (see Docker).
67
+
68
+ ## Install
69
+
70
+ ```bash
71
+ uv add "xippios-mcp[all]" # the host with every package below
72
+ uv add "xippios-mcp[usda-nass]" # or one extra per package you serve
73
+ ```
74
+
75
+ ## Packages
76
+
77
+ Each package is an extra with a lower bound only, so the host installs every package at
78
+ its latest release.
79
+
80
+ | Extra | Distribution | Lower bound | Servers | Tools |
81
+ | --- | --- | --- | --- | --- |
82
+ | `cashctrl` | `xippios-cashctrl` | `>=0.3.0` | read and write | 24 read, 11 write |
83
+ | `comtrade` | `xippios-comtrade` | `>=0.2.0` | read | 19 |
84
+ | `eurostat` | `xippios-eurostat` | `>=0.2.0` | read | 13 |
85
+ | `faostat` | `xippios-faostat` | `>=0.1.0` | read | 7 |
86
+ | `usda-esmis` | `xippios-usda-esmis` | `>=0.2.0` | read | 9 |
87
+ | `usda-esr` | `xippios-usda-esr` | `>=0.2.0` | read | 10 |
88
+ | `usda-gats` | `xippios-usda-gats` | `>=0.2.0` | read | 20 |
89
+ | `usda-nass` | `xippios-usda-nass` | `>=0.2.0` | read | 16 |
90
+ | `usda-psd` | `xippios-usda-psd` | `>=0.3.0` | read | 12 |
91
+
92
+ The tools are each package's `tasks.__all__` (`tasks_write.__all__` for a write server)
93
+ less its `BULK_TASKS`, which are Python-only, counted at the version of the lower bound;
94
+ a later release may add tools. `all` installs the nine. `xippios-usda-wasde` joins
95
+ later: its 0.1.1 needs `xippios-usda-esmis` below 0.2.
96
+
97
+ ### The ceilings of usda-nass and usda-gats
98
+
99
+ `--split-years` of `xippios-usda-nass-mcp` and `--series-months` of
100
+ `xippios-usda-gats-mcp` are options of those packages' own entry points, which the host
101
+ does not run. The host therefore serves the ceilings the packages keep in Python: a
102
+ split `usda_nass_get_data` spans up to 20 years, at up to two keyed calls a year (the
103
+ entry point's default is 5 years), and `usda_gats_get_census_export_series`,
104
+ `usda_gats_get_census_import_series` and `usda_gats_get_census_reexport_series` span up
105
+ to 60 months, at one call a month (the entry point's default is 24 months). An operator
106
+ who wants fewer calls per tool call leaves those tools out with an endpoint's `exclude`
107
+ list (see Configuration).
108
+
109
+ ## Configuration
110
+
111
+ The host reads one TOML file that names its endpoints. Each `[endpoints.<name>]` table
112
+ is one endpoint, which the HTTP transport serves at `/<name>/mcp`:
113
+
114
+ ```toml
115
+ [endpoints.agriculture] # served at /agriculture/mcp
116
+ packages = ["usda-nass", "usda-psd", "comtrade"]
117
+ exclude = { usda-nass = ["get_counts"] } # or include = { ... }; exact task names
118
+ auth = "bearer" # the default; or "none"
119
+ token_env = "XIPPIOS_MCP_AGRICULTURE_TOKEN" # a name ending in _TOKEN, never a value
120
+ allow_remote = false # the default
121
+
122
+ [endpoints.accounting-write]
123
+ packages = ["cashctrl:write"]
124
+ auth = "none"
125
+ ```
126
+
127
+ - An endpoint that names one package and no list serves that package's own server, as
128
+ the package builds it: `xippios.<package>.mcp.server`, or `mcp_write.server` for
129
+ `<slug>:write`, with its instructions and result caps.
130
+ - A group, several packages, or an endpoint with an `include` or `exclude` list is a
131
+ server the host builds, named `xippios-<endpoint>`: each package's tools under their
132
+ own names (`usda_nass_get_data`), with the package's result caps for the tools it
133
+ keeps.
134
+ - Read and write never mix: an endpoint's packages are all `<slug>:write` or none, and
135
+ the host refuses a group that mixes them.
136
+ - `include` and `exclude` are keyed by package slug and name exact task names, a task
137
+ function's `__name__` (`get_counts`, not `usda_nass_get_counts`); a package takes one
138
+ of the two, and an empty list is refused. A name that is no tool of the package is
139
+ refused, a task in the package's `BULK_TASKS` among them, since a bulk task is
140
+ Python-only and no tool.
141
+ - `auth` is `"bearer"` by default, or `"none"`. With the bearer, `token_env` names the
142
+ environment variable that holds the token, a name ending in `_TOKEN`
143
+ (`XIPPIOS_MCP_<ENDPOINT>_TOKEN`), and the token itself stays in the environment, never
144
+ in the file. The host reads the variable once, when `--http` starts, and never on
145
+ stdio or when it lists. `allow_remote` is `false` by default; it lets an `auth =
146
+ "none"` write endpoint beyond loopback (see The loopback rule).
147
+ - An optional `[http]` table names the `Host` and `Origin` values the HTTP transport
148
+ accepts behind a reverse proxy (see Behind a reverse proxy).
149
+
150
+ Check a config before serving it:
151
+
152
+ ```bash
153
+ xippios-mcp --config host.toml
154
+ ```
155
+
156
+ It loads the file, builds every endpoint and prints one line per endpoint; for
157
+ [`docs/host.example.toml`](docs/host.example.toml), the sample above, with the packages
158
+ at the lower bounds:
159
+
160
+ ```text
161
+ agriculture: read, 46 tools of usda-nass, usda-psd, comtrade
162
+ accounting-write: write, 11 tools of cashctrl
163
+ ```
164
+
165
+ A key, package or task the host refuses stops it with exit status 2 and a message that
166
+ names the file, the endpoint and the key. The list runs neither the mounted-once check
167
+ nor the loopback check of Serving, which need `--http` and its `--host`.
168
+
169
+ A server the host builds carries none of the packages' own instructions: its
170
+ instructions are one sentence naming its packages and their tool counts. No endpoint
171
+ takes a package's command-line options, such as cashctrl's `--org` lock or the ceilings
172
+ above, since the host runs no package's entry point. The package contract of the next
173
+ template release gives the host what it needs to carry them, in its 0.2.0.
174
+
175
+ ## Serving
176
+
177
+ ### stdio
178
+
179
+ ```bash
180
+ xippios-mcp --config host.toml --stdio agriculture
181
+ ```
182
+
183
+ serves the one endpoint `agriculture` on stdio, for an MCP client that starts the host
184
+ as its own process. stdio has no auth: the host reads no token variable, and an
185
+ endpoint's `auth`, `token_env` and `allow_remote` apply to HTTP only. In Claude Code:
186
+
187
+ ```bash
188
+ claude mcp add agriculture -- xippios-mcp --config host.toml --stdio agriculture
189
+ ```
190
+
191
+ with the config's absolute path in place of `host.toml` when Claude Code runs in another
192
+ directory.
193
+
194
+ ### Streamable HTTP
195
+
196
+ ```bash
197
+ xippios-mcp --config host.toml --http --host 127.0.0.1 --port 8000
198
+ ```
199
+
200
+ serves every endpoint of the config from one process, each at
201
+ `http://127.0.0.1:8000/<name>/mcp`: `http://127.0.0.1:8000/agriculture/mcp` for the
202
+ sample. `--host` defaults to `127.0.0.1` and `--port` to 8000; both need `--http`, and
203
+ `--http` and `--stdio` exclude each other. Before it serves, the host reads each bearer
204
+ endpoint's token and applies the checks below; a refusal exits with status 2 and serves
205
+ nothing. A package's own server serves one HTTP endpoint: two endpoints that each name
206
+ `usda-nass` alone are refused, and an `include` or `exclude` list on one of them makes
207
+ its server one the host builds.
208
+
209
+ ### The bearer
210
+
211
+ An endpoint with `auth = "bearer"` answers a request without the token with `401` and
212
+ `WWW-Authenticate: Bearer realm="xippios-mcp"`, and one with a wrong token with
213
+ `error="invalid_token"` added; such a request never reaches the endpoint. The token is
214
+ the value of the variable `token_env` names, read once when `--http` starts: an unset or
215
+ empty variable stops the host with exit status 2, and so does a value with leading or
216
+ trailing whitespace, which no token a client sends can match. The host keeps the token's
217
+ SHA-256 digest only, compares in constant time, and never logs the token or the
218
+ `Authorization` header. A random token will do, `openssl rand -hex 32` for instance, set
219
+ in the environment of the host and of the client.
220
+
221
+ In Claude Code:
222
+
223
+ ```bash
224
+ claude mcp add --transport http agriculture http://127.0.0.1:8000/agriculture/mcp \
225
+ --header 'Authorization: Bearer ${XIPPIOS_MCP_AGRICULTURE_TOKEN}'
226
+ ```
227
+
228
+ In single quotes the shell passes `${XIPPIOS_MCP_AGRICULTURE_TOKEN}` on as written, and
229
+ Claude Code expands it from its own environment when it connects, so the token stays out
230
+ of Claude Code's config; in double quotes the shell would write the token itself into
231
+ the config. Claude Code reads some well-known credential variables as empty in a remote
232
+ server's headers (its own, a cloud provider's, others such as `NPM_TOKEN`); a name of
233
+ the operator's own, such as `XIPPIOS_MCP_AGRICULTURE_TOKEN`, is outside that set and
234
+ expands as written. When a token does not arrive, `claude --debug-file <file>` logs
235
+ `never expanded toward a remote server` for a covered name.
236
+
237
+ The bearer does not serve claude.ai. claude.ai signs in with OAuth: it starts on a `401`
238
+ that names a `resource_metadata` document, and it needs an OAuth authorization server.
239
+ The host advertises no `resource_metadata` and is no authorization server, so claude.ai
240
+ needs one in front of the host, which 0.1.0 leaves out (ADR-0026, decision 10).
241
+
242
+ ### The loopback rule
243
+
244
+ An endpoint with `auth = "none"` that serves a write server, `cashctrl:write` for
245
+ instance, carries no authentication, so `--http` serves it on a loopback `--host` only,
246
+ `127.0.0.1`, `localhost` or `::1`, as a package's own entry point keeps its write server
247
+ (ADR-0014, decision 9). On another `--host` the host refuses to start unless the
248
+ endpoint sets `allow_remote = true`, and then a gateway in front of it has to
249
+ authenticate. A read endpoint with `auth = "none"`, and every bearer endpoint, is served
250
+ on any host.
251
+
252
+ A read server that its package holds to loopback, as sdk-google-mail holds its own, is
253
+ not held there by the host's 0.1.0: the packages' loopback-only option is planned for
254
+ `xippios-core`'s next minor, for the host to read from its own 0.2.0 on. None of the
255
+ nine packages 0.1.0 serves holds a read server to loopback, so the case cannot arise
256
+ before a package that does joins, sdk-google-mail once it has a release and an extra.
257
+ Until the host reads the option, keep an `auth = "none"` endpoint of such a package on
258
+ a loopback `--host`, or give it the bearer.
259
+
260
+ ### Behind a reverse proxy
261
+
262
+ On a loopback `--host` the mcp SDK checks the `Host` and `Origin` headers itself and
263
+ accepts loopback values only, which keeps a web page from reaching the host through DNS
264
+ rebinding. Beyond loopback it checks neither, unless the config names what to accept:
265
+
266
+ ```toml
267
+ [http]
268
+ allowed_hosts = ["mcp.example.com"] # the Host values the proxy forwards
269
+ allowed_origins = ["https://mcp.example.com"] # browser origins, if any
270
+ ```
271
+
272
+ The lists replace the SDK's loopback default for every endpoint: a request whose `Host`
273
+ is not listed gets `421`, and one with an `Origin` that is not listed gets `403`; a
274
+ request without `Origin` passes. `"<host>:*"` accepts any port, so add `"127.0.0.1:*"`
275
+ to keep clients that connect directly. Both keys are optional, but `allowed_origins`
276
+ needs `allowed_hosts`. Without the table, a host bound beyond loopback gets no `Host`
277
+ check.
278
+
279
+ ## Docker
280
+
281
+ The repository builds an image of the host with every package of `all`, at the versions
282
+ `uv.lock` pins, the set the tests run against. 0.1.0 publishes no image to a registry:
283
+ build it from a checkout.
284
+
285
+ ```bash
286
+ docker build -t xippios-mcp .
287
+ ```
288
+
289
+ The image runs `xippios-mcp --config /etc/xippios-mcp/host.toml --http --host 0.0.0.0
290
+ --port 8000` as the non-root user `xippios` (uid 10001), and holds no config, key or
291
+ token. The operator mounts the config, a file that user can read, and passes every
292
+ token by its variable's name, so the value comes from the operator's environment and
293
+ stays out of the command line. For a config with one bearer endpoint:
294
+
295
+ ```toml
296
+ [endpoints.agriculture]
297
+ packages = ["usda-nass", "usda-psd", "comtrade"]
298
+ auth = "bearer"
299
+ token_env = "XIPPIOS_MCP_AGRICULTURE_TOKEN"
300
+ ```
301
+
302
+ ```bash
303
+ docker run --rm -p 8000:8000 \
304
+ -v "$PWD/host.toml:/etc/xippios-mcp/host.toml:ro" \
305
+ -e XIPPIOS_MCP_AGRICULTURE_TOKEN \
306
+ xippios-mcp
307
+ ```
308
+
309
+ serves it at `http://127.0.0.1:8000/agriculture/mcp`. The variables the packages read
310
+ themselves, their keys among them, are passed the same way, by name; each package's
311
+ README names its own. Arguments after the image name replace the image's own, so
312
+
313
+ ```bash
314
+ docker run --rm -v "$PWD/host.toml:/etc/xippios-mcp/host.toml:ro" xippios-mcp \
315
+ --config /etc/xippios-mcp/host.toml
316
+ ```
317
+
318
+ checks the mounted config and lists its endpoints without serving them.
319
+
320
+ Inside the container the host binds `0.0.0.0`, beyond loopback, so every endpoint is
321
+ remote, whichever interface `-p` publishes the port on: give every endpoint the bearer.
322
+ An `auth = "none"` write endpoint is refused there unless it sets `allow_remote = true`
323
+ (see The loopback rule), and then nothing authenticates it but a gateway in front;
324
+ prefer the bearer. Beyond loopback the mcp SDK checks no `Host` or `Origin` header, so
325
+ behind a reverse proxy the config's `[http]` table names the values to accept (see
326
+ Behind a reverse proxy).
327
+
328
+ ## Licence
329
+
330
+ Apache-2.0. See [LICENSE](LICENSE).