rossum-mcp 0.4.0__tar.gz → 1.0.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.
- rossum_mcp-1.0.0/LICENSE +21 -0
- rossum_mcp-1.0.0/PKG-INFO +241 -0
- rossum_mcp-1.0.0/README.md +192 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/pyproject.toml +14 -8
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/__init__.py +1 -1
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/annotations.py +11 -1
- rossum_mcp-1.0.0/rossum_mcp/tools/base.py +73 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/catalog.py +8 -1
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/discovery.py +2 -1
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/email_templates.py +5 -9
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/hooks.py +15 -11
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/queues.py +25 -6
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/rules.py +10 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/schemas.py +23 -7
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/workspaces.py +9 -1
- rossum_mcp-1.0.0/rossum_mcp.egg-info/PKG-INFO +241 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp.egg-info/SOURCES.txt +1 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp.egg-info/requires.txt +4 -4
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/tests/test_catalog.py +16 -0
- rossum_mcp-0.4.0/PKG-INFO +0 -1895
- rossum_mcp-0.4.0/README.md +0 -1848
- rossum_mcp-0.4.0/rossum_mcp/tools/base.py +0 -40
- rossum_mcp-0.4.0/rossum_mcp.egg-info/PKG-INFO +0 -1895
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/logging_config.py +0 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/py.typed +0 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/server.py +0 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/__init__.py +0 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/document_relations.py +0 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/engines.py +0 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/relations.py +0 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp/tools/users.py +0 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp.egg-info/dependency_links.txt +0 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp.egg-info/entry_points.txt +0 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/rossum_mcp.egg-info/top_level.txt +0 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/setup.cfg +0 -0
- {rossum_mcp-0.4.0 → rossum_mcp-1.0.0}/tests/test_logging_config.py +0 -0
rossum_mcp-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Rossum MCP Server Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rossum-mcp
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: MCP server for AI-powered Rossum orchestration: document workflows, debug pipelines automatically, and configure intelligent document processing through natural language.
|
|
5
|
+
Author-email: "Dan Stancl (Rossum AI)" <daniel.stancl@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: mcp,rossum,document-processing
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: fastmcp>=2.0.0
|
|
21
|
+
Requires-Dist: pydantic>2.0.0
|
|
22
|
+
Requires-Dist: rossum-api>=3.8.0
|
|
23
|
+
Provides-Extra: docs
|
|
24
|
+
Requires-Dist: myst-parser>=2.0.0; extra == "docs"
|
|
25
|
+
Requires-Dist: sphinx>=7.0.0; extra == "docs"
|
|
26
|
+
Requires-Dist: sphinx-autodoc-typehints>=1.25.0; extra == "docs"
|
|
27
|
+
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "docs"
|
|
28
|
+
Requires-Dist: sphinx-rtd-theme>=2.0.0; extra == "docs"
|
|
29
|
+
Provides-Extra: tests
|
|
30
|
+
Requires-Dist: coverage>=7.0.0; extra == "tests"
|
|
31
|
+
Requires-Dist: pytest>=7.0.0; extra == "tests"
|
|
32
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "tests"
|
|
33
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "tests"
|
|
34
|
+
Requires-Dist: redis>=7.0.0; extra == "tests"
|
|
35
|
+
Provides-Extra: all
|
|
36
|
+
Requires-Dist: coverage>=7.0.0; extra == "all"
|
|
37
|
+
Requires-Dist: fastmcp>=2.0.0; extra == "all"
|
|
38
|
+
Requires-Dist: myst-parser>=2.0.0; extra == "all"
|
|
39
|
+
Requires-Dist: pydantic>2.0.0; extra == "all"
|
|
40
|
+
Requires-Dist: pytest>=7.0.0; extra == "all"
|
|
41
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "all"
|
|
42
|
+
Requires-Dist: redis>=7.0.0; extra == "all"
|
|
43
|
+
Requires-Dist: rossum-api>=3.8.0; extra == "all"
|
|
44
|
+
Requires-Dist: sphinx>=7.0.0; extra == "all"
|
|
45
|
+
Requires-Dist: sphinx-autodoc-typehints>=1.25.0; extra == "all"
|
|
46
|
+
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "all"
|
|
47
|
+
Requires-Dist: sphinx-rtd-theme>=2.0.0; extra == "all"
|
|
48
|
+
Dynamic: license-file
|
|
49
|
+
|
|
50
|
+
# Rossum MCP Server
|
|
51
|
+
|
|
52
|
+
<div align="center">
|
|
53
|
+
|
|
54
|
+
**MCP server for AI-powered Rossum document processing. 56 tools for queues, schemas, hooks, engines, and more.**
|
|
55
|
+
|
|
56
|
+
[](https://stancld.github.io/rossum-agents/)
|
|
57
|
+
[](https://www.python.org/downloads/)
|
|
58
|
+
[](https://opensource.org/licenses/MIT)
|
|
59
|
+
[](https://pypi.org/project/rossum-mcp/)
|
|
60
|
+
[](https://codecov.io/gh/stancld/rossum-agents)
|
|
61
|
+
[](#available-tools)
|
|
62
|
+
|
|
63
|
+
[](https://github.com/rossumai/rossum-api)
|
|
64
|
+
[](https://modelcontextprotocol.io/)
|
|
65
|
+
[](https://github.com/astral-sh/ruff)
|
|
66
|
+
[](https://github.com/astral-sh/ty)
|
|
67
|
+
[](https://github.com/astral-sh/uv)
|
|
68
|
+
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
> [!NOTE]
|
|
72
|
+
> This is not an official Rossum project. It is a community-developed integration built on top of the Rossum API.
|
|
73
|
+
|
|
74
|
+
> [!NOTE]
|
|
75
|
+
> API is stable starting from 1.0.0. Breaking changes will follow SemVer (released as 2.0.0+).
|
|
76
|
+
|
|
77
|
+
## Quick Start
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Set environment variables
|
|
81
|
+
export ROSSUM_API_TOKEN="your-api-token"
|
|
82
|
+
export ROSSUM_API_BASE_URL="https://api.elis.rossum.ai/v1"
|
|
83
|
+
|
|
84
|
+
# Run the MCP server
|
|
85
|
+
uv pip install rossum-mcp
|
|
86
|
+
rossum-mcp
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Or run from source:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git clone https://github.com/stancld/rossum-agents.git
|
|
93
|
+
cd rossum-mcp/rossum-mcp
|
|
94
|
+
uv sync
|
|
95
|
+
python rossum_mcp/server.py
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Claude Desktop Configuration
|
|
99
|
+
|
|
100
|
+
Configure Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json` on Mac):
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"mcpServers": {
|
|
105
|
+
"rossum": {
|
|
106
|
+
"command": "python",
|
|
107
|
+
"args": ["/path/to/rossum-mcp/rossum-mcp/rossum_mcp/server.py"],
|
|
108
|
+
"env": {
|
|
109
|
+
"ROSSUM_API_TOKEN": "your-api-token",
|
|
110
|
+
"ROSSUM_API_BASE_URL": "https://api.elis.rossum.ai/v1",
|
|
111
|
+
"ROSSUM_MCP_MODE": "read-write"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Environment Variables
|
|
119
|
+
|
|
120
|
+
| Variable | Required | Description |
|
|
121
|
+
|----------|----------|-------------|
|
|
122
|
+
| `ROSSUM_API_TOKEN` | Yes | Your Rossum API authentication token |
|
|
123
|
+
| `ROSSUM_API_BASE_URL` | Yes | Base URL for the Rossum API |
|
|
124
|
+
| `ROSSUM_MCP_MODE` | No | `read-write` (default) or `read-only` |
|
|
125
|
+
|
|
126
|
+
### Read-Only Mode
|
|
127
|
+
|
|
128
|
+
Set `ROSSUM_MCP_MODE=read-only` to disable all CREATE, UPDATE, and UPLOAD operations. Only GET and LIST operations will be available.
|
|
129
|
+
|
|
130
|
+
## Available Tools
|
|
131
|
+
|
|
132
|
+
The server provides **56 tools** organized into categories:
|
|
133
|
+
|
|
134
|
+
| Category | Tools | Description |
|
|
135
|
+
|----------|-------|-------------|
|
|
136
|
+
| **Document Processing** | 7 | Upload documents, retrieve/update/confirm/delete annotations |
|
|
137
|
+
| **Queue Management** | 9 | Create, configure, delete, and list queues |
|
|
138
|
+
| **Schema Management** | 8 | Define, modify, and delete field structures |
|
|
139
|
+
| **Engine Management** | 6 | Configure extraction and splitting engines |
|
|
140
|
+
| **Extensions & Rules** | 11 | Webhooks, serverless functions, business rules |
|
|
141
|
+
| **Workspace Management** | 4 | Organize and delete workspaces |
|
|
142
|
+
| **User Management** | 3 | List users and roles |
|
|
143
|
+
| **Relations** | 4 | Annotation and document relations |
|
|
144
|
+
| **Email Templates** | 3 | Automated email responses |
|
|
145
|
+
| **Tool Discovery** | 1 | Dynamic tool loading |
|
|
146
|
+
|
|
147
|
+
<details>
|
|
148
|
+
<summary><strong>Tool List by Category</strong></summary>
|
|
149
|
+
|
|
150
|
+
**Document Processing:**
|
|
151
|
+
`upload_document`, `get_annotation`, `list_annotations`, `start_annotation`, `bulk_update_annotation_fields`, `confirm_annotation`, `delete_annotation`
|
|
152
|
+
|
|
153
|
+
**Queue Management:**
|
|
154
|
+
`get_queue`, `list_queues`, `get_queue_schema`, `get_queue_engine`, `create_queue`, `create_queue_from_template`, `get_queue_template_names`, `update_queue`, `delete_queue`
|
|
155
|
+
|
|
156
|
+
**Schema Management:**
|
|
157
|
+
`get_schema`, `list_schemas`, `create_schema`, `update_schema`, `patch_schema`, `get_schema_tree_structure`, `prune_schema_fields`, `delete_schema`
|
|
158
|
+
|
|
159
|
+
**Engine Management:**
|
|
160
|
+
`get_engine`, `list_engines`, `create_engine`, `update_engine`, `create_engine_field`, `get_engine_fields`
|
|
161
|
+
|
|
162
|
+
**Extensions & Rules:**
|
|
163
|
+
`get_hook`, `list_hooks`, `create_hook`, `update_hook`, `list_hook_templates`, `create_hook_from_template`, `list_hook_logs`, `delete_hook`, `get_rule`, `list_rules`, `delete_rule`
|
|
164
|
+
|
|
165
|
+
**Workspace Management:**
|
|
166
|
+
`get_workspace`, `list_workspaces`, `create_workspace`, `delete_workspace`
|
|
167
|
+
|
|
168
|
+
**User Management:**
|
|
169
|
+
`get_user`, `list_users`, `list_user_roles`
|
|
170
|
+
|
|
171
|
+
**Relations:**
|
|
172
|
+
`get_relation`, `list_relations`, `get_document_relation`, `list_document_relations`
|
|
173
|
+
|
|
174
|
+
**Email Templates:**
|
|
175
|
+
`get_email_template`, `list_email_templates`, `create_email_template`
|
|
176
|
+
|
|
177
|
+
**Tool Discovery:**
|
|
178
|
+
`list_tool_categories`
|
|
179
|
+
|
|
180
|
+
</details>
|
|
181
|
+
|
|
182
|
+
For detailed API documentation with parameters and examples, see [TOOLS.md](TOOLS.md).
|
|
183
|
+
|
|
184
|
+
## Annotation Workflow
|
|
185
|
+
|
|
186
|
+
Documents progress through these states:
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
importing → to_review → reviewing → confirmed → exporting → exported
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Key points:**
|
|
193
|
+
- Wait for `to_review` before processing
|
|
194
|
+
- Call `start_annotation` before updating fields
|
|
195
|
+
- Call `confirm_annotation` to finalize
|
|
196
|
+
|
|
197
|
+
## Example Workflows
|
|
198
|
+
|
|
199
|
+
### Upload and Monitor
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
# 1. Upload document
|
|
203
|
+
upload_document(file_path="/path/to/invoice.pdf", queue_id=12345)
|
|
204
|
+
|
|
205
|
+
# 2. Get annotation ID
|
|
206
|
+
annotations = list_annotations(queue_id=12345)
|
|
207
|
+
|
|
208
|
+
# 3. Check status
|
|
209
|
+
annotation = get_annotation(annotation_id=annotations[0].id)
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Update Fields
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
# 1. Start annotation (moves to 'reviewing')
|
|
216
|
+
start_annotation(annotation_id=12345)
|
|
217
|
+
|
|
218
|
+
# 2. Get content with field IDs
|
|
219
|
+
annotation = get_annotation(annotation_id=12345, sideloads=['content'])
|
|
220
|
+
|
|
221
|
+
# 3. Update fields using datapoint IDs
|
|
222
|
+
bulk_update_annotation_fields(
|
|
223
|
+
annotation_id=12345,
|
|
224
|
+
operations=[{"op": "replace", "id": 67890, "value": {"content": {"value": "INV-001"}}}]
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
# 4. Confirm
|
|
228
|
+
confirm_annotation(annotation_id=12345)
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## License
|
|
232
|
+
|
|
233
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
234
|
+
|
|
235
|
+
## Resources
|
|
236
|
+
|
|
237
|
+
- [Full Documentation](https://stancld.github.io/rossum-agents/)
|
|
238
|
+
- [Tools Reference](TOOLS.md)
|
|
239
|
+
- [Rossum API Documentation](https://elis.rossum.ai/api/docs/)
|
|
240
|
+
- [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
241
|
+
- [Main Repository](https://github.com/stancld/rossum-agents)
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# Rossum MCP Server
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
**MCP server for AI-powered Rossum document processing. 56 tools for queues, schemas, hooks, engines, and more.**
|
|
6
|
+
|
|
7
|
+
[](https://stancld.github.io/rossum-agents/)
|
|
8
|
+
[](https://www.python.org/downloads/)
|
|
9
|
+
[](https://opensource.org/licenses/MIT)
|
|
10
|
+
[](https://pypi.org/project/rossum-mcp/)
|
|
11
|
+
[](https://codecov.io/gh/stancld/rossum-agents)
|
|
12
|
+
[](#available-tools)
|
|
13
|
+
|
|
14
|
+
[](https://github.com/rossumai/rossum-api)
|
|
15
|
+
[](https://modelcontextprotocol.io/)
|
|
16
|
+
[](https://github.com/astral-sh/ruff)
|
|
17
|
+
[](https://github.com/astral-sh/ty)
|
|
18
|
+
[](https://github.com/astral-sh/uv)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
> [!NOTE]
|
|
23
|
+
> This is not an official Rossum project. It is a community-developed integration built on top of the Rossum API.
|
|
24
|
+
|
|
25
|
+
> [!NOTE]
|
|
26
|
+
> API is stable starting from 1.0.0. Breaking changes will follow SemVer (released as 2.0.0+).
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Set environment variables
|
|
32
|
+
export ROSSUM_API_TOKEN="your-api-token"
|
|
33
|
+
export ROSSUM_API_BASE_URL="https://api.elis.rossum.ai/v1"
|
|
34
|
+
|
|
35
|
+
# Run the MCP server
|
|
36
|
+
uv pip install rossum-mcp
|
|
37
|
+
rossum-mcp
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Or run from source:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git clone https://github.com/stancld/rossum-agents.git
|
|
44
|
+
cd rossum-mcp/rossum-mcp
|
|
45
|
+
uv sync
|
|
46
|
+
python rossum_mcp/server.py
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Claude Desktop Configuration
|
|
50
|
+
|
|
51
|
+
Configure Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json` on Mac):
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"mcpServers": {
|
|
56
|
+
"rossum": {
|
|
57
|
+
"command": "python",
|
|
58
|
+
"args": ["/path/to/rossum-mcp/rossum-mcp/rossum_mcp/server.py"],
|
|
59
|
+
"env": {
|
|
60
|
+
"ROSSUM_API_TOKEN": "your-api-token",
|
|
61
|
+
"ROSSUM_API_BASE_URL": "https://api.elis.rossum.ai/v1",
|
|
62
|
+
"ROSSUM_MCP_MODE": "read-write"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Environment Variables
|
|
70
|
+
|
|
71
|
+
| Variable | Required | Description |
|
|
72
|
+
|----------|----------|-------------|
|
|
73
|
+
| `ROSSUM_API_TOKEN` | Yes | Your Rossum API authentication token |
|
|
74
|
+
| `ROSSUM_API_BASE_URL` | Yes | Base URL for the Rossum API |
|
|
75
|
+
| `ROSSUM_MCP_MODE` | No | `read-write` (default) or `read-only` |
|
|
76
|
+
|
|
77
|
+
### Read-Only Mode
|
|
78
|
+
|
|
79
|
+
Set `ROSSUM_MCP_MODE=read-only` to disable all CREATE, UPDATE, and UPLOAD operations. Only GET and LIST operations will be available.
|
|
80
|
+
|
|
81
|
+
## Available Tools
|
|
82
|
+
|
|
83
|
+
The server provides **56 tools** organized into categories:
|
|
84
|
+
|
|
85
|
+
| Category | Tools | Description |
|
|
86
|
+
|----------|-------|-------------|
|
|
87
|
+
| **Document Processing** | 7 | Upload documents, retrieve/update/confirm/delete annotations |
|
|
88
|
+
| **Queue Management** | 9 | Create, configure, delete, and list queues |
|
|
89
|
+
| **Schema Management** | 8 | Define, modify, and delete field structures |
|
|
90
|
+
| **Engine Management** | 6 | Configure extraction and splitting engines |
|
|
91
|
+
| **Extensions & Rules** | 11 | Webhooks, serverless functions, business rules |
|
|
92
|
+
| **Workspace Management** | 4 | Organize and delete workspaces |
|
|
93
|
+
| **User Management** | 3 | List users and roles |
|
|
94
|
+
| **Relations** | 4 | Annotation and document relations |
|
|
95
|
+
| **Email Templates** | 3 | Automated email responses |
|
|
96
|
+
| **Tool Discovery** | 1 | Dynamic tool loading |
|
|
97
|
+
|
|
98
|
+
<details>
|
|
99
|
+
<summary><strong>Tool List by Category</strong></summary>
|
|
100
|
+
|
|
101
|
+
**Document Processing:**
|
|
102
|
+
`upload_document`, `get_annotation`, `list_annotations`, `start_annotation`, `bulk_update_annotation_fields`, `confirm_annotation`, `delete_annotation`
|
|
103
|
+
|
|
104
|
+
**Queue Management:**
|
|
105
|
+
`get_queue`, `list_queues`, `get_queue_schema`, `get_queue_engine`, `create_queue`, `create_queue_from_template`, `get_queue_template_names`, `update_queue`, `delete_queue`
|
|
106
|
+
|
|
107
|
+
**Schema Management:**
|
|
108
|
+
`get_schema`, `list_schemas`, `create_schema`, `update_schema`, `patch_schema`, `get_schema_tree_structure`, `prune_schema_fields`, `delete_schema`
|
|
109
|
+
|
|
110
|
+
**Engine Management:**
|
|
111
|
+
`get_engine`, `list_engines`, `create_engine`, `update_engine`, `create_engine_field`, `get_engine_fields`
|
|
112
|
+
|
|
113
|
+
**Extensions & Rules:**
|
|
114
|
+
`get_hook`, `list_hooks`, `create_hook`, `update_hook`, `list_hook_templates`, `create_hook_from_template`, `list_hook_logs`, `delete_hook`, `get_rule`, `list_rules`, `delete_rule`
|
|
115
|
+
|
|
116
|
+
**Workspace Management:**
|
|
117
|
+
`get_workspace`, `list_workspaces`, `create_workspace`, `delete_workspace`
|
|
118
|
+
|
|
119
|
+
**User Management:**
|
|
120
|
+
`get_user`, `list_users`, `list_user_roles`
|
|
121
|
+
|
|
122
|
+
**Relations:**
|
|
123
|
+
`get_relation`, `list_relations`, `get_document_relation`, `list_document_relations`
|
|
124
|
+
|
|
125
|
+
**Email Templates:**
|
|
126
|
+
`get_email_template`, `list_email_templates`, `create_email_template`
|
|
127
|
+
|
|
128
|
+
**Tool Discovery:**
|
|
129
|
+
`list_tool_categories`
|
|
130
|
+
|
|
131
|
+
</details>
|
|
132
|
+
|
|
133
|
+
For detailed API documentation with parameters and examples, see [TOOLS.md](TOOLS.md).
|
|
134
|
+
|
|
135
|
+
## Annotation Workflow
|
|
136
|
+
|
|
137
|
+
Documents progress through these states:
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
importing → to_review → reviewing → confirmed → exporting → exported
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Key points:**
|
|
144
|
+
- Wait for `to_review` before processing
|
|
145
|
+
- Call `start_annotation` before updating fields
|
|
146
|
+
- Call `confirm_annotation` to finalize
|
|
147
|
+
|
|
148
|
+
## Example Workflows
|
|
149
|
+
|
|
150
|
+
### Upload and Monitor
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
# 1. Upload document
|
|
154
|
+
upload_document(file_path="/path/to/invoice.pdf", queue_id=12345)
|
|
155
|
+
|
|
156
|
+
# 2. Get annotation ID
|
|
157
|
+
annotations = list_annotations(queue_id=12345)
|
|
158
|
+
|
|
159
|
+
# 3. Check status
|
|
160
|
+
annotation = get_annotation(annotation_id=annotations[0].id)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Update Fields
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
# 1. Start annotation (moves to 'reviewing')
|
|
167
|
+
start_annotation(annotation_id=12345)
|
|
168
|
+
|
|
169
|
+
# 2. Get content with field IDs
|
|
170
|
+
annotation = get_annotation(annotation_id=12345, sideloads=['content'])
|
|
171
|
+
|
|
172
|
+
# 3. Update fields using datapoint IDs
|
|
173
|
+
bulk_update_annotation_fields(
|
|
174
|
+
annotation_id=12345,
|
|
175
|
+
operations=[{"op": "replace", "id": 67890, "value": {"content": {"value": "INV-001"}}}]
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
# 4. Confirm
|
|
179
|
+
confirm_annotation(annotation_id=12345)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## License
|
|
183
|
+
|
|
184
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
185
|
+
|
|
186
|
+
## Resources
|
|
187
|
+
|
|
188
|
+
- [Full Documentation](https://stancld.github.io/rossum-agents/)
|
|
189
|
+
- [Tools Reference](TOOLS.md)
|
|
190
|
+
- [Rossum API Documentation](https://elis.rossum.ai/api/docs/)
|
|
191
|
+
- [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
192
|
+
- [Main Repository](https://github.com/stancld/rossum-agents)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "rossum-mcp"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "1.0.0"
|
|
8
8
|
description = "MCP server for AI-powered Rossum orchestration: document workflows, debug pipelines automatically, and configure intelligent document processing through natural language."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -14,7 +14,7 @@ authors = [
|
|
|
14
14
|
]
|
|
15
15
|
keywords = ["mcp", "rossum", "document-processing"]
|
|
16
16
|
classifiers = [
|
|
17
|
-
"Development Status ::
|
|
17
|
+
"Development Status :: 5 - Production/Stable",
|
|
18
18
|
"License :: OSI Approved :: MIT License",
|
|
19
19
|
"Programming Language :: Python :: 3",
|
|
20
20
|
"Programming Language :: Python :: 3.12",
|
|
@@ -25,9 +25,9 @@ classifiers = [
|
|
|
25
25
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
26
26
|
]
|
|
27
27
|
dependencies = [
|
|
28
|
-
"fastmcp
|
|
28
|
+
"fastmcp>=2.0.0",
|
|
29
29
|
"pydantic>2.0.0",
|
|
30
|
-
"rossum-api>=3.
|
|
30
|
+
"rossum-api>=3.8.0",
|
|
31
31
|
]
|
|
32
32
|
|
|
33
33
|
[project.scripts]
|
|
@@ -50,13 +50,13 @@ tests = [
|
|
|
50
50
|
]
|
|
51
51
|
all = [
|
|
52
52
|
"coverage>=7.0.0",
|
|
53
|
-
"fastmcp>=
|
|
53
|
+
"fastmcp>=2.0.0",
|
|
54
54
|
"myst-parser>=2.0.0",
|
|
55
55
|
"pydantic>2.0.0",
|
|
56
56
|
"pytest>=7.0.0",
|
|
57
57
|
"pytest-asyncio>=0.21.0",
|
|
58
58
|
"redis>=7.0.0",
|
|
59
|
-
"rossum-api>=3.
|
|
59
|
+
"rossum-api>=3.8.0",
|
|
60
60
|
"sphinx>=7.0.0",
|
|
61
61
|
"sphinx-autodoc-typehints>=1.25.0",
|
|
62
62
|
"sphinx-copybutton>=0.5.2",
|
|
@@ -67,8 +67,14 @@ all = [
|
|
|
67
67
|
where = ["."]
|
|
68
68
|
include = ["rossum_mcp*"]
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
rossum-api = { git = "https://github.com/stancld/rossum-api.git", rev = "ds-feat-hook-logs"}
|
|
70
|
+
|
|
72
71
|
|
|
73
72
|
[tool.coverage.run]
|
|
74
73
|
omit = ["rossum_mcp/server.py"]
|
|
74
|
+
|
|
75
|
+
[tool.pytest.ini_options]
|
|
76
|
+
markers = [
|
|
77
|
+
"unit: marks tests as unit tests",
|
|
78
|
+
"integration: marks tests as integration tests (require API access)",
|
|
79
|
+
]
|
|
80
|
+
asyncio_mode = "auto"
|
|
@@ -9,7 +9,7 @@ from typing import TYPE_CHECKING, Literal
|
|
|
9
9
|
|
|
10
10
|
from rossum_api.models.annotation import Annotation
|
|
11
11
|
|
|
12
|
-
from rossum_mcp.tools.base import is_read_write_mode
|
|
12
|
+
from rossum_mcp.tools.base import delete_resource, is_read_write_mode
|
|
13
13
|
|
|
14
14
|
if TYPE_CHECKING:
|
|
15
15
|
from fastmcp import FastMCP
|
|
@@ -130,6 +130,12 @@ async def _confirm_annotation(client: AsyncRossumAPIClient, annotation_id: int)
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
|
|
133
|
+
async def _delete_annotation(client: AsyncRossumAPIClient, annotation_id: int) -> dict:
|
|
134
|
+
return await delete_resource(
|
|
135
|
+
"annotation", annotation_id, client.delete_annotation, f"Annotation {annotation_id} moved to 'deleted' status"
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
|
|
133
139
|
def register_annotation_tools(mcp: FastMCP, client: AsyncRossumAPIClient) -> None:
|
|
134
140
|
"""Register annotation-related tools with the FastMCP server."""
|
|
135
141
|
|
|
@@ -165,3 +171,7 @@ def register_annotation_tools(mcp: FastMCP, client: AsyncRossumAPIClient) -> Non
|
|
|
165
171
|
)
|
|
166
172
|
async def confirm_annotation(annotation_id: int) -> dict:
|
|
167
173
|
return await _confirm_annotation(client, annotation_id)
|
|
174
|
+
|
|
175
|
+
@mcp.tool(description="Delete an annotation. Moves to 'deleted' status (soft delete).")
|
|
176
|
+
async def delete_annotation(annotation_id: int) -> dict:
|
|
177
|
+
return await _delete_annotation(client, annotation_id)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"""Base utilities for Rossum MCP tools."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
import os
|
|
7
|
+
from typing import TYPE_CHECKING
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from collections.abc import Awaitable, Callable
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
logger = logging.getLogger(__name__)
|
|
14
|
+
|
|
15
|
+
BASE_URL = os.environ.get("ROSSUM_API_BASE_URL", "").rstrip("/")
|
|
16
|
+
MODE = os.environ.get("ROSSUM_MCP_MODE", "read-write").lower()
|
|
17
|
+
|
|
18
|
+
# Marker used to indicate omitted fields in list responses
|
|
19
|
+
TRUNCATED_MARKER = "<omitted>"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def build_resource_url(resource_type: str, resource_id: int) -> str:
|
|
23
|
+
"""Build a full URL for a Rossum API resource."""
|
|
24
|
+
return f"{BASE_URL}/{resource_type}/{resource_id}"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def is_read_write_mode() -> bool:
|
|
28
|
+
"""Check if server is in read-write mode."""
|
|
29
|
+
return MODE == "read-write"
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def truncate_dict_fields(data: dict[str, Any], fields: tuple[str, ...]) -> dict[str, Any]:
|
|
33
|
+
"""Truncate specified fields in a dictionary to save context.
|
|
34
|
+
|
|
35
|
+
Returns a new dictionary with specified fields replaced by TRUNCATED_MARKER.
|
|
36
|
+
"""
|
|
37
|
+
if not data:
|
|
38
|
+
return data
|
|
39
|
+
|
|
40
|
+
result = dict(data)
|
|
41
|
+
for field in fields:
|
|
42
|
+
if field in result:
|
|
43
|
+
result[field] = TRUNCATED_MARKER
|
|
44
|
+
return result
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
async def delete_resource(
|
|
48
|
+
resource_type: str,
|
|
49
|
+
resource_id: int,
|
|
50
|
+
delete_fn: Callable[[int], Awaitable[None]],
|
|
51
|
+
success_message: str | None = None,
|
|
52
|
+
) -> dict:
|
|
53
|
+
"""Generic delete operation with read-only mode check.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
resource_type: Name of the resource (e.g., "queue", "workspace")
|
|
57
|
+
resource_id: ID of the resource to delete
|
|
58
|
+
delete_fn: Async function that performs the deletion
|
|
59
|
+
success_message: Custom success message. If None, uses default format.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
Dict with "message" on success or "error" in read-only mode.
|
|
63
|
+
"""
|
|
64
|
+
tool_name = f"delete_{resource_type}"
|
|
65
|
+
if not is_read_write_mode():
|
|
66
|
+
return {"error": f"{tool_name} is not available in read-only mode"}
|
|
67
|
+
|
|
68
|
+
logger.debug(f"Deleting {resource_type}: {resource_type}_id={resource_id}")
|
|
69
|
+
await delete_fn(resource_id)
|
|
70
|
+
|
|
71
|
+
if success_message is None:
|
|
72
|
+
success_message = f"{resource_type.title()} {resource_id} deleted successfully"
|
|
73
|
+
return {"message": success_message}
|