listmonk-api 0.26.0__tar.gz → 2.3.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.
Files changed (89) hide show
  1. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/LICENSE +1 -1
  2. listmonk_api-2.3.1/PKG-INFO +601 -0
  3. listmonk_api-2.3.1/README.md +574 -0
  4. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api/__init__.py +32 -21
  5. listmonk_api-2.3.1/listmonk_api/__main__.py +6 -0
  6. listmonk_api-2.3.1/listmonk_api/api/api_client_base.py +120 -0
  7. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api/api/api_client_campaigns.py +11 -31
  8. listmonk_api-2.3.1/listmonk_api/api/api_client_lists.py +43 -0
  9. listmonk_api-2.3.1/listmonk_api/api/api_client_subscribers.py +48 -0
  10. listmonk_api-2.3.1/listmonk_api/auth.py +37 -0
  11. listmonk_api-2.3.1/listmonk_api/connectors/__init__.py +0 -0
  12. listmonk_api-2.3.1/listmonk_api/connectors/mcp_source_presets.json +18 -0
  13. listmonk_api-2.3.1/listmonk_api/connectors/tool_schema_fingerprints.json +8 -0
  14. listmonk_api-2.3.1/listmonk_api/kg_ingest.py +349 -0
  15. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api/mcp_server.py +191 -134
  16. listmonk_api-2.3.1/listmonk_api/ontology/__init__.py +7 -0
  17. listmonk_api-2.3.1/listmonk_api/ontology/certification.json +36 -0
  18. listmonk_api-2.3.1/listmonk_api/ontology/fixtures/records.json +21 -0
  19. listmonk_api-2.3.1/listmonk_api/ontology/listmonk.ttl +121 -0
  20. listmonk_api-2.3.1/listmonk_api/ontology/mappings/source.yaml +20 -0
  21. listmonk_api-2.3.1/listmonk_api/ontology/migrations/manifest.json +6 -0
  22. listmonk_api-2.3.1/listmonk_api/ontology/shapes/connector.shacl.ttl +104 -0
  23. listmonk_api-2.3.1/listmonk_api/prompts/__init__.py +0 -0
  24. listmonk_api-2.3.1/listmonk_api/skills/__init__.py +0 -0
  25. listmonk_api-2.3.1/listmonk_api/skills/listmonk-api-operations/SKILL.md +33 -0
  26. listmonk_api-2.3.1/listmonk_api/skills/listmonk-api-operations/agents/openai.yaml +4 -0
  27. listmonk_api-2.3.1/listmonk_api/skills/listmonk-api-operations/references/catalog.md +7 -0
  28. listmonk_api-2.3.1/listmonk_api/skills/listmonk-campaign-management/SKILL.md +96 -0
  29. listmonk_api-2.3.1/listmonk_api/skills/listmonk-campaign-management/WORKFLOW.md +83 -0
  30. listmonk_api-2.3.1/listmonk_api/skills/listmonk-subscriber-lists/SKILL.md +92 -0
  31. listmonk_api-2.3.1/listmonk_api/skills/listmonk-subscriber-lists/WORKFLOW.md +79 -0
  32. listmonk_api-2.3.1/listmonk_api/skills/listmonk-transactional-messaging/SKILL.md +85 -0
  33. listmonk_api-2.3.1/listmonk_api/skills/listmonk-transactional-messaging/WORKFLOW.md +72 -0
  34. listmonk_api-2.3.1/listmonk_api.egg-info/PKG-INFO +601 -0
  35. listmonk_api-2.3.1/listmonk_api.egg-info/SOURCES.txt +60 -0
  36. listmonk_api-2.3.1/listmonk_api.egg-info/entry_points.txt +11 -0
  37. listmonk_api-2.3.1/listmonk_api.egg-info/requires.txt +14 -0
  38. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api.egg-info/top_level.txt +3 -0
  39. listmonk_api-2.3.1/pyproject.toml +72 -0
  40. listmonk_api-2.3.1/requirements.txt +1 -0
  41. listmonk_api-2.3.1/scripts/security_sanitizer.py +318 -0
  42. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/tests/conftest.py +0 -1
  43. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/tests/test_api_clients.py +1 -1
  44. listmonk_api-2.3.1/tests/test_auth_and_server.py +59 -0
  45. listmonk_api-2.3.1/tests/test_init.py +32 -0
  46. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/tests/test_init_dynamics.py +4 -1
  47. listmonk_api-2.3.1/tests/test_kg_ingest.py +191 -0
  48. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/tests/test_mcp_server.py +8 -9
  49. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/tests/test_startup.py +6 -6
  50. listmonk_api-2.3.1/tests/test_token_auth.py +53 -0
  51. listmonk_api-0.26.0/PKG-INFO +0 -393
  52. listmonk_api-0.26.0/README.md +0 -372
  53. listmonk_api-0.26.0/listmonk_api/__main__.py +0 -6
  54. listmonk_api-0.26.0/listmonk_api/agent_server.py +0 -85
  55. listmonk_api-0.26.0/listmonk_api/api/api_client_base.py +0 -37
  56. listmonk_api-0.26.0/listmonk_api/api/api_client_lists.py +0 -61
  57. listmonk_api-0.26.0/listmonk_api/api/api_client_subscribers.py +0 -64
  58. listmonk_api-0.26.0/listmonk_api/auth.py +0 -36
  59. listmonk_api-0.26.0/listmonk_api/main_agent.json +0 -10
  60. listmonk_api-0.26.0/listmonk_api/mcp/__init__.py +0 -25
  61. listmonk_api-0.26.0/listmonk_api/mcp/mcp_listmonk_campaigns.py +0 -78
  62. listmonk_api-0.26.0/listmonk_api/mcp/mcp_listmonk_imports.py +0 -64
  63. listmonk_api-0.26.0/listmonk_api/mcp/mcp_listmonk_lists.py +0 -63
  64. listmonk_api-0.26.0/listmonk_api/mcp/mcp_listmonk_media.py +0 -57
  65. listmonk_api-0.26.0/listmonk_api/mcp/mcp_listmonk_subscribers.py +0 -64
  66. listmonk_api-0.26.0/listmonk_api/mcp/mcp_listmonk_templates.py +0 -65
  67. listmonk_api-0.26.0/listmonk_api/mcp/mcp_listmonk_tx.py +0 -53
  68. listmonk_api-0.26.0/listmonk_api.egg-info/PKG-INFO +0 -393
  69. listmonk_api-0.26.0/listmonk_api.egg-info/SOURCES.txt +0 -47
  70. listmonk_api-0.26.0/listmonk_api.egg-info/entry_points.txt +0 -3
  71. listmonk_api-0.26.0/listmonk_api.egg-info/requires.txt +0 -7
  72. listmonk_api-0.26.0/pyproject.toml +0 -50
  73. listmonk_api-0.26.0/requirements.txt +0 -1
  74. listmonk_api-0.26.0/scripts/security_sanitizer.py +0 -160
  75. listmonk_api-0.26.0/tests/test_auth_and_server.py +0 -125
  76. listmonk_api-0.26.0/tests/test_concept_parity.py +0 -54
  77. listmonk_api-0.26.0/tests/test_init.py +0 -56
  78. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/MANIFEST.in +0 -0
  79. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api/api/__init__.py +0 -0
  80. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api/api/api_client_import_api.py +0 -0
  81. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api/api/api_client_media.py +0 -0
  82. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api/api/api_client_templates.py +0 -0
  83. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api/api/api_client_transactional.py +0 -0
  84. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api/api_client.py +0 -0
  85. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api/mcp_config.json +0 -0
  86. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api/models.py +0 -0
  87. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/listmonk_api.egg-info/dependency_links.txt +0 -0
  88. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/setup.cfg +0 -0
  89. {listmonk_api-0.26.0 → listmonk_api-2.3.1}/tests/test_action_discovery.py +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Audel Rouhi
3
+ Copyright (c) 2026 Project Maintainers
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,601 @@
1
+ Metadata-Version: 2.4
2
+ Name: listmonk-api
3
+ Version: 2.3.1
4
+ Summary: Agent package for Listmonk
5
+ Author-email: Project Maintainers <maintainers@users.noreply.github.com>
6
+ License: MIT
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Environment :: Console
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.12
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.0
16
+ Requires-Dist: requests>=2.34.2
17
+ Provides-Extra: mcp
18
+ Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.0; extra == "mcp"
19
+ Provides-Extra: all
20
+ Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.3.0; extra == "all"
21
+ Provides-Extra: test
22
+ Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
23
+ Requires-Dist: pytest>=9.1.1; extra == "test"
24
+ Requires-Dist: pytest-asyncio>=1.4.0; extra == "test"
25
+ Requires-Dist: pytest-cov>=7.1.0; extra == "test"
26
+ Dynamic: license-file
27
+
28
+ # Listmonk Api
29
+ ## CLI or API | MCP
30
+
31
+ ![PyPI - Version](https://img.shields.io/pypi/v/listmonk-api)
32
+ ![MCP Server](https://badge.mcpx.dev?type=server 'MCP Server')
33
+ ![PyPI - Downloads](https://img.shields.io/pypi/dd/listmonk-api)
34
+ ![GitHub Repo stars](https://img.shields.io/github/stars/Knuckles-Team/listmonk-api)
35
+ ![GitHub forks](https://img.shields.io/github/forks/Knuckles-Team/listmonk-api)
36
+ ![GitHub contributors](https://img.shields.io/github/contributors/Knuckles-Team/listmonk-api)
37
+ ![PyPI - License](https://img.shields.io/pypi/l/listmonk-api)
38
+ ![GitHub](https://img.shields.io/github/license/Knuckles-Team/listmonk-api)
39
+ ![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/Knuckles-Team/listmonk-api)
40
+ ![GitHub pull requests](https://img.shields.io/github/issues-pr/Knuckles-Team/listmonk-api)
41
+ ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/Knuckles-Team/listmonk-api)
42
+ ![GitHub issues](https://img.shields.io/github/issues/Knuckles-Team/listmonk-api)
43
+ ![GitHub top language](https://img.shields.io/github/languages/top/Knuckles-Team/listmonk-api)
44
+ ![GitHub language count](https://img.shields.io/github/languages/count/Knuckles-Team/listmonk-api)
45
+ ![GitHub repo size](https://img.shields.io/github/repo-size/Knuckles-Team/listmonk-api)
46
+ ![GitHub repo file count (file type)](https://img.shields.io/github/directory-file-count/Knuckles-Team/listmonk-api)
47
+ ![PyPI - Wheel](https://img.shields.io/pypi/wheel/listmonk-api)
48
+ ![PyPI - Implementation](https://img.shields.io/pypi/implementation/listmonk-api)
49
+
50
+ *Version: 2.3.1*
51
+
52
+ > **Documentation** — Installation, deployment, usage across the API, CLI, MCP, and
53
+ > agent interfaces, and guidance for provisioning the Listmonk platform are maintained
54
+ > in the [official documentation](https://knuckles-team.github.io/listmonk-api/).
55
+
56
+ ---
57
+
58
+ ## Overview
59
+
60
+ **Listmonk Api** is a production-grade Agent and Model Context Protocol (MCP) server designed to interface directly with Python Listmonk API Wrapper.
61
+
62
+ ---
63
+
64
+ ## Key Features
65
+
66
+ - **Consolidated Action-Routed MCP Tools:** Minimizes token overhead and eliminates tool bloat in LLM contexts by grouping methods into optimized, togglable tool modules.
67
+ - **Enterprise-Grade Security:** Complete support for Eunomia policies, OIDC token delegation, and granular execution context tracking.
68
+ - **Integrated Graph Agent:** Built-in Pydantic AI agent supporting the Agent Control Protocol (ACP) and standard Web interfaces (AG-UI).
69
+ - **Native Telemetry & Tracing:** Out-of-the-box OpenTelemetry exports and native Langfuse tracing.
70
+
71
+ ---
72
+
73
+ ## CLI or API
74
+
75
+ This agent wraps the Python Listmonk API Wrapper API. The operator can interact with it programmatically or via its integrated execution entrypoints.
76
+
77
+ Detailed instructions on how to use the underlying API wrappers, extended schema bindings, and developer SDK references are maintained in [docs/index.md](docs/index.md).
78
+
79
+ ---
80
+
81
+ ## MCP
82
+
83
+ This server use dynamic Action-Routed tools to optimize token overhead and maximize IDE compatibility.
84
+
85
+ ### Available MCP Tools
86
+
87
+ Auto-generated — do not edit between the markers below.
88
+
89
+ <!-- MCP-TOOLS-TABLE:START -->
90
+
91
+ #### Condensed action-routed tools (`MCP_TOOL_MODE=condensed`)
92
+
93
+ | MCP Tool | Toggle Env Var | Description |
94
+ |----------|----------------|-------------|
95
+ | `listmonk_campaigns` | `LISTMONK_CAMPAIGNSTOOL` | Manage listmonk campaigns operations. |
96
+ | `listmonk_imports` | `LISTMONK_IMPORTSTOOL` | Manage listmonk imports operations. |
97
+ | `listmonk_ingest` | `LISTMONK_INGESTTOOL` | Natively ingest Listmonk records into epistemic-graph as typed nodes + documents. |
98
+ | `listmonk_lists` | `LISTMONK_LISTSTOOL` | Manage listmonk lists operations. |
99
+ | `listmonk_media` | `LISTMONK_MEDIATOOL` | Manage listmonk media operations. |
100
+ | `listmonk_subscribers` | `LISTMONK_SUBSCRIBERSTOOL` | Manage listmonk subscribers operations. |
101
+ | `listmonk_templates` | `LISTMONK_TEMPLATESTOOL` | Manage listmonk templates operations. |
102
+ | `listmonk_tx` | `LISTMONK_TXTOOL` | Manage listmonk tx operations. |
103
+
104
+ #### Verbose 1:1 API-mapped tools (`MCP_TOOL_MODE=verbose` or `both`)
105
+
106
+ <details>
107
+ <summary>28 per-operation tools — one per public API method (click to expand)</summary>
108
+
109
+ | MCP Tool | Toggle Env Var | Description |
110
+ |----------|----------------|-------------|
111
+ | `listmonk_create_campaign` | `LISTMONK_APITOOL` | Invoke the create_campaign operation. |
112
+ | `listmonk_create_list` | `LISTMONK_APITOOL` | Invoke the create_list operation. |
113
+ | `listmonk_create_subscriber` | `LISTMONK_APITOOL` | Invoke the create_subscriber operation. |
114
+ | `listmonk_delete_campaign` | `LISTMONK_APITOOL` | Invoke the delete_campaign operation. |
115
+ | `listmonk_delete_media` | `LISTMONK_APITOOL` | Invoke the delete_media operation. |
116
+ | `listmonk_delete_subscriber_import` | `LISTMONK_APITOOL` | Invoke the delete_subscriber_import operation. |
117
+ | `listmonk_delete_template` | `LISTMONK_APITOOL` | Invoke the delete_template operation. |
118
+ | `listmonk_edit_list` | `LISTMONK_APITOOL` | Invoke the edit_list operation. |
119
+ | `listmonk_get_campaign` | `LISTMONK_APITOOL` | Invoke the get_campaign operation. |
120
+ | `listmonk_get_campaign_preview` | `LISTMONK_APITOOL` | Invoke the get_campaign_preview operation. |
121
+ | `listmonk_get_campaign_stats` | `LISTMONK_APITOOL` | Invoke the get_campaign_stats operation. |
122
+ | `listmonk_get_campaigns` | `LISTMONK_APITOOL` | Invoke the get_campaigns operation. |
123
+ | `listmonk_get_list` | `LISTMONK_APITOOL` | Invoke the get_list operation. |
124
+ | `listmonk_get_lists` | `LISTMONK_APITOOL` | Invoke the get_lists operation. |
125
+ | `listmonk_get_media` | `LISTMONK_APITOOL` | Invoke the get_media operation. |
126
+ | `listmonk_get_subscriber` | `LISTMONK_APITOOL` | Invoke the get_subscriber operation. |
127
+ | `listmonk_get_subscriber_import_logs` | `LISTMONK_APITOOL` | Invoke the get_subscriber_import_logs operation. |
128
+ | `listmonk_get_subscriber_import_status` | `LISTMONK_APITOOL` | Invoke the get_subscriber_import_status operation. |
129
+ | `listmonk_get_subscribers` | `LISTMONK_APITOOL` | Invoke the get_subscribers operation. |
130
+ | `listmonk_get_subscribers_from_list` | `LISTMONK_APITOOL` | Invoke the get_subscribers_from_list operation. |
131
+ | `listmonk_get_template` | `LISTMONK_APITOOL` | Invoke the get_template operation. |
132
+ | `listmonk_get_template_preview` | `LISTMONK_APITOOL` | Invoke the get_template_preview operation. |
133
+ | `listmonk_get_templates` | `LISTMONK_APITOOL` | Invoke the get_templates operation. |
134
+ | `listmonk_import_subscribers` | `LISTMONK_APITOOL` | Invoke the import_subscribers operation. |
135
+ | `listmonk_set_campaign_status` | `LISTMONK_APITOOL` | Invoke the set_campaign_status operation. |
136
+ | `listmonk_set_default_template` | `LISTMONK_APITOOL` | Invoke the set_default_template operation. |
137
+ | `listmonk_transactional_message` | `LISTMONK_APITOOL` | Invoke the transactional_message operation. |
138
+ | `listmonk_upload_media` | `LISTMONK_APITOOL` | Invoke the upload_media operation. |
139
+
140
+ </details>
141
+
142
+ _8 action-routed tool(s) · 28 verbose 1:1 tool(s). Each is enabled unless its `<DOMAIN>TOOL` toggle is set false; `MCP_TOOL_MODE` selects the surface (**`intent` default** — the six verb-tools, granular set loaded on demand · `condensed` action-routed · `verbose` 1:1 · `both`). Auto-generated — do not edit._
143
+ <!-- MCP-TOOLS-TABLE:END -->
144
+
145
+ ### Dynamic Tool Selection & Visibility
146
+
147
+ This MCP server supports dynamic toolset selection and visibility filtering at runtime. This allows the operator to restrict the set of exposed tools to prevent blowing up the LLM's context window.
148
+
149
+ The operator can configure tool filtering via multiple input channels:
150
+
151
+ - **CLI Arguments:** Pass `--tools` or `--toolsets` (or their disabled counterparts `--disabled-tools` and `--disabled-toolsets`) during startup.
152
+ - **Environment Variables:** Define standard environment variables:
153
+ - `MCP_ENABLED_TOOLS` / `MCP_DISABLED_TOOLS`
154
+ - `MCP_ENABLED_TAGS` / `MCP_DISABLED_TAGS`
155
+ - **HTTP SSE Request Headers:** Pass custom headers during transport initialization:
156
+ - `x-mcp-enabled-tools` / `x-mcp-disabled-tools`
157
+ - `x-mcp-enabled-tags` / `x-mcp-disabled-tags`
158
+ - **HTTP SSE Request Query Parameters:** Append query parameters directly to the operator's transport connection URL:
159
+ - `?tools=tool1,tool2`
160
+ - `?tags=tag1`
161
+
162
+ When query strings or parameters are supplied, an LLM-free **Knowledge Graph resolution layer** (using `DynamicToolOrchestrator`) matches query intents against known tool tags, names, or descriptions, with safe fallback and automated 24-hour background cache refreshing.
163
+
164
+ ---
165
+
166
+ ### MCP Configuration Examples
167
+
168
+ <!-- MCP-CONFIG-EXAMPLES:START -->
169
+
170
+ > **Install the connector-focused `[mcp]` extra.** Examples use `listmonk-api[mcp]` to add
171
+ > FastMCP / FastAPI through `agent-connector-sdk`; the required Agent Connector SDK core
172
+ > still carries `epistemic-graph[full]`. The `[agent-runtime]` extra additionally
173
+ > enables model orchestration.
174
+
175
+ #### stdio Transport (local IDEs — Cursor, Claude Desktop, VS Code)
176
+
177
+ ```json
178
+ {
179
+ "mcpServers": {
180
+ "listmonk-mcp": {
181
+ "command": "uvx",
182
+ "args": [
183
+ "--from",
184
+ "listmonk-api[mcp]",
185
+ "listmonk-mcp"
186
+ ],
187
+ "env": {
188
+ "MCP_TOOL_MODE": "intent",
189
+ "LISTMONK_CAMPAIGNSTOOL": "True",
190
+ "LISTMONK_IMPORTSTOOL": "True",
191
+ "LISTMONK_LISTSTOOL": "True",
192
+ "LISTMONK_MEDIATOOL": "True",
193
+ "LISTMONK_SUBSCRIBERSTOOL": "True",
194
+ "LISTMONK_TEMPLATESTOOL": "True",
195
+ "LISTMONK_TLS_PROFILE": "system",
196
+ "LISTMONK_TXTOOL": "True",
197
+ "LISTMONK_URL": "https://listmonk.example.invalid",
198
+ "OPENAPI_PASSWORD": "adminpassword",
199
+ "OPENAPI_USERNAME": "admin"
200
+ }
201
+ }
202
+ }
203
+ }
204
+ ```
205
+
206
+ Runtime references require an alias-aware launcher such as Arbora. Other
207
+ launchers must omit those entries and inject the resolved values through their
208
+ own runtime secret boundary.
209
+
210
+ #### Streamable-HTTP Transport (networked / production)
211
+
212
+ ```json
213
+ {
214
+ "mcpServers": {
215
+ "listmonk-mcp": {
216
+ "command": "uvx",
217
+ "args": [
218
+ "--from",
219
+ "listmonk-api[mcp]",
220
+ "listmonk-mcp",
221
+ "--transport",
222
+ "streamable-http",
223
+ "--port",
224
+ "8000"
225
+ ],
226
+ "env": {
227
+ "TRANSPORT": "streamable-http",
228
+ "HOST": "127.0.0.1",
229
+ "PORT": "8000",
230
+ "MCP_TOOL_MODE": "intent",
231
+ "LISTMONK_CAMPAIGNSTOOL": "True",
232
+ "LISTMONK_IMPORTSTOOL": "True",
233
+ "LISTMONK_LISTSTOOL": "True",
234
+ "LISTMONK_MEDIATOOL": "True",
235
+ "LISTMONK_SUBSCRIBERSTOOL": "True",
236
+ "LISTMONK_TEMPLATESTOOL": "True",
237
+ "LISTMONK_TLS_PROFILE": "system",
238
+ "LISTMONK_TXTOOL": "True",
239
+ "LISTMONK_URL": "https://listmonk.example.invalid",
240
+ "OPENAPI_PASSWORD": "adminpassword",
241
+ "OPENAPI_USERNAME": "admin"
242
+ }
243
+ }
244
+ }
245
+ }
246
+ ```
247
+
248
+ Alternatively, connect to a pre-deployed Streamable-HTTP instance by `url`:
249
+
250
+ ```json
251
+ {
252
+ "mcpServers": {
253
+ "listmonk-mcp": {
254
+ "url": "http://localhost:8000/listmonk-mcp/mcp"
255
+ }
256
+ }
257
+ }
258
+ ```
259
+
260
+ Run a reviewed container image as a least-privilege stdio child (no
261
+ listener or published port):
262
+
263
+ ```bash
264
+ docker run -i --rm \
265
+ --read-only \
266
+ --cap-drop=ALL \
267
+ --security-opt=no-new-privileges \
268
+ --pids-limit=256 \
269
+ --tmpfs /tmp:rw,noexec,nosuid,nodev,size=64m \
270
+ -e TRANSPORT=stdio \
271
+ -e MCP_TOOL_MODE=intent \
272
+ -e LISTMONK_CAMPAIGNSTOOL=True \
273
+ -e LISTMONK_IMPORTSTOOL=True \
274
+ -e LISTMONK_LISTSTOOL=True \
275
+ -e LISTMONK_MEDIATOOL=True \
276
+ -e LISTMONK_SUBSCRIBERSTOOL=True \
277
+ -e LISTMONK_TEMPLATESTOOL=True \
278
+ -e LISTMONK_TLS_PROFILE=system \
279
+ -e LISTMONK_TXTOOL=True \
280
+ -e LISTMONK_URL=https://listmonk.example.invalid \
281
+ -e OPENAPI_PASSWORD=adminpassword \
282
+ -e OPENAPI_USERNAME=admin \
283
+ registry.example.invalid/listmonk-api@sha256:<digest> listmonk-mcp
284
+ ```
285
+
286
+ For containerized network HTTP, supply an authenticated TLS ingress (or
287
+ direct server TLS), exact `MCP_ALLOWED_HOSTS`, and an exact trusted-proxy
288
+ CIDR policy through the operator-owned deployment profile. The generator
289
+ does not emit an unauthenticated non-loopback listener.
290
+
291
+ _Auto-generated from the code-read env surface (`MCP_TOOL_MODE` + package vars) — do not edit._
292
+ <!-- MCP-CONFIG-EXAMPLES:END -->
293
+
294
+ <!-- BEGIN GENERATED: additional-deployment-options -->
295
+ ### Additional Deployment Options
296
+
297
+ `listmonk-api` can run as a local stdio process or container, or behind a remote
298
+ network boundary. The
299
+ [Deployment guide](https://knuckles-team.github.io/listmonk-api/deployment/) carries
300
+ the detailed transport contract.
301
+
302
+ - **Local container** — launch a reviewed immutable image as a least-privilege
303
+ stdio child with no listener or published port.
304
+ - **Remote URL** — connect through an operator-supplied authenticated HTTPS
305
+ ingress. Keep its URL, outbound identity references, trust profile, and exact
306
+ `MCP_ALLOWED_HOSTS` in `AgentConfig`.
307
+ <!-- END GENERATED: additional-deployment-options -->
308
+
309
+ ## Agent
310
+
311
+ This repository features a fully integrated Pydantic AI Graph Agent. It communicates over the **Agent Control Protocol (ACP)** and interacts smoothly with the **Agent Web UI (AG-UI)** and Terminal interface.
312
+
313
+ ### Running the Agent CLI
314
+ To start the interactive command-line agent:
315
+
316
+ ```bash
317
+ # Set credentials
318
+ export LISTMONK_URL="your_listmonk_url_here"
319
+ export LISTMONK_USERNAME="your_listmonk_username_here"
320
+ export LISTMONK_PASSWORD="your_listmonk_password_here"
321
+
322
+ # Run the agent server
323
+ listmonk-agent --provider openai --model-id gpt-4o
324
+ ```
325
+
326
+ ### Docker Compose Orchestration
327
+
328
+ ```yaml
329
+ version: '3.8'
330
+
331
+ services:
332
+ listmonk-api-mcp:
333
+ image: example/listmonk-api@sha256:<digest>
334
+ container_name: listmonk-api-mcp
335
+ hostname: listmonk-api-mcp
336
+ restart: always
337
+ env_file:
338
+ - ../.env
339
+ environment:
340
+ - PYTHONUNBUFFERED=1
341
+ - HOST=0.0.0.0
342
+ - PORT=8000
343
+ - TRANSPORT=streamable-http
344
+ ports:
345
+ - "8000:8000"
346
+ healthcheck:
347
+ test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
348
+ interval: 30s
349
+ timeout: 10s
350
+ retries: 3
351
+ start_period: 10s
352
+ logging:
353
+ driver: json-file
354
+ options:
355
+ max-size: "10m"
356
+ max-file: "3"
357
+
358
+ image: example/listmonk-api@sha256:<digest>
359
+ container_name: listmonk-api-agent
360
+ hostname: listmonk-api-agent
361
+ restart: always
362
+ depends_on:
363
+ - listmonk-api-mcp
364
+ env_file:
365
+ - ../.env
366
+ command: [ "listmonk-agent" ]
367
+ environment:
368
+ - PYTHONUNBUFFERED=1
369
+ - HOST=0.0.0.0
370
+ - PORT=9004
371
+ - MCP_URL=http://listmonk-api-mcp:8000/mcp
372
+ - PROVIDER=${PROVIDER:-openai}
373
+ - MODEL_ID=${MODEL_ID:-gpt-4o}
374
+ - ENABLE_WEB_UI=True
375
+ - ENABLE_OTEL=True
376
+ ports:
377
+ - "9004:9004"
378
+ healthcheck:
379
+ test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:9004/health')"]
380
+ interval: 30s
381
+ timeout: 10s
382
+ retries: 3
383
+ start_period: 10s
384
+ logging:
385
+ driver: json-file
386
+ options:
387
+ max-size: "10m"
388
+ max-file: "3"
389
+
390
+ ```
391
+
392
+ Detailed graph node architecture explanations, custom skill configurations, and agentic trace guides are available in [docs/deployment.md](docs/deployment.md).
393
+
394
+ ---
395
+
396
+ ## Security & Governance
397
+
398
+ Built directly upon the enterprise-ready [`agent-connector-sdk`](https://github.com/Knuckles-Team/agent-connector-sdk) core, standard security parameters are fully supported:
399
+
400
+ ### Access Control & Policy Enforcement
401
+ - **Eunomia Policies:** Fine-grained, policy-driven tool authorization. Supports `none`, local `embedded` (`mcp_policies.json`), or centralized `remote` modes.
402
+ - **OIDC Token Delegation:** Compliant with RFC 8693 token exchange for flowing authenticating user credentials from Web UI / ACP → Agent → MCP.
403
+ - **Scoped Credentials:** Execution context runs restricted to the specific caller identity.
404
+
405
+ ### Runtime Security Grid
406
+ | Feature | Feature | Enablement |
407
+ |---------|---------------|------------|
408
+ | **Tool Guard** | Sensitivity inspection with human-in-the-loop validation | Enabled by default |
409
+ | **Prompt Injection Defense** | Input scanning, repetition monitoring, and recursive loop blocks | Enabled by default |
410
+ | **Context Safety Guard** | Stuck-loop detectors and contextual overflow preemptive alerts | Enabled by default |
411
+
412
+ ---
413
+
414
+ ## Environment Variables
415
+
416
+ <!-- ENV-VARS-TABLE:START -->
417
+
418
+ #### Package environment variables
419
+
420
+ | Variable | Example | Description |
421
+ |----------|---------|-------------|
422
+ | `HOST` | `0.0.0.0` | |
423
+ | `PORT` | `8000` | |
424
+ | `TRANSPORT` | `stdio` | options: stdio, streamable-http, sse |
425
+ | `ENABLE_OTEL` | `True` | |
426
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | `http://localhost:8080/api/public/otel` | |
427
+ | `OTEL_EXPORTER_OTLP_PUBLIC_KEY` | secret-injected | |
428
+ | `OTEL_EXPORTER_OTLP_SECRET_KEY` | secret-injected | |
429
+ | `OTEL_EXPORTER_OTLP_PROTOCOL` | `http/protobuf` | |
430
+ | `AUTH_TYPE` | — | |
431
+ | `EUNOMIA_TYPE` | `none` | options: none, embedded, remote |
432
+ | `EUNOMIA_POLICY_FILE` | `mcp_policies.json` | |
433
+ | `EUNOMIA_REMOTE_URL` | `http://eunomia-server:8000` | |
434
+ | `OIDC_BASE_URL` | — | |
435
+ | `OPENAPI_USERNAME` | `admin` | |
436
+ | `OPENAPI_PASSWORD` | secret-injected | |
437
+ | `OPENAPI_CLIENT_ID` | — | OAuth client id for OpenAPI tool import |
438
+ | `OPENAPI_CLIENT_SECRET` | secret-injected | OAuth client secret for OpenAPI tool import |
439
+ | `LISTMONK_URL` | `https://listmonk.example.invalid` | |
440
+ | `LISTMONK_TOKEN` | secret-injected | |
441
+ | `LISTMONK_TLS_PROFILE` | `system` | Named outbound TLS policy from AgentConfig. Use a reference for runtime-only trust material; peer and hostname verification remain mandatory. |
442
+ | `LISTMONK_TLS_PROFILE_REF` | — | |
443
+ | `LISTMONK_CAMPAIGNSTOOL` | `True` | |
444
+ | `LISTMONK_IMPORTSTOOL` | `True` | |
445
+ | `LISTMONK_LISTSTOOL` | `True` | |
446
+ | `LISTMONK_MEDIATOOL` | `True` | |
447
+ | `LISTMONK_SUBSCRIBERSTOOL` | `True` | |
448
+ | `LISTMONK_TEMPLATESTOOL` | `True` | |
449
+ | `LISTMONK_TXTOOL` | `True` | |
450
+
451
+ #### Inherited agent-connector-sdk variables (apply to every connector)
452
+
453
+ | Variable | Example | Description |
454
+ |----------|---------|-------------|
455
+ | `MCP_TOOL_MODE` | `intent` | Tool surface: `intent` \| `condensed` \| `verbose` \| `both` |
456
+ | `MCP_ENABLED_TOOLS` | — | Comma-separated tool allow-list |
457
+ | `MCP_DISABLED_TOOLS` | — | Comma-separated tool deny-list |
458
+ | `MCP_ENABLED_TAGS` | — | Comma-separated tag allow-list |
459
+ | `MCP_DISABLED_TAGS` | — | Comma-separated tag deny-list |
460
+ | `MCP_CLIENT_AUTH` | — | Outbound MCP child auth: `oidc-client-credentials` \| `basic` \| `none` |
461
+ | `OIDC_CLIENT_ID` | — | OIDC client id (service-account auth) |
462
+ | `OIDC_CLIENT_SECRET_REF` | `secret://identity/oidc-client-secret` | Runtime secret reference for the OIDC service account |
463
+ | `MCP_BASIC_AUTH_USERNAME` | — | HTTP Basic username (`MCP_CLIENT_AUTH=basic`) |
464
+ | `MCP_BASIC_AUTH_PASSWORD_REF` | `secret://identity/mcp-basic-password` | Runtime secret reference for HTTP Basic auth (`MCP_CLIENT_AUTH=basic`) |
465
+ | `DEBUG` | `False` | Verbose logging |
466
+ | `PYTHONUNBUFFERED` | `1` | Unbuffered stdout (recommended in containers) |
467
+ | `MCP_URL` | `http://localhost:8000/mcp` | URL of the MCP server the agent connects to |
468
+ | `PROVIDER` | `openai` | LLM provider for the agent |
469
+ | `MODEL_ID` | `gpt-4o` | Model id for the agent |
470
+ | `ENABLE_WEB_UI` | `True` | Serve the AG-UI web interface |
471
+
472
+ _28 package + 16 inherited variable(s). Auto-generated from `.env.example` + the shared agent-connector-sdk set — do not edit._
473
+ <!-- ENV-VARS-TABLE:END -->
474
+
475
+
476
+ The server and client support standard configuration environment variables:
477
+
478
+ | Variable | Description | Default |
479
+ |---|---|---|
480
+ | `LISTMONK_URL` | Base URL of the operator's Listmonk instance. | `http://localhost:8080` |
481
+ | `LISTMONK_TOKEN` | Bearer Token used for secure API authorization. | `""` |
482
+ | `LISTMONK_USERNAME` | Username for Basic Authorization (if token is empty). | `""` |
483
+ | `LISTMONK_PASSWORD` | Password for Basic Authorization (if token is empty). | `""` |
484
+ | **Toggles** | | |
485
+ | `LISTMONK_SUBSCRIBERSTOOL`| Enable or disable the `listmonk_subscribers` tool. | `True` |
486
+ | `LISTMONK_LISTSTOOL` | Enable or disable the `listmonk_lists` tool. | `True` |
487
+ | `LISTMONK_IMPORTSTOOL` | Enable or disable the `listmonk_imports` tool. | `True` |
488
+ | `LISTMONK_CAMPAIGNSTOOL` | Enable or disable the `listmonk_campaigns` tool. | `True` |
489
+ | `LISTMONK_MEDIATOOL` | Enable or disable the `listmonk_media` tool. | `True` |
490
+ | `LISTMONK_TEMPLATESTOOL` | Enable or disable the `listmonk_templates` tool. | `True` |
491
+ | `LISTMONK_TXTOOL` | Enable or disable the `listmonk_tx` tool. | `True` |
492
+ | **Security & Policies** | | |
493
+ | `AUTH_TYPE` | Type of API authentication schema required. | `""` |
494
+ | `EUNOMIA_TYPE` | Type of authorization engine policy enforcement (`none`, `embedded`, `remote`). | `none` |
495
+ | `EUNOMIA_POLICY_FILE` | Path to the operator's local policy definition file (e.g., `mcp_policies.json`). | `""` |
496
+ | `EUNOMIA_REMOTE_URL` | Host/Port URL pointing to a remote Eunomia policy daemon. | `""` |
497
+ | `ALLOWED_CLIENT_REDIRECT_URIS`| Whitelisted URIs allowed to complete Oauth/OIDC identity validation flows. | `""` |
498
+ | `OAUTH_BASE_URL` | Base endpoint of the operator's trusted OAuth provider. | `""` |
499
+ | `OIDC_BASE_URL` | Base endpoint of the operator's OIDC identity provider. | `""` |
500
+ | **OpenAPI Docs** | | |
501
+ | `OPENAPI_USERNAME` | Username whitelisted to view internal raw API specifications. | `""` |
502
+ | `OPENAPI_PASSWORD` | Password whitelisted to view internal raw API specifications. | `""` |
503
+ | `OPENAPI_BEARER_TOKEN` | Bearer authorization token used to limit raw API specifications access. | `""` |
504
+
505
+ ---
506
+
507
+ ## Installation
508
+
509
+ Pick the extra that matches what the operator want to run:
510
+
511
+ | Extra | Installs | Use when |
512
+ |-------|----------|----------|
513
+ | `listmonk-api[mcp]` | Connector-focused MCP server (`agent-connector-sdk` — FastMCP/FastAPI + `epistemic-graph[full]`) | The operator only run the **MCP server** (smallest install / image) |
514
+ | `listmonk-api[all]` | Everything (`mcp` + `agent` + `logfire`) | Development / both surfaces |
515
+
516
+ ```bash
517
+ # Connector-focused MCP server (includes the shared graph engine)
518
+ uv pip install "listmonk-api[mcp]"
519
+
520
+ # Agent runtime (adds model orchestration to the shared graph engine)
521
+
522
+ # Everything (development)
523
+ uv pip install "listmonk-api[all]" # or: python -m pip install "listmonk-api[all]"
524
+ ```
525
+
526
+ ### Container images (`:mcp`)
527
+
528
+ One multi-stage `docker/Dockerfile` builds the MCP-only image (`--target mcp`):
529
+
530
+ | Image tag | Build target | Contents | Entrypoint |
531
+ |-----------|--------------|----------|------------|
532
+ | `example/listmonk-api:mcp` | `--target mcp` | `listmonk-api[mcp]` — **connector-focused**, includes `epistemic-graph[full]`; no model-orchestration stack | `listmonk-mcp` |
533
+
534
+ ```bash
535
+ docker build --target mcp -t example/listmonk-api:mcp docker/ # connector-focused MCP server
536
+ ```
537
+
538
+ agent (`immutable agent digest`) with a co-located `:mcp` sidecar.
539
+
540
+ ### Knowledge-graph database (`epistemic-graph`)
541
+
542
+ Agent Connector SDK core dependency (`epistemic-graph[full]`). The `[mcp]` extra keeps
543
+ deployments can use the bundled engine. For production or shared state, run
544
+ **epistemic-graph as a dedicated database service** and configure the runtime to use it.
545
+ Deployment recipes (single-node + Raft HA), connection configuration, and architecture
546
+ diagrams are documented in the
547
+ [epistemic-graph deployment guide](https://knuckles-team.github.io/epistemic-graph/deployment/).
548
+
549
+ ---
550
+
551
+ ## Documentation
552
+
553
+ The complete documentation is published as the
554
+ [official documentation site](https://knuckles-team.github.io/listmonk-api/) and is the
555
+ recommended reference for installation, deployment, and day-to-day operation.
556
+
557
+ | Page | Contents |
558
+ |---|---|
559
+ | [Installation](https://knuckles-team.github.io/listmonk-api/installation/) | pip, source, extras, prebuilt Docker image |
560
+ | [Deployment](https://knuckles-team.github.io/listmonk-api/deployment/) | run the MCP and agent servers, Compose, Caddy + Technitium, env config |
561
+ | [Usage](https://knuckles-team.github.io/listmonk-api/usage/) | the MCP tools, the `ListmonkAPI` client, the agent CLI |
562
+ | [Backing Platform](https://knuckles-team.github.io/listmonk-api/platform/) | deploy Listmonk with Docker |
563
+ | [Overview](https://knuckles-team.github.io/listmonk-api/overview/) | API structure, tool reference, quick start |
564
+ | [Concepts](https://knuckles-team.github.io/listmonk-api/concepts/) | concept registry (`CONCEPT:LM-*`) |
565
+
566
+ ---
567
+
568
+ ## Repository Owners
569
+
570
+ <img width="100%" height="180em" src="https://github-readme-stats.vercel.app/api?username=example&show_icons=true&hide_border=true&&count_private=true&include_all_commits=true" />
571
+
572
+ ![GitHub followers](https://img.shields.io/github/followers/example)
573
+ ![GitHub User's stars](https://img.shields.io/github/stars/example)
574
+
575
+ ---
576
+
577
+ ## Contribute
578
+
579
+ Contributions are welcome! Please ensure code quality by running local checks before submitting pull requests:
580
+ - Format code using `ruff format .`
581
+ - Lint code using `ruff check .`
582
+ - Validate type-safety with `mypy .`
583
+ - Ran test suites using `pytest`
584
+
585
+
586
+
587
+ <!-- GOVERNED-CAPABILITY:START -->
588
+ ## Governed capability contract
589
+
590
+ This package ships a compact canonical skill surface with specialist procedures
591
+ kept as referenced workflows. The current MCP tools, skill metadata,
592
+ `connector_manifest.yml`, ontology, mappings, shapes, fixtures, migrations,
593
+ tool-schema fingerprints, and certification metadata form one versioned
594
+ capability contract. Validate them together; do not rely on stale tool names or
595
+ historical per-task skill wrappers.
596
+
597
+ Runtime endpoints, credentials, certificate trust, tenant identity, retention,
598
+ and observability policy are deployment inputs and are never packaged values.
599
+ See [Configuration, trust, and privacy](docs/configuration.md) before enabling a
600
+ network transport, connector ingestion, Arbora delegation, or trace export.
601
+ <!-- GOVERNED-CAPABILITY:END -->