sie-mcp 0.8.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.
Files changed (104) hide show
  1. sie_mcp-0.8.0/.gitignore +273 -0
  2. sie_mcp-0.8.0/Dockerfile +83 -0
  3. sie_mcp-0.8.0/PKG-INFO +14 -0
  4. sie_mcp-0.8.0/README.md +403 -0
  5. sie_mcp-0.8.0/docs/architecture.excalidraw +525 -0
  6. sie_mcp-0.8.0/docs/architecture.png +0 -0
  7. sie_mcp-0.8.0/docs/examples/mcp_smoke.py +96 -0
  8. sie_mcp-0.8.0/docs/examples/sample.html +40 -0
  9. sie_mcp-0.8.0/examples/obsidian-contract-graph/.gitignore +2 -0
  10. sie_mcp-0.8.0/examples/obsidian-contract-graph/.obsidian/app.json +1 -0
  11. sie_mcp-0.8.0/examples/obsidian-contract-graph/.obsidian/appearance.json +1 -0
  12. sie_mcp-0.8.0/examples/obsidian-contract-graph/.obsidian/core-plugins.json +33 -0
  13. sie_mcp-0.8.0/examples/obsidian-contract-graph/.obsidian/graph.json +22 -0
  14. sie_mcp-0.8.0/examples/obsidian-contract-graph/README.md +103 -0
  15. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/acme-globex-msa.html +23 -0
  16. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/globex-invoice.html +23 -0
  17. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/globex-msa-amendment.html +18 -0
  18. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/hooli-cloud.html +18 -0
  19. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/initech-invoice.html +16 -0
  20. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/initech-license.html +18 -0
  21. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/massive-dynamic-jda.html +20 -0
  22. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/omar-haddad-employment.html +25 -0
  23. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/soylent-po.html +17 -0
  24. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/stardust-nda.html +26 -0
  25. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/umbrella-sow.html +18 -0
  26. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/vandelay-supply.html +18 -0
  27. sie_mcp-0.8.0/examples/obsidian-contract-graph/inbox/wayne-series-b.html +18 -0
  28. sie_mcp-0.8.0/examples/obsidian-contract-graph/processed-fallback/Acme-Globex MSA.md +26 -0
  29. sie_mcp-0.8.0/examples/obsidian-contract-graph/token-savings.html +123 -0
  30. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Contracts/Globex MSA Amendment 1.md +31 -0
  31. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Contracts/Hooli Cloud Agreement.md +27 -0
  32. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Contracts/Initech Invoice.md +31 -0
  33. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Contracts/Initech License.md +27 -0
  34. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Contracts/Massive Dynamic JDA.md +27 -0
  35. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Contracts/Omar Haddad Employment.md +27 -0
  36. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Contracts/Soylent Foods PO.md +27 -0
  37. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Contracts/Umbrella Logistics SOW.md +27 -0
  38. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Contracts/Vandelay Supply Agreement.md +27 -0
  39. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Contracts/Wayne Data Series B.md +27 -0
  40. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Contracts.md +22 -0
  41. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Acme Corp.md +14 -0
  42. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Art Vandelay.md +13 -0
  43. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Bruce Wayne.md +13 -0
  44. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/David Okoro.md +13 -0
  45. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Gavin Park.md +13 -0
  46. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Globex Inc.md +14 -0
  47. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Hooli Cloud Services.md +14 -0
  48. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Initech Systems.md +14 -0
  49. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Jane Doe.md +13 -0
  50. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Lena Fischer.md +13 -0
  51. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Maria Chen.md +13 -0
  52. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Massive Dynamic LLC.md +14 -0
  53. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Nina Castillo.md +13 -0
  54. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Omar Haddad.md +13 -0
  55. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Priya Nair.md +13 -0
  56. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Robert Lang.md +13 -0
  57. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Sarah Klein.md +13 -0
  58. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Soylent Foods Corp.md +14 -0
  59. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Stardust Analytics LLC.md +14 -0
  60. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Tom Becker.md +13 -0
  61. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Umbrella Logistics Inc.md +14 -0
  62. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Vandelay Imports LLC.md +14 -0
  63. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Entities/Wayne Data Holdings.md +14 -0
  64. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/Home.md +9 -0
  65. sie_mcp-0.8.0/examples/obsidian-contract-graph/vault/NOTE-CONVENTIONS.md +58 -0
  66. sie_mcp-0.8.0/plugin/SKILL.md +166 -0
  67. sie_mcp-0.8.0/plugin/claude-code/extract-entities/SKILL.md +43 -0
  68. sie_mcp-0.8.0/plugin/claude-code/parse-document/SKILL.md +44 -0
  69. sie_mcp-0.8.0/plugin/claude-code/redact-pii/SKILL.md +50 -0
  70. sie_mcp-0.8.0/plugin/claude-code/summarize-document/SKILL.md +43 -0
  71. sie_mcp-0.8.0/plugin/superlinked.md +103 -0
  72. sie_mcp-0.8.0/pyproject.toml +35 -0
  73. sie_mcp-0.8.0/src/sie_mcp/__init__.py +0 -0
  74. sie_mcp-0.8.0/src/sie_mcp/app.py +37 -0
  75. sie_mcp-0.8.0/src/sie_mcp/auth.py +173 -0
  76. sie_mcp-0.8.0/src/sie_mcp/chunking.py +70 -0
  77. sie_mcp-0.8.0/src/sie_mcp/cli.py +173 -0
  78. sie_mcp-0.8.0/src/sie_mcp/config.py +273 -0
  79. sie_mcp-0.8.0/src/sie_mcp/describe.py +179 -0
  80. sie_mcp-0.8.0/src/sie_mcp/documents.py +33 -0
  81. sie_mcp-0.8.0/src/sie_mcp/jobs.py +79 -0
  82. sie_mcp-0.8.0/src/sie_mcp/oauth.py +357 -0
  83. sie_mcp-0.8.0/src/sie_mcp/ocr_routing.py +344 -0
  84. sie_mcp-0.8.0/src/sie_mcp/offload.py +422 -0
  85. sie_mcp-0.8.0/src/sie_mcp/plugin_pack.py +208 -0
  86. sie_mcp-0.8.0/src/sie_mcp/qa.py +363 -0
  87. sie_mcp-0.8.0/src/sie_mcp/savings.py +93 -0
  88. sie_mcp-0.8.0/src/sie_mcp/server.py +457 -0
  89. sie_mcp-0.8.0/src/sie_mcp/skill_zip.py +108 -0
  90. sie_mcp-0.8.0/src/sie_mcp/structured.py +394 -0
  91. sie_mcp-0.8.0/tests/conftest.py +38 -0
  92. sie_mcp-0.8.0/tests/test_auth.py +287 -0
  93. sie_mcp-0.8.0/tests/test_chunking.py +56 -0
  94. sie_mcp-0.8.0/tests/test_config.py +147 -0
  95. sie_mcp-0.8.0/tests/test_describe.py +227 -0
  96. sie_mcp-0.8.0/tests/test_jobs.py +146 -0
  97. sie_mcp-0.8.0/tests/test_oauth.py +444 -0
  98. sie_mcp-0.8.0/tests/test_ocr_routing.py +329 -0
  99. sie_mcp-0.8.0/tests/test_offload.py +219 -0
  100. sie_mcp-0.8.0/tests/test_plugin_pack.py +352 -0
  101. sie_mcp-0.8.0/tests/test_qa.py +325 -0
  102. sie_mcp-0.8.0/tests/test_server.py +107 -0
  103. sie_mcp-0.8.0/tests/test_skill_zip.py +97 -0
  104. sie_mcp-0.8.0/tests/test_structured.py +429 -0
@@ -0,0 +1,273 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ .codex/artifacts/worktree-task/
3
+
4
+ __pycache__/
5
+ *.py[codz]
6
+ *$py.class
7
+
8
+ # C extensions
9
+ *.so
10
+
11
+ # Distribution / packaging
12
+ .Python
13
+ build/
14
+ develop-eggs/
15
+ dist/
16
+ downloads/
17
+ eggs/
18
+ .eggs/
19
+ lib/
20
+ lib64/
21
+ # JS/TS projects under tools/ legitimately use a `lib/` directory.
22
+ !tools/*/lib/
23
+ !tools/*/lib/**
24
+ parts/
25
+ sdist/
26
+ var/
27
+ wheels/
28
+ share/python-wheels/
29
+ *.egg-info/
30
+ .installed.cfg
31
+ *.egg
32
+ MANIFEST
33
+
34
+ # PyInstaller
35
+ # Usually these files are written by a python script from a template
36
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
37
+ *.manifest
38
+ *.spec
39
+
40
+ # Installer logs
41
+ pip-log.txt
42
+ pip-delete-this-directory.txt
43
+
44
+ # Unit test / coverage reports
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+ .coverage
49
+ .coverage.*
50
+ .cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *.cover
54
+ *.py.cover
55
+ .hypothesis/
56
+ .pytest_cache/
57
+ cover/
58
+
59
+ # Translations
60
+ *.mo
61
+ *.pot
62
+
63
+ # Django stuff:
64
+ *.log
65
+ local_settings.py
66
+ db.sqlite3
67
+ db.sqlite3-journal
68
+
69
+ # Flask stuff:
70
+ instance/
71
+ .webassets-cache
72
+
73
+ # Scrapy stuff:
74
+ .scrapy
75
+
76
+ # Sphinx documentation
77
+ docs/_build/
78
+
79
+ # PyBuilder
80
+ .pybuilder/
81
+ target/
82
+
83
+ # Rust
84
+ *.rs.bk
85
+
86
+ # Jupyter Notebook
87
+ .ipynb_checkpoints
88
+
89
+ # IPython
90
+ profile_default/
91
+ ipython_config.py
92
+
93
+ # pyenv
94
+ # For a library or package, you might want to ignore these files since the code is
95
+ # intended to run in multiple environments; otherwise, check them in:
96
+ # .python-version
97
+
98
+ # pipenv
99
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
100
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
101
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
102
+ # install all needed dependencies.
103
+ #Pipfile.lock
104
+
105
+ # UV
106
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
107
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
108
+ # commonly ignored for libraries.
109
+ #uv.lock
110
+
111
+ # poetry
112
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
113
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
114
+ # commonly ignored for libraries.
115
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
116
+ #poetry.lock
117
+ #poetry.toml
118
+
119
+ # pdm
120
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
121
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
122
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
123
+ #pdm.lock
124
+ #pdm.toml
125
+ .pdm-python
126
+ .pdm-build/
127
+
128
+ # pixi
129
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
130
+ #pixi.lock
131
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
132
+ # in the .venv directory. It is recommended not to include this directory in version control.
133
+ .pixi
134
+
135
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
136
+ __pypackages__/
137
+
138
+ # Celery stuff
139
+ celerybeat-schedule
140
+ celerybeat.pid
141
+
142
+ # SageMath parsed files
143
+ *.sage.py
144
+
145
+ # Environments
146
+ .env
147
+ # Local service credential bundles must never be committed.
148
+ *-secrets.env
149
+ .env.cloud
150
+ .venv
151
+ env/
152
+ venv/
153
+ ENV/
154
+ env.bak/
155
+ venv.bak/
156
+
157
+ # Spyder project settings
158
+ .spyderproject
159
+ .spyproject
160
+
161
+ # Rope project settings
162
+ .ropeproject
163
+
164
+ # mkdocs documentation
165
+ /site
166
+
167
+ # Pyre type checker
168
+ .pyre/
169
+
170
+ # pytype static type analyzer
171
+ .pytype/
172
+
173
+ # Cython debug symbols
174
+ cython_debug/
175
+
176
+ # PyCharm
177
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
178
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
179
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
180
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
181
+ #.idea/
182
+
183
+ # Abstra
184
+ # Abstra is an AI-powered process automation framework.
185
+ # Ignore directories containing user credentials, local state, and settings.
186
+ # Learn more at https://abstra.io/docs
187
+ .abstra/
188
+
189
+ # Visual Studio Code
190
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
191
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
192
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
193
+ # you could uncomment the following to ignore the entire vscode folder
194
+ # .vscode/
195
+
196
+ # Ruff stuff:
197
+ .ruff_cache/
198
+
199
+ # PyPI configuration file
200
+ .pypirc
201
+
202
+ # Cursor
203
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
204
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
205
+ # refer to https://docs.cursor.com/context/ignore-files
206
+ .cursorignore
207
+ .cursorindexingignore
208
+
209
+ # vcscode
210
+ .vscode
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
216
+
217
+ # SIE specific
218
+ # Model weights cache
219
+ .cache/
220
+ *.safetensors
221
+ *.bin
222
+
223
+ # Secrets (never commit)
224
+ *.pem
225
+ *.key
226
+ credentials.json
227
+ *-key.json
228
+
229
+ # Terraform
230
+ # Local .terraform directories (cached providers/modules)
231
+ **/.terraform/*
232
+ .terraform.lock*
233
+ # State files (contain sensitive data)
234
+ *.tfstate
235
+ *.tfstate.*
236
+ # Crash log files
237
+ crash.log
238
+ crash.*.log
239
+ # Override files (local developer overrides)
240
+ override.tf
241
+ override.tf.json
242
+ *_override.tf
243
+ *_override.tf.json
244
+ # tfvars files may contain secrets
245
+ *.tfvars
246
+ *.tfvars.json
247
+
248
+ # Node.js
249
+ node_modules/
250
+
251
+ # OS
252
+ .DS_Store
253
+ Thumbs.db
254
+
255
+ # VIM
256
+ *.swp
257
+
258
+ # kilocode
259
+ .kilo/
260
+ .kilocode/
261
+
262
+ # Worktree metadata
263
+ .base-branch
264
+
265
+ # Temporary files
266
+ tmp/
267
+ .tmp/
268
+ .local/
269
+
270
+ b6_results.json
271
+ # Personal mise overrides (per-developer toolchain tweaks, e.g. rustup
272
+ # component naming differences across rustup versions).
273
+ mise.local.toml
@@ -0,0 +1,83 @@
1
+ # syntax=docker/dockerfile:1.6
2
+ # SIE MCP edge — hosted MCP server exposing SIE document jobs.
3
+ # Lightweight image: a sie_sdk client, no GPU/model dependencies.
4
+ #
5
+ # Build (from repo root):
6
+ # docker build -t sie-mcp:latest -f packages/sie_mcp/Dockerfile .
7
+ #
8
+ # Run:
9
+ # docker run -p 8088:8088 \
10
+ # -e SIE_BASE_URL=https://your-gateway \
11
+ # -e SIE_MCP_CONNECTOR_SECRETS=your-secret \
12
+ # sie-mcp:latest
13
+
14
+ # =============================================================================
15
+ # Dependency builder: install the edge and its dependencies
16
+ # =============================================================================
17
+ FROM python:3.12-slim AS builder
18
+
19
+ WORKDIR /app
20
+
21
+ # Copy sie-sdk first (a dependency of sie-mcp); installing it editable satisfies
22
+ # the sie-sdk requirement so `pip install -e .` resolves without hitting PyPI.
23
+ COPY packages/sie_sdk /tmp/sie_sdk
24
+
25
+ # Copy sie-mcp files
26
+ COPY packages/sie_mcp/pyproject.toml ./
27
+ COPY packages/sie_mcp/src src/
28
+
29
+ # Create venv and install sie-sdk + sie-mcp (pulls mcp, starlette, uvicorn,
30
+ # typer, jsonschema, pypdfium2, pillow from PyPI).
31
+ RUN --mount=type=cache,target=/root/.cache/pip \
32
+ python -m venv .venv \
33
+ && .venv/bin/pip install --upgrade pip \
34
+ && .venv/bin/pip install \
35
+ -e /tmp/sie_sdk \
36
+ -e "."
37
+
38
+ # Clean up to reduce image size
39
+ RUN find .venv -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true \
40
+ && find .venv -type f -name "*.pyc" -delete 2>/dev/null || true \
41
+ && find .venv -type d -name "tests" -exec rm -rf {} + 2>/dev/null || true \
42
+ && find .venv -type d -name "test" -exec rm -rf {} + 2>/dev/null || true
43
+
44
+ # =============================================================================
45
+ # Runtime image: minimal MCP edge
46
+ # =============================================================================
47
+ FROM python:3.12-slim AS runtime
48
+
49
+ # Create non-root user
50
+ RUN useradd --create-home --shell /bin/bash sie
51
+
52
+ WORKDIR /app
53
+
54
+ # Copy virtual environment from builder
55
+ COPY --from=builder --chown=sie:sie /app/.venv /app/.venv
56
+
57
+ # Copy source code (pip -e creates editable installs with .pth pointing to src)
58
+ COPY --from=builder --chown=sie:sie /app/src /app/src
59
+
60
+ # Copy the plugin dir (SKILL.md etc.) so the in-container `sie-mcp skill-zip`
61
+ # helper can find it (cli.py resolves it at /app/plugin/SKILL.md).
62
+ COPY --chown=sie:sie packages/sie_mcp/plugin /app/plugin
63
+
64
+ # Copy sie-sdk source (installed as editable in /tmp)
65
+ COPY --from=builder --chown=sie:sie /tmp/sie_sdk/src /tmp/sie_sdk/src
66
+
67
+ ENV PATH="/app/.venv/bin:$PATH" \
68
+ PYTHONUNBUFFERED=1 \
69
+ PYTHONDONTWRITEBYTECODE=1
70
+
71
+ USER sie
72
+
73
+ # Default MCP edge port (sie_mcp.cli serve --port default)
74
+ EXPOSE 8088
75
+
76
+ # Health check — /healthz is unauthenticated and does not require the cluster.
77
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
78
+ CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8088/healthz')" || exit 1
79
+
80
+ # Default command — the connector-secret / cluster URL are supplied via env
81
+ # (SIE_BASE_URL, SIE_MCP_CONNECTOR_SECRETS, SIE_MCP_PUBLIC_URL, ...).
82
+ ENTRYPOINT ["sie-mcp", "serve"]
83
+ CMD ["--host", "0.0.0.0", "--port", "8088"]
sie_mcp-0.8.0/PKG-INFO ADDED
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.5
2
+ Name: sie-mcp
3
+ Version: 0.8.0
4
+ Summary: SIE MCP edge - hosted MCP server exposing SIE document jobs
5
+ License: Apache-2.0
6
+ Requires-Python: <3.13,>=3.12
7
+ Requires-Dist: jsonschema>=4
8
+ Requires-Dist: mcp<2,>=1.9
9
+ Requires-Dist: pillow>=12.2.0
10
+ Requires-Dist: pypdfium2>=5.6.0
11
+ Requires-Dist: sie-sdk>=0.1
12
+ Requires-Dist: starlette>=1.3.1
13
+ Requires-Dist: typer<1,>=0.14
14
+ Requires-Dist: uvicorn[standard]<1,>=0.32