reef-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.
- reef_mcp-0.1.0/.gitignore +237 -0
- reef_mcp-0.1.0/LICENSE +202 -0
- reef_mcp-0.1.0/PKG-INFO +116 -0
- reef_mcp-0.1.0/README.md +90 -0
- reef_mcp-0.1.0/examples/the-door/reef.yaml +19 -0
- reef_mcp-0.1.0/examples/the-door/trellis/agents.yaml +17 -0
- reef_mcp-0.1.0/examples/the-door/trellis/contracts/finance.gl.yaml +26 -0
- reef_mcp-0.1.0/examples/the-door/trellis/contracts/hr.headcount.yaml +17 -0
- reef_mcp-0.1.0/examples/the-door/trellis/contracts/hr.payroll.yaml +21 -0
- reef_mcp-0.1.0/examples/the-door/trellis/identity.yaml +9 -0
- reef_mcp-0.1.0/examples/the-door/trellis/people.yaml +9 -0
- reef_mcp-0.1.0/pyproject.toml +49 -0
- reef_mcp-0.1.0/src/reef/__init__.py +12 -0
- reef_mcp-0.1.0/src/reef/agent.py +56 -0
- reef_mcp-0.1.0/src/reef/cli.py +161 -0
- reef_mcp-0.1.0/src/reef/config.py +124 -0
- reef_mcp-0.1.0/src/reef/demo.py +227 -0
- reef_mcp-0.1.0/src/reef/downstream.py +57 -0
- reef_mcp-0.1.0/src/reef/gateway.py +445 -0
- reef_mcp-0.1.0/src/reef/py.typed +0 -0
- reef_mcp-0.1.0/src/reef/quickstart.py +260 -0
- reef_mcp-0.1.0/src/reef/relay.py +89 -0
- reef_mcp-0.1.0/src/reef/samples.py +172 -0
- reef_mcp-0.1.0/src/reef/server.py +97 -0
- reef_mcp-0.1.0/src/reef/stack.py +139 -0
- reef_mcp-0.1.0/tests/test_quickstart.py +147 -0
- reef_mcp-0.1.0/tests/test_reef.py +470 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
__pycache__/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
*.egg-info/
|
|
4
|
+
.venv/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
.pytest_cache/
|
|
8
|
+
.mypy_cache/
|
|
9
|
+
.ruff_cache/
|
|
10
|
+
.coverage
|
|
11
|
+
*.db
|
|
12
|
+
*.db-journal
|
|
13
|
+
|
|
14
|
+
# Signing keys (made on first use)
|
|
15
|
+
*.key
|
|
16
|
+
|
|
17
|
+
# --- GitHub's Python template (from the repo's first commit) ---
|
|
18
|
+
# Byte-compiled / optimized / DLL files
|
|
19
|
+
__pycache__/
|
|
20
|
+
*.py[codz]
|
|
21
|
+
*$py.class
|
|
22
|
+
|
|
23
|
+
# C extensions
|
|
24
|
+
*.so
|
|
25
|
+
|
|
26
|
+
# Distribution / packaging
|
|
27
|
+
.Python
|
|
28
|
+
build/
|
|
29
|
+
develop-eggs/
|
|
30
|
+
dist/
|
|
31
|
+
downloads/
|
|
32
|
+
eggs/
|
|
33
|
+
.eggs/
|
|
34
|
+
lib/
|
|
35
|
+
lib64/
|
|
36
|
+
parts/
|
|
37
|
+
sdist/
|
|
38
|
+
var/
|
|
39
|
+
wheels/
|
|
40
|
+
share/python-wheels/
|
|
41
|
+
*.egg-info/
|
|
42
|
+
.installed.cfg
|
|
43
|
+
*.egg
|
|
44
|
+
MANIFEST
|
|
45
|
+
|
|
46
|
+
# PyInstaller
|
|
47
|
+
# Usually these files are written by a python script from a template
|
|
48
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
49
|
+
*.manifest
|
|
50
|
+
*.spec
|
|
51
|
+
|
|
52
|
+
# Installer logs
|
|
53
|
+
pip-log.txt
|
|
54
|
+
pip-delete-this-directory.txt
|
|
55
|
+
|
|
56
|
+
# Unit test / coverage reports
|
|
57
|
+
htmlcov/
|
|
58
|
+
.tox/
|
|
59
|
+
.nox/
|
|
60
|
+
.coverage
|
|
61
|
+
.coverage.*
|
|
62
|
+
.cache
|
|
63
|
+
nosetests.xml
|
|
64
|
+
coverage.xml
|
|
65
|
+
*.cover
|
|
66
|
+
*.py.cover
|
|
67
|
+
*.lcov
|
|
68
|
+
.hypothesis/
|
|
69
|
+
.pytest_cache/
|
|
70
|
+
cover/
|
|
71
|
+
|
|
72
|
+
# Translations
|
|
73
|
+
*.mo
|
|
74
|
+
*.pot
|
|
75
|
+
|
|
76
|
+
# Django stuff:
|
|
77
|
+
*.log
|
|
78
|
+
local_settings.py
|
|
79
|
+
db.sqlite3
|
|
80
|
+
db.sqlite3-journal
|
|
81
|
+
|
|
82
|
+
# Flask stuff:
|
|
83
|
+
instance/
|
|
84
|
+
.webassets-cache
|
|
85
|
+
|
|
86
|
+
# Scrapy stuff:
|
|
87
|
+
.scrapy
|
|
88
|
+
|
|
89
|
+
# Sphinx documentation
|
|
90
|
+
docs/_build/
|
|
91
|
+
|
|
92
|
+
# PyBuilder
|
|
93
|
+
.pybuilder/
|
|
94
|
+
target/
|
|
95
|
+
|
|
96
|
+
# Jupyter Notebook
|
|
97
|
+
.ipynb_checkpoints
|
|
98
|
+
|
|
99
|
+
# IPython
|
|
100
|
+
profile_default/
|
|
101
|
+
ipython_config.py
|
|
102
|
+
|
|
103
|
+
# pyenv
|
|
104
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
105
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
106
|
+
# .python-version
|
|
107
|
+
|
|
108
|
+
# pipenv
|
|
109
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
110
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
111
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
112
|
+
# install all needed dependencies.
|
|
113
|
+
# Pipfile.lock
|
|
114
|
+
|
|
115
|
+
# uv
|
|
116
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
117
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
118
|
+
# commonly ignored for libraries.
|
|
119
|
+
# uv.lock
|
|
120
|
+
|
|
121
|
+
# poetry
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
123
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
124
|
+
# commonly ignored for libraries.
|
|
125
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
126
|
+
# poetry.lock
|
|
127
|
+
# poetry.toml
|
|
128
|
+
|
|
129
|
+
# pdm
|
|
130
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
131
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
132
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
133
|
+
# pdm.lock
|
|
134
|
+
# pdm.toml
|
|
135
|
+
.pdm-python
|
|
136
|
+
.pdm-build/
|
|
137
|
+
|
|
138
|
+
# pixi
|
|
139
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
140
|
+
# pixi.lock
|
|
141
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
142
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
143
|
+
.pixi/*
|
|
144
|
+
!.pixi/config.toml
|
|
145
|
+
|
|
146
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
147
|
+
__pypackages__/
|
|
148
|
+
|
|
149
|
+
# Celery stuff
|
|
150
|
+
celerybeat-schedule*
|
|
151
|
+
celerybeat.pid
|
|
152
|
+
|
|
153
|
+
# Redis
|
|
154
|
+
*.rdb
|
|
155
|
+
*.aof
|
|
156
|
+
*.pid
|
|
157
|
+
|
|
158
|
+
# RabbitMQ
|
|
159
|
+
mnesia/
|
|
160
|
+
rabbitmq/
|
|
161
|
+
rabbitmq-data/
|
|
162
|
+
|
|
163
|
+
# ActiveMQ
|
|
164
|
+
activemq-data/
|
|
165
|
+
|
|
166
|
+
# SageMath parsed files
|
|
167
|
+
*.sage.py
|
|
168
|
+
|
|
169
|
+
# Environments
|
|
170
|
+
.env
|
|
171
|
+
.envrc
|
|
172
|
+
.venv
|
|
173
|
+
env/
|
|
174
|
+
venv/
|
|
175
|
+
ENV/
|
|
176
|
+
env.bak/
|
|
177
|
+
venv.bak/
|
|
178
|
+
|
|
179
|
+
# Spyder project settings
|
|
180
|
+
.spyderproject
|
|
181
|
+
.spyproject
|
|
182
|
+
|
|
183
|
+
# Rope project settings
|
|
184
|
+
.ropeproject
|
|
185
|
+
|
|
186
|
+
# mkdocs/Zensical documentation
|
|
187
|
+
/site
|
|
188
|
+
|
|
189
|
+
# mypy
|
|
190
|
+
.mypy_cache/
|
|
191
|
+
.dmypy.json
|
|
192
|
+
dmypy.json
|
|
193
|
+
|
|
194
|
+
# Pyre type checker
|
|
195
|
+
.pyre/
|
|
196
|
+
|
|
197
|
+
# pytype static type analyzer
|
|
198
|
+
.pytype/
|
|
199
|
+
|
|
200
|
+
# Cython debug symbols
|
|
201
|
+
cython_debug/
|
|
202
|
+
|
|
203
|
+
# PyCharm
|
|
204
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
205
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
206
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
207
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
208
|
+
# .idea/
|
|
209
|
+
|
|
210
|
+
# Abstra
|
|
211
|
+
# Abstra is an AI-powered process automation framework.
|
|
212
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
213
|
+
# Learn more at https://abstra.io/docs
|
|
214
|
+
.abstra/
|
|
215
|
+
|
|
216
|
+
# Visual Studio Code
|
|
217
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
|
|
218
|
+
# can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
219
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer, you
|
|
220
|
+
# could uncomment the following to ignore the entire vscode folder
|
|
221
|
+
# .vscode/
|
|
222
|
+
# Temporary file for partial code execution
|
|
223
|
+
tempCodeRunnerFile.py
|
|
224
|
+
|
|
225
|
+
# Ruff stuff:
|
|
226
|
+
.ruff_cache/
|
|
227
|
+
|
|
228
|
+
# PyPI configuration file
|
|
229
|
+
.pypirc
|
|
230
|
+
|
|
231
|
+
# Marimo
|
|
232
|
+
marimo/_static/
|
|
233
|
+
marimo/_lsp/
|
|
234
|
+
__marimo__/
|
|
235
|
+
|
|
236
|
+
# Streamlit
|
|
237
|
+
.streamlit/secrets.toml
|
reef_mcp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
reef_mcp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: reef-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A grant-shaped MCP gateway: agents see and call only what their Trellis grant allows.
|
|
5
|
+
Project-URL: Homepage, https://github.com/FatherBrian/trellis/tree/main/reef
|
|
6
|
+
Project-URL: Issues, https://github.com/FatherBrian/trellis/issues
|
|
7
|
+
Author: Trellis contributors
|
|
8
|
+
License-Expression: Apache-2.0
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: access-control,ai-agents,audit,gateway,mcp
|
|
11
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Security
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Requires-Dist: anyio>=4
|
|
22
|
+
Requires-Dist: mcp<3,>=2.3
|
|
23
|
+
Requires-Dist: trellisd<0.2,>=0.1.0
|
|
24
|
+
Requires-Dist: uvicorn>=0.30
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# Reef
|
|
28
|
+
|
|
29
|
+
Reef is the door in front of your MCP servers. An agent connects once, with its Trellis
|
|
30
|
+
grant token, and sees only the tools its grant allows. Every call it makes is decided by
|
|
31
|
+
Trellis's three checks and written to the Trellis ledger before anything is forwarded.
|
|
32
|
+
|
|
33
|
+
Package: `reef-mcp`. It depends on [`trellisd`](https://github.com/FatherBrian/trellis/blob/main/README.md) and runs Trellis in the same
|
|
34
|
+
process.
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
pip install reef-mcp
|
|
38
|
+
reef demo the-door
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## What it does
|
|
42
|
+
|
|
43
|
+
| | A persona-based gateway | Reef |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| Tool list | A fixed bundle per persona | Built per request from what the grant allows |
|
|
46
|
+
| A tool outside the grant | Listed, then fails | Never listed; a call is denied at the door |
|
|
47
|
+
| Downstream credentials | A secret per server, often the agent's | Per server: the person's own token (obo), the agent's own (agent), or a service credential only Reef holds (brokered) |
|
|
48
|
+
| Masks and row filters | The server's problem | Applied by Reef to the result, and passed to the server in `_meta` so it can push them down |
|
|
49
|
+
| Audit | Per server, if at all | Every list and call in one hash-chained ledger |
|
|
50
|
+
|
|
51
|
+
On `tools/list`, Reef runs the three checks for every tool it fronts (without a ledger
|
|
52
|
+
entry each) and writes one `tools.listed` event naming what it showed and what it hid.
|
|
53
|
+
|
|
54
|
+
On `tools/call`:
|
|
55
|
+
|
|
56
|
+
1. Trellis decides. The decision event is written first; if it can't be, the answer is a deny.
|
|
57
|
+
2. A deny returns the check that refused and who to ask: the contract's owner, the agent's
|
|
58
|
+
owner, or the person who gave the grant. Reef records that it blocked the call, and
|
|
59
|
+
nothing reaches the server.
|
|
60
|
+
3. Reef gets the credential the server's mode calls for. The ledger records the exchange,
|
|
61
|
+
never the token.
|
|
62
|
+
4. Reef writes the enforcement event, and forwards only once that write succeeds.
|
|
63
|
+
5. It masks columns and filters rows in the result, and writes the outcome before the
|
|
64
|
+
agent sees it. A result it can't record, or can't apply the obligations to, is held back.
|
|
65
|
+
|
|
66
|
+
`trellisd trace <event>` shows a decision together with what the door did with it.
|
|
67
|
+
|
|
68
|
+
## Configure
|
|
69
|
+
|
|
70
|
+
`reef.yaml` lists the servers behind Reef:
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
reef:
|
|
74
|
+
servers:
|
|
75
|
+
ledger:
|
|
76
|
+
url: https://ledger.internal/mcp
|
|
77
|
+
credential: obo # the person's own token, exchanged at their IdP
|
|
78
|
+
audience: ledger-mcp
|
|
79
|
+
tools:
|
|
80
|
+
journal_entries: {action: query}
|
|
81
|
+
post_adjustment: {action: write}
|
|
82
|
+
hr:
|
|
83
|
+
url: https://hr.internal/mcp
|
|
84
|
+
credential: brokered # a service credential Reef holds
|
|
85
|
+
credential_env: REEF_HR_TOKEN
|
|
86
|
+
tools:
|
|
87
|
+
headcount: {action: read}
|
|
88
|
+
payroll: {action: read}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Each tool's address is `mcp://<server>/<tool>` unless it names another `resource`. A
|
|
92
|
+
Trellis contract binds that address, so the contract says what the tool is, who may use it
|
|
93
|
+
and what gets masked. A tool no contract binds is denied and never listed; a tool the
|
|
94
|
+
server offers and `reef.yaml` doesn't name is hidden.
|
|
95
|
+
|
|
96
|
+
Agents see each tool as `<server>_<tool>`, a name every MCP client accepts.
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
reef serve --config reef.yaml --trellis trellis/ --db postgresql://... \
|
|
100
|
+
--key trellis.key --trellis-port 8180
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Agents get their grant token from Trellis's token endpoint (`POST /token`) and send it
|
|
104
|
+
to Reef as `Authorization: Bearer <grant token>`. `--trellis-port` serves that endpoint
|
|
105
|
+
from Reef's own process, which obo mode needs: the person's sign-in is held in memory
|
|
106
|
+
only, so the endpoint that takes it and the door that uses it must be one process.
|
|
107
|
+
|
|
108
|
+
For trying it out, `reef sample ledger|hr` runs the sample MCP servers, and
|
|
109
|
+
[quickstart/](https://github.com/FatherBrian/trellis/blob/main/quickstart/README.md) runs the whole thing with `docker compose up`.
|
|
110
|
+
|
|
111
|
+
## Limits in v0.1
|
|
112
|
+
|
|
113
|
+
- Trellis runs inside Reef. A Reef in front of a remote Trellis, over AuthZEN, comes later.
|
|
114
|
+
- Reef applies masks and row filters to results shaped as rows: a list of objects, or an
|
|
115
|
+
object holding one. Any other shape, when there's something to apply, is held back.
|
|
116
|
+
- The person's sign-in is held in memory for obo mode, so a restart means signing in again.
|
reef_mcp-0.1.0/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Reef
|
|
2
|
+
|
|
3
|
+
Reef is the door in front of your MCP servers. An agent connects once, with its Trellis
|
|
4
|
+
grant token, and sees only the tools its grant allows. Every call it makes is decided by
|
|
5
|
+
Trellis's three checks and written to the Trellis ledger before anything is forwarded.
|
|
6
|
+
|
|
7
|
+
Package: `reef-mcp`. It depends on [`trellisd`](https://github.com/FatherBrian/trellis/blob/main/README.md) and runs Trellis in the same
|
|
8
|
+
process.
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
pip install reef-mcp
|
|
12
|
+
reef demo the-door
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## What it does
|
|
16
|
+
|
|
17
|
+
| | A persona-based gateway | Reef |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| Tool list | A fixed bundle per persona | Built per request from what the grant allows |
|
|
20
|
+
| A tool outside the grant | Listed, then fails | Never listed; a call is denied at the door |
|
|
21
|
+
| Downstream credentials | A secret per server, often the agent's | Per server: the person's own token (obo), the agent's own (agent), or a service credential only Reef holds (brokered) |
|
|
22
|
+
| Masks and row filters | The server's problem | Applied by Reef to the result, and passed to the server in `_meta` so it can push them down |
|
|
23
|
+
| Audit | Per server, if at all | Every list and call in one hash-chained ledger |
|
|
24
|
+
|
|
25
|
+
On `tools/list`, Reef runs the three checks for every tool it fronts (without a ledger
|
|
26
|
+
entry each) and writes one `tools.listed` event naming what it showed and what it hid.
|
|
27
|
+
|
|
28
|
+
On `tools/call`:
|
|
29
|
+
|
|
30
|
+
1. Trellis decides. The decision event is written first; if it can't be, the answer is a deny.
|
|
31
|
+
2. A deny returns the check that refused and who to ask: the contract's owner, the agent's
|
|
32
|
+
owner, or the person who gave the grant. Reef records that it blocked the call, and
|
|
33
|
+
nothing reaches the server.
|
|
34
|
+
3. Reef gets the credential the server's mode calls for. The ledger records the exchange,
|
|
35
|
+
never the token.
|
|
36
|
+
4. Reef writes the enforcement event, and forwards only once that write succeeds.
|
|
37
|
+
5. It masks columns and filters rows in the result, and writes the outcome before the
|
|
38
|
+
agent sees it. A result it can't record, or can't apply the obligations to, is held back.
|
|
39
|
+
|
|
40
|
+
`trellisd trace <event>` shows a decision together with what the door did with it.
|
|
41
|
+
|
|
42
|
+
## Configure
|
|
43
|
+
|
|
44
|
+
`reef.yaml` lists the servers behind Reef:
|
|
45
|
+
|
|
46
|
+
```yaml
|
|
47
|
+
reef:
|
|
48
|
+
servers:
|
|
49
|
+
ledger:
|
|
50
|
+
url: https://ledger.internal/mcp
|
|
51
|
+
credential: obo # the person's own token, exchanged at their IdP
|
|
52
|
+
audience: ledger-mcp
|
|
53
|
+
tools:
|
|
54
|
+
journal_entries: {action: query}
|
|
55
|
+
post_adjustment: {action: write}
|
|
56
|
+
hr:
|
|
57
|
+
url: https://hr.internal/mcp
|
|
58
|
+
credential: brokered # a service credential Reef holds
|
|
59
|
+
credential_env: REEF_HR_TOKEN
|
|
60
|
+
tools:
|
|
61
|
+
headcount: {action: read}
|
|
62
|
+
payroll: {action: read}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Each tool's address is `mcp://<server>/<tool>` unless it names another `resource`. A
|
|
66
|
+
Trellis contract binds that address, so the contract says what the tool is, who may use it
|
|
67
|
+
and what gets masked. A tool no contract binds is denied and never listed; a tool the
|
|
68
|
+
server offers and `reef.yaml` doesn't name is hidden.
|
|
69
|
+
|
|
70
|
+
Agents see each tool as `<server>_<tool>`, a name every MCP client accepts.
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
reef serve --config reef.yaml --trellis trellis/ --db postgresql://... \
|
|
74
|
+
--key trellis.key --trellis-port 8180
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Agents get their grant token from Trellis's token endpoint (`POST /token`) and send it
|
|
78
|
+
to Reef as `Authorization: Bearer <grant token>`. `--trellis-port` serves that endpoint
|
|
79
|
+
from Reef's own process, which obo mode needs: the person's sign-in is held in memory
|
|
80
|
+
only, so the endpoint that takes it and the door that uses it must be one process.
|
|
81
|
+
|
|
82
|
+
For trying it out, `reef sample ledger|hr` runs the sample MCP servers, and
|
|
83
|
+
[quickstart/](https://github.com/FatherBrian/trellis/blob/main/quickstart/README.md) runs the whole thing with `docker compose up`.
|
|
84
|
+
|
|
85
|
+
## Limits in v0.1
|
|
86
|
+
|
|
87
|
+
- Trellis runs inside Reef. A Reef in front of a remote Trellis, over AuthZEN, comes later.
|
|
88
|
+
- Reef applies masks and row filters to results shaped as rows: a list of objects, or an
|
|
89
|
+
object holding one. Any other shape, when there's something to apply, is held back.
|
|
90
|
+
- The person's sign-in is held in memory for obo mode, so a restart means signing in again.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Reef: one MCP endpoint in front of two servers. Agents connect with their Trellis grant
|
|
2
|
+
# token and see only the tools their grant allows. `reef demo the-door` starts both sample
|
|
3
|
+
# servers and fills in their URLs.
|
|
4
|
+
reef:
|
|
5
|
+
servers:
|
|
6
|
+
ledger:
|
|
7
|
+
url: http://127.0.0.1:9101/mcp
|
|
8
|
+
credential: obo # the person's own token, exchanged for this audience
|
|
9
|
+
audience: ledger-mcp
|
|
10
|
+
tools:
|
|
11
|
+
journal_entries: {action: query}
|
|
12
|
+
post_adjustment: {action: write}
|
|
13
|
+
hr:
|
|
14
|
+
url: http://127.0.0.1:9102/mcp
|
|
15
|
+
credential: brokered # a service credential Reef holds; agents never see it
|
|
16
|
+
credential_env: REEF_HR_TOKEN
|
|
17
|
+
tools:
|
|
18
|
+
headcount: {action: read}
|
|
19
|
+
payroll: {action: read}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Each agent's owner sets its ceiling: the most it may ever touch, whoever it works for.
|
|
2
|
+
agents:
|
|
3
|
+
report-bot:
|
|
4
|
+
owner: dana@example.com
|
|
5
|
+
description: Drafts finance reports.
|
|
6
|
+
identities: [local:report-bot]
|
|
7
|
+
ceiling:
|
|
8
|
+
actions: [read, query]
|
|
9
|
+
# confidential covers the levels under it (public, internal) too.
|
|
10
|
+
tags: [finance, hr, pii, confidential]
|
|
11
|
+
people-bot:
|
|
12
|
+
owner: hr-lead@example.com
|
|
13
|
+
description: Answers HR questions.
|
|
14
|
+
identities: [local:people-bot]
|
|
15
|
+
ceiling:
|
|
16
|
+
actions: [read, query]
|
|
17
|
+
tags: [hr, pii, confidential]
|