rossum-mcp 1.0.1__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.1/LICENSE +21 -0
- rossum_mcp-1.0.1/PKG-INFO +241 -0
- rossum_mcp-1.0.1/README.md +192 -0
- rossum_mcp-1.0.1/pyproject.toml +80 -0
- rossum_mcp-1.0.1/rossum_mcp/__init__.py +3 -0
- rossum_mcp-1.0.1/rossum_mcp/logging_config.py +141 -0
- rossum_mcp-1.0.1/rossum_mcp/py.typed +0 -0
- rossum_mcp-1.0.1/rossum_mcp/server.py +69 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/__init__.py +41 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/annotations.py +177 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/base.py +73 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/catalog.py +176 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/discovery.py +37 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/document_relations.py +56 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/email_templates.py +127 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/engines.py +159 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/hooks.py +347 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/queues.py +311 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/relations.py +52 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/rules.py +63 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/schemas.py +800 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/users.py +84 -0
- rossum_mcp-1.0.1/rossum_mcp/tools/workspaces.py +83 -0
- rossum_mcp-1.0.1/rossum_mcp.egg-info/PKG-INFO +241 -0
- rossum_mcp-1.0.1/rossum_mcp.egg-info/SOURCES.txt +30 -0
- rossum_mcp-1.0.1/rossum_mcp.egg-info/dependency_links.txt +1 -0
- rossum_mcp-1.0.1/rossum_mcp.egg-info/entry_points.txt +2 -0
- rossum_mcp-1.0.1/rossum_mcp.egg-info/requires.txt +31 -0
- rossum_mcp-1.0.1/rossum_mcp.egg-info/top_level.txt +1 -0
- rossum_mcp-1.0.1/setup.cfg +4 -0
- rossum_mcp-1.0.1/tests/test_catalog.py +169 -0
- rossum_mcp-1.0.1/tests/test_logging_config.py +425 -0
rossum_mcp-1.0.1/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.1
|
|
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://pypi.org/project/rossum-mcp/)
|
|
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://pypi.org/project/rossum-mcp/)
|
|
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)
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "rossum-mcp"
|
|
7
|
+
version = "1.0.1"
|
|
8
|
+
description = "MCP server for AI-powered Rossum orchestration: document workflows, debug pipelines automatically, and configure intelligent document processing through natural language."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Dan Stancl (Rossum AI)", email = "daniel.stancl@gmail.com"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["mcp", "rossum", "document-processing"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 5 - Production/Stable",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
|
+
"Programming Language :: Python :: 3.14",
|
|
23
|
+
"Intended Audience :: Developers",
|
|
24
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
25
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"fastmcp>=2.0.0",
|
|
29
|
+
"pydantic>2.0.0",
|
|
30
|
+
"rossum-api>=3.8.0",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.scripts]
|
|
34
|
+
rossum-mcp = "rossum_mcp.server:main"
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
docs = [
|
|
38
|
+
"myst-parser>=2.0.0",
|
|
39
|
+
"sphinx>=7.0.0",
|
|
40
|
+
"sphinx-autodoc-typehints>=1.25.0",
|
|
41
|
+
"sphinx-copybutton>=0.5.2",
|
|
42
|
+
"sphinx-rtd-theme>=2.0.0",
|
|
43
|
+
]
|
|
44
|
+
tests = [
|
|
45
|
+
"coverage>=7.0.0",
|
|
46
|
+
"pytest>=7.0.0",
|
|
47
|
+
"pytest-asyncio>=0.21.0",
|
|
48
|
+
"pytest-cov>=4.0.0",
|
|
49
|
+
"redis>=7.0.0",
|
|
50
|
+
]
|
|
51
|
+
all = [
|
|
52
|
+
"coverage>=7.0.0",
|
|
53
|
+
"fastmcp>=2.0.0",
|
|
54
|
+
"myst-parser>=2.0.0",
|
|
55
|
+
"pydantic>2.0.0",
|
|
56
|
+
"pytest>=7.0.0",
|
|
57
|
+
"pytest-asyncio>=0.21.0",
|
|
58
|
+
"redis>=7.0.0",
|
|
59
|
+
"rossum-api>=3.8.0",
|
|
60
|
+
"sphinx>=7.0.0",
|
|
61
|
+
"sphinx-autodoc-typehints>=1.25.0",
|
|
62
|
+
"sphinx-copybutton>=0.5.2",
|
|
63
|
+
"sphinx-rtd-theme>=2.0.0",
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
[tool.setuptools.packages.find]
|
|
67
|
+
where = ["."]
|
|
68
|
+
include = ["rossum_mcp*"]
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
[tool.coverage.run]
|
|
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"
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"""Shared logging configuration for Rossum MCP/Agent with Redis integration."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import logging
|
|
7
|
+
import os
|
|
8
|
+
import sys
|
|
9
|
+
from datetime import UTC, datetime
|
|
10
|
+
from logging import LogRecord
|
|
11
|
+
|
|
12
|
+
import redis
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class RedisHandler(logging.Handler):
|
|
16
|
+
"""Custom logging handler that sends logs to Redis."""
|
|
17
|
+
|
|
18
|
+
def __init__(self, host: str, port: int = 6379, key_prefix: str = "logs", additional_fields: dict | None = None):
|
|
19
|
+
"""Initialize Redis handler.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
host: Redis host (e.g., "localhost")
|
|
23
|
+
port: Redis port (default: 6379)
|
|
24
|
+
key_prefix: Prefix for Redis keys
|
|
25
|
+
additional_fields: Additional fields to add to every log record
|
|
26
|
+
"""
|
|
27
|
+
super().__init__()
|
|
28
|
+
|
|
29
|
+
self.client = redis.Redis(host=host, port=port, decode_responses=True)
|
|
30
|
+
self.key_prefix = key_prefix
|
|
31
|
+
self.additional_fields = additional_fields or {}
|
|
32
|
+
|
|
33
|
+
def emit(self, record: LogRecord) -> None:
|
|
34
|
+
"""Emit a log record to Redis."""
|
|
35
|
+
if record.name.startswith("redis"):
|
|
36
|
+
return
|
|
37
|
+
|
|
38
|
+
try:
|
|
39
|
+
log_entry = {
|
|
40
|
+
"@timestamp": datetime.now(UTC).isoformat().replace("+00:00", "Z"),
|
|
41
|
+
"level": record.levelname,
|
|
42
|
+
"logger": record.name,
|
|
43
|
+
"message": record.getMessage(),
|
|
44
|
+
"module": record.module,
|
|
45
|
+
"function": record.funcName,
|
|
46
|
+
"line": record.lineno,
|
|
47
|
+
"thread": record.thread,
|
|
48
|
+
"thread_name": record.threadName,
|
|
49
|
+
**self.additional_fields,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
for key, value in record.__dict__.items():
|
|
53
|
+
if key not in {
|
|
54
|
+
"name",
|
|
55
|
+
"msg",
|
|
56
|
+
"args",
|
|
57
|
+
"created",
|
|
58
|
+
"filename",
|
|
59
|
+
"funcName",
|
|
60
|
+
"levelname",
|
|
61
|
+
"levelno",
|
|
62
|
+
"lineno",
|
|
63
|
+
"module",
|
|
64
|
+
"msecs",
|
|
65
|
+
"message",
|
|
66
|
+
"pathname",
|
|
67
|
+
"process",
|
|
68
|
+
"processName",
|
|
69
|
+
"relativeCreated",
|
|
70
|
+
"thread",
|
|
71
|
+
"threadName",
|
|
72
|
+
"exc_info",
|
|
73
|
+
"exc_text",
|
|
74
|
+
"stack_info",
|
|
75
|
+
"taskName",
|
|
76
|
+
}:
|
|
77
|
+
log_entry[key] = value
|
|
78
|
+
|
|
79
|
+
if record.exc_info:
|
|
80
|
+
log_entry["exception"] = self.format(record)
|
|
81
|
+
|
|
82
|
+
key = f"{self.key_prefix}:{datetime.now(UTC).strftime('%Y-%m-%d')}"
|
|
83
|
+
self.client.rpush(key, json.dumps(log_entry))
|
|
84
|
+
self.client.expire(key, 604800) # 7 days
|
|
85
|
+
except Exception:
|
|
86
|
+
self.handleError(record)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def setup_logging(
|
|
90
|
+
app_name: str = "rossum-app",
|
|
91
|
+
log_level: str = "DEBUG",
|
|
92
|
+
log_file: str | None = None,
|
|
93
|
+
use_console: bool = True,
|
|
94
|
+
redis_host: str | None = None,
|
|
95
|
+
redis_port: int | None = None,
|
|
96
|
+
) -> logging.Logger:
|
|
97
|
+
"""Configure logging with console, file, and optional Redis handlers.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
app_name: Application name
|
|
101
|
+
log_level: Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
|
102
|
+
use_console: Whether to add console handler (default: True)
|
|
103
|
+
redis_host: Redis host (default: from REDIS_HOST env var)
|
|
104
|
+
redis_port: Redis port (default: 6379)
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
Configured root logger
|
|
108
|
+
"""
|
|
109
|
+
root_logger = logging.getLogger()
|
|
110
|
+
root_logger.setLevel(getattr(logging, log_level.upper()))
|
|
111
|
+
root_logger.handlers.clear()
|
|
112
|
+
|
|
113
|
+
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
|
|
114
|
+
|
|
115
|
+
if use_console:
|
|
116
|
+
console = logging.StreamHandler(sys.stdout)
|
|
117
|
+
console.setFormatter(formatter)
|
|
118
|
+
root_logger.addHandler(console)
|
|
119
|
+
|
|
120
|
+
redis_host_val = redis_host or os.getenv("REDIS_HOST")
|
|
121
|
+
redis_port_val = redis_port or int(os.getenv("REDIS_PORT", "6379"))
|
|
122
|
+
|
|
123
|
+
if redis_host_val:
|
|
124
|
+
try:
|
|
125
|
+
redis_client = redis.Redis(host=redis_host_val, port=redis_port_val, socket_timeout=2)
|
|
126
|
+
redis_client.ping()
|
|
127
|
+
|
|
128
|
+
redis_handler = RedisHandler(
|
|
129
|
+
host=redis_host_val,
|
|
130
|
+
port=redis_port_val,
|
|
131
|
+
key_prefix="logs",
|
|
132
|
+
additional_fields={"application": app_name, "environment": os.getenv("ENVIRONMENT", "develop")},
|
|
133
|
+
)
|
|
134
|
+
redis_handler.client = redis_client
|
|
135
|
+
redis_handler.setLevel(logging.INFO)
|
|
136
|
+
root_logger.addHandler(redis_handler)
|
|
137
|
+
root_logger.info(f"Redis logging enabled: {redis_host_val}:{redis_port_val}")
|
|
138
|
+
except Exception as e:
|
|
139
|
+
root_logger.warning(f"Redis logging disabled: {e}")
|
|
140
|
+
|
|
141
|
+
return root_logger
|
|
File without changes
|