mxcp 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. mxcp-0.1.0/LICENSE +40 -0
  2. mxcp-0.1.0/PKG-INFO +191 -0
  3. mxcp-0.1.0/README.md +153 -0
  4. mxcp-0.1.0/pyproject.toml +77 -0
  5. mxcp-0.1.0/setup.cfg +4 -0
  6. mxcp-0.1.0/src/mxcp/__main__.py +33 -0
  7. mxcp-0.1.0/src/mxcp/audit/__init__.py +5 -0
  8. mxcp-0.1.0/src/mxcp/audit/logger.py +335 -0
  9. mxcp-0.1.0/src/mxcp/audit/query.py +313 -0
  10. mxcp-0.1.0/src/mxcp/auth/__init__.py +1 -0
  11. mxcp-0.1.0/src/mxcp/auth/atlassian.py +242 -0
  12. mxcp-0.1.0/src/mxcp/auth/context.py +45 -0
  13. mxcp-0.1.0/src/mxcp/auth/github.py +208 -0
  14. mxcp-0.1.0/src/mxcp/auth/middleware.py +120 -0
  15. mxcp-0.1.0/src/mxcp/auth/providers.py +409 -0
  16. mxcp-0.1.0/src/mxcp/auth/url_utils.py +146 -0
  17. mxcp-0.1.0/src/mxcp/cli/__init__.py +0 -0
  18. mxcp-0.1.0/src/mxcp/cli/dbt.py +123 -0
  19. mxcp-0.1.0/src/mxcp/cli/drift_check.py +167 -0
  20. mxcp-0.1.0/src/mxcp/cli/drift_snapshot.py +81 -0
  21. mxcp-0.1.0/src/mxcp/cli/init.py +175 -0
  22. mxcp-0.1.0/src/mxcp/cli/list.py +109 -0
  23. mxcp-0.1.0/src/mxcp/cli/log.py +251 -0
  24. mxcp-0.1.0/src/mxcp/cli/query.py +98 -0
  25. mxcp-0.1.0/src/mxcp/cli/run.py +121 -0
  26. mxcp-0.1.0/src/mxcp/cli/serve.py +100 -0
  27. mxcp-0.1.0/src/mxcp/cli/test.py +155 -0
  28. mxcp-0.1.0/src/mxcp/cli/utils.py +137 -0
  29. mxcp-0.1.0/src/mxcp/cli/validate.py +114 -0
  30. mxcp-0.1.0/src/mxcp/config/__init__.py +0 -0
  31. mxcp-0.1.0/src/mxcp/config/analytics.py +125 -0
  32. mxcp-0.1.0/src/mxcp/config/schemas/__init__.py +0 -0
  33. mxcp-0.1.0/src/mxcp/config/schemas/mxcp-config-schema-1.0.0.json +305 -0
  34. mxcp-0.1.0/src/mxcp/config/schemas/mxcp-site-schema-1.0.0.json +166 -0
  35. mxcp-0.1.0/src/mxcp/config/site_config.py +134 -0
  36. mxcp-0.1.0/src/mxcp/config/types.py +116 -0
  37. mxcp-0.1.0/src/mxcp/config/user_config.py +274 -0
  38. mxcp-0.1.0/src/mxcp/drift/checker.py +338 -0
  39. mxcp-0.1.0/src/mxcp/drift/snapshot.py +126 -0
  40. mxcp-0.1.0/src/mxcp/drift/types.py +140 -0
  41. mxcp-0.1.0/src/mxcp/endpoints/executor.py +585 -0
  42. mxcp-0.1.0/src/mxcp/endpoints/loader.py +213 -0
  43. mxcp-0.1.0/src/mxcp/endpoints/runner.py +38 -0
  44. mxcp-0.1.0/src/mxcp/endpoints/schema.py +300 -0
  45. mxcp-0.1.0/src/mxcp/endpoints/tester.py +307 -0
  46. mxcp-0.1.0/src/mxcp/endpoints/types.py +111 -0
  47. mxcp-0.1.0/src/mxcp/engine/dbt_runner.py +385 -0
  48. mxcp-0.1.0/src/mxcp/engine/duckdb_session.py +166 -0
  49. mxcp-0.1.0/src/mxcp/engine/extension_loader.py +45 -0
  50. mxcp-0.1.0/src/mxcp/engine/plugin_loader.py +112 -0
  51. mxcp-0.1.0/src/mxcp/engine/secret_injection.py +68 -0
  52. mxcp-0.1.0/src/mxcp/plugins/__init__.py +10 -0
  53. mxcp-0.1.0/src/mxcp/plugins/base.py +245 -0
  54. mxcp-0.1.0/src/mxcp/policies/__init__.py +20 -0
  55. mxcp-0.1.0/src/mxcp/policies/enforcement.py +376 -0
  56. mxcp-0.1.0/src/mxcp/server/mcp.py +970 -0
  57. mxcp-0.1.0/src/mxcp.egg-info/PKG-INFO +191 -0
  58. mxcp-0.1.0/src/mxcp.egg-info/SOURCES.txt +77 -0
  59. mxcp-0.1.0/src/mxcp.egg-info/dependency_links.txt +1 -0
  60. mxcp-0.1.0/src/mxcp.egg-info/entry_points.txt +2 -0
  61. mxcp-0.1.0/src/mxcp.egg-info/requires.txt +29 -0
  62. mxcp-0.1.0/src/mxcp.egg-info/top_level.txt +1 -0
  63. mxcp-0.1.0/tests/test_cli.py +13 -0
  64. mxcp-0.1.0/tests/test_cli_run.py +71 -0
  65. mxcp-0.1.0/tests/test_drift_check.py +344 -0
  66. mxcp-0.1.0/tests/test_endpoint_execution.py +136 -0
  67. mxcp-0.1.0/tests/test_list.py +175 -0
  68. mxcp-0.1.0/tests/test_mcp.py +232 -0
  69. mxcp-0.1.0/tests/test_plugin_base.py +226 -0
  70. mxcp-0.1.0/tests/test_policies.py +861 -0
  71. mxcp-0.1.0/tests/test_policies_integration.py +572 -0
  72. mxcp-0.1.0/tests/test_return_type_validation.py +181 -0
  73. mxcp-0.1.0/tests/test_runner.py +273 -0
  74. mxcp-0.1.0/tests/test_secret_injection.py +83 -0
  75. mxcp-0.1.0/tests/test_tester.py +155 -0
  76. mxcp-0.1.0/tests/test_type_converter.py +264 -0
  77. mxcp-0.1.0/tests/test_user_config.py +127 -0
  78. mxcp-0.1.0/tests/test_validation.py +152 -0
  79. mxcp-0.1.0/tests/test_vault_integration.py +239 -0
mxcp-0.1.0/LICENSE ADDED
@@ -0,0 +1,40 @@
1
+ Business Source License 1.1
2
+
3
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
4
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
5
+
6
+ Parameters
7
+
8
+ Licensor: RAW Labs SA
9
+ Licensed Work: MXCP
10
+ The Licensed Work is (c) 2025 RAW Labs SA
11
+ Additional Use Grant: You may make use of the Licensed Work, provided that you may not use the Licensed Work for a Database Service.
12
+ Change Date: Four years from the date the Licensed Work is published.
13
+ Change License: MIT License
14
+
15
+ For information about alternative licensing arrangements for the Software, please visit:
16
+ https://raw-labs.com/licensing
17
+
18
+ Notice
19
+
20
+ The Business Source License (this document, or the "License") is not an Open Source license. However, the Licensed Work will eventually be released under an Open Source License, as stated in this License.
21
+
22
+ Terms
23
+
24
+ The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
25
+
26
+ Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
27
+
28
+ If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
29
+
30
+ All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
31
+
32
+ You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
33
+
34
+ Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
35
+
36
+ This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License).
37
+
38
+ THE LICENSED WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE LICENSED WORK OR THE USE OR OTHER DEALINGS IN THE LICENSED WORK.
39
+
40
+ The Business Source License (this document, or the "License") is not an Open Source license. However, the Licensed Work will eventually be released under an Open Source License, as stated in this License.
mxcp-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,191 @@
1
+ Metadata-Version: 2.4
2
+ Name: mxcp
3
+ Version: 0.1.0
4
+ Summary: RAW Model Context Protocol
5
+ Author-email: RAW Labs SA <hello@raw-labs.com>
6
+ License: Business Source License 1.1
7
+ Requires-Python: >=3.9
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: mcp>=1.9.0
11
+ Requires-Dist: click>=8.1.7
12
+ Requires-Dist: pyyaml>=6.0.1
13
+ Requires-Dist: jsonschema
14
+ Requires-Dist: duckdb>=0.9.2
15
+ Requires-Dist: jinja2>=3.1.3
16
+ Requires-Dist: aiohttp>=3.8.0
17
+ Requires-Dist: starlette>=0.27.0
18
+ Requires-Dist: makefun
19
+ Requires-Dist: pandas>=2.0.0
20
+ Requires-Dist: posthog>=3.0.0
21
+ Requires-Dist: dbt-core>=1.6.0
22
+ Requires-Dist: dbt-duckdb>=1.6.0
23
+ Requires-Dist: cel-python>=0.2.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest; extra == "dev"
26
+ Requires-Dist: pytest-asyncio; extra == "dev"
27
+ Requires-Dist: pytest-cov; extra == "dev"
28
+ Requires-Dist: pytest-mock; extra == "dev"
29
+ Requires-Dist: pytest-timeout; extra == "dev"
30
+ Requires-Dist: aioresponses; extra == "dev"
31
+ Requires-Dist: black; extra == "dev"
32
+ Requires-Dist: isort; extra == "dev"
33
+ Requires-Dist: mypy; extra == "dev"
34
+ Requires-Dist: hvac>=2.0.0; extra == "dev"
35
+ Provides-Extra: vault
36
+ Requires-Dist: hvac>=2.0.0; extra == "vault"
37
+ Dynamic: license-file
38
+
39
+ # MXCP: Instantly Serve Your Operational Data to LLMs — Safely
40
+
41
+ <div align="center">
42
+
43
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
44
+ [![License](https://img.shields.io/badge/license-BSL-green.svg)](LICENSE)
45
+
46
+ **Transform your data into AI-ready interfaces in minutes, not months**
47
+
48
+ </div>
49
+
50
+ ## ✨ Why MXCP?
51
+
52
+ MXCP (Model eXecution + Context Protocol) is a developer-first tool that bridges the gap between your operational data and AI applications. It lets you:
53
+
54
+ - 🚀 **Go from data to AI in minutes** — Define interfaces in YAML + SQL, serve instantly
55
+ - 🔒 **Keep control of your data** — Run locally, with full observability and type safety
56
+ - 🎯 **Build production-ready AI tools** — Combine real-time data, caching, and business logic
57
+ - 🛠️ **Use familiar tools** — DuckDB for execution, dbt for modeling, Git for versioning
58
+
59
+ ## 🚀 Quick Start
60
+
61
+ ```bash
62
+ # Install globally
63
+ pip install mxcp
64
+
65
+ # Install with Vault support (optional)
66
+ pip install "mxcp[vault]"
67
+
68
+ # Or develop locally
69
+ git clone https://github.com/raw-labs/mxcp.git && cd mxcp
70
+ python -m venv .venv && source .venv/bin/activate
71
+ pip install -e .
72
+ ```
73
+
74
+ Try the included Earthquakes example:
75
+ ```bash
76
+ cd examples/earthquakes
77
+ mxcp serve
78
+ ```
79
+
80
+ ## 💡 Key Features
81
+
82
+ ### 1. Declarative Interface Definition
83
+ ```yaml
84
+ # tools/summarize_earthquakes.yml
85
+ mxcp: "1.0.0"
86
+ tool:
87
+ name: summarize_earthquakes
88
+ description: "Summarize earthquakes for a given date"
89
+ parameters:
90
+ - name: date
91
+ type: string
92
+ format: date
93
+ description: "Date to summarize earthquakes for"
94
+ return:
95
+ type: object
96
+ properties:
97
+ summary:
98
+ type: string
99
+ description: "Summary of earthquakes for the date"
100
+ source:
101
+ code: |
102
+ SELECT 'Summary for ' || $date || ': ' || COUNT(*) || ' earthquakes' AS summary
103
+ FROM earthquakes
104
+ WHERE event_date = $date
105
+ ```
106
+
107
+ - **Type-safe** — Strong typing for LLM safety and schema tracing
108
+ - **Fast restart** — Quick server restarts for development
109
+ - **dbt integration** — Directly use your dbt models in endpoints
110
+
111
+ ### 2. Powerful Data Engine
112
+ - **DuckDB-powered** — Run instantly, with no infrastructure
113
+ - **Rich integrations** — PostgreSQL, Parquet, CSV, JSON, HTTP, S3, and more
114
+ - **Full SQL support** — Joins, filters, aggregations, UDFs
115
+
116
+ ### 3. Production-Ready Features
117
+ - **dbt integration** — Use your data models directly
118
+ - **Git-based workflow** — Version control and collaboration
119
+ - **Validation tools** — Type checking, SQL linting, and testing
120
+ - **Drift detection** — Monitor schema and endpoint changes across environments
121
+
122
+ ## 🛠️ Core Concepts
123
+
124
+ ### Tools, Resources, Prompts
125
+ Define your AI interface using MCP (Model Context Protocol) specs:
126
+ - **Tools** — Functions that process data and return results
127
+ - **Resources** — Data sources and caches
128
+ - **Prompts** — Templates for LLM interactions
129
+
130
+ ### Project Structure
131
+ ```
132
+ your-project/
133
+ ├── mxcp-site.yml # Project configuration
134
+ ├── tools/ # Tool definitions
135
+ ├── resources/ # Data sources
136
+ ├── prompts/ # LLM templates
137
+ └── models/ # (Optional) dbt transformations & caches
138
+ ```
139
+
140
+ ### CLI Commands
141
+ ```bash
142
+ mxcp serve # Start local MCP server
143
+ mxcp list # List all endpoints
144
+ mxcp validate # Check types, SQL, and references
145
+ mxcp test # Run endpoint tests
146
+ mxcp query # Execute SQL queries
147
+ mxcp init # Initialize new project
148
+ mxcp dbt-config # Configure dbt integration
149
+ mxcp dbt # Run dbt commands
150
+ mxcp drift-snapshot # Create drift detection baseline
151
+ mxcp drift-check # Check for schema and endpoint drift
152
+ mxcp log # Query audit logs
153
+ ```
154
+
155
+ ## 🔌 LLM Integration
156
+
157
+ MXCP implements the Model Context Protocol (MCP), making it compatible with:
158
+
159
+ - **Claude Desktop** — Native MCP support
160
+ - **OpenAI-compatible tools** — Via MCP adapters
161
+ - **Custom integrations** — Using the MCP specification
162
+
163
+ For specific setup instructions, see:
164
+ - [Earthquakes Example](examples/earthquakes/README.md) — Complete Claude Desktop setup walkthrough
165
+ - [Integration Guide](docs/integrations.md) — Claude Desktop, OpenAI, mcp-cli, and custom integrations
166
+
167
+ ## 📚 Documentation
168
+
169
+ - [Overview](docs/overview.md) — Core concepts and architecture
170
+ - [Quickstart](docs/quickstart.md) — Get up and running
171
+ - [CLI Reference](docs/cli.md) — Command-line tools
172
+ - [Configuration](docs/configuration.md) — Project setup
173
+ - [Plugins](docs/plugins.md) — Extend DuckDB with custom Python functions
174
+ - [Authentication](docs/authentication.md) — OAuth authentication setup
175
+ - [Policy Enforcement](docs/policies.md) — Access control and data filtering
176
+ - [Audit Logging](docs/auditing.md) — Enterprise-grade execution logging
177
+ - [Type System](docs/type-system.md) — Data types and validation
178
+ - [Integrations](docs/integrations.md) — Data sources and tools
179
+ - [Drift Detection](docs/drift-detection.md) — Schema and endpoint change monitoring
180
+
181
+ ## 🤝 Contributing
182
+
183
+ We welcome contributions! See our [development guide](docs/dev-guide.md) to get started.
184
+
185
+ ## 🧠 About
186
+
187
+ MXCP is developed by RAW Labs, combining the best of:
188
+ - dbt's modular data modeling
189
+ - DuckDB's speed and connectors
190
+ - Python MCP official server
191
+ - Modern AI-native workflows
mxcp-0.1.0/README.md ADDED
@@ -0,0 +1,153 @@
1
+ # MXCP: Instantly Serve Your Operational Data to LLMs — Safely
2
+
3
+ <div align="center">
4
+
5
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
6
+ [![License](https://img.shields.io/badge/license-BSL-green.svg)](LICENSE)
7
+
8
+ **Transform your data into AI-ready interfaces in minutes, not months**
9
+
10
+ </div>
11
+
12
+ ## ✨ Why MXCP?
13
+
14
+ MXCP (Model eXecution + Context Protocol) is a developer-first tool that bridges the gap between your operational data and AI applications. It lets you:
15
+
16
+ - 🚀 **Go from data to AI in minutes** — Define interfaces in YAML + SQL, serve instantly
17
+ - 🔒 **Keep control of your data** — Run locally, with full observability and type safety
18
+ - 🎯 **Build production-ready AI tools** — Combine real-time data, caching, and business logic
19
+ - 🛠️ **Use familiar tools** — DuckDB for execution, dbt for modeling, Git for versioning
20
+
21
+ ## 🚀 Quick Start
22
+
23
+ ```bash
24
+ # Install globally
25
+ pip install mxcp
26
+
27
+ # Install with Vault support (optional)
28
+ pip install "mxcp[vault]"
29
+
30
+ # Or develop locally
31
+ git clone https://github.com/raw-labs/mxcp.git && cd mxcp
32
+ python -m venv .venv && source .venv/bin/activate
33
+ pip install -e .
34
+ ```
35
+
36
+ Try the included Earthquakes example:
37
+ ```bash
38
+ cd examples/earthquakes
39
+ mxcp serve
40
+ ```
41
+
42
+ ## 💡 Key Features
43
+
44
+ ### 1. Declarative Interface Definition
45
+ ```yaml
46
+ # tools/summarize_earthquakes.yml
47
+ mxcp: "1.0.0"
48
+ tool:
49
+ name: summarize_earthquakes
50
+ description: "Summarize earthquakes for a given date"
51
+ parameters:
52
+ - name: date
53
+ type: string
54
+ format: date
55
+ description: "Date to summarize earthquakes for"
56
+ return:
57
+ type: object
58
+ properties:
59
+ summary:
60
+ type: string
61
+ description: "Summary of earthquakes for the date"
62
+ source:
63
+ code: |
64
+ SELECT 'Summary for ' || $date || ': ' || COUNT(*) || ' earthquakes' AS summary
65
+ FROM earthquakes
66
+ WHERE event_date = $date
67
+ ```
68
+
69
+ - **Type-safe** — Strong typing for LLM safety and schema tracing
70
+ - **Fast restart** — Quick server restarts for development
71
+ - **dbt integration** — Directly use your dbt models in endpoints
72
+
73
+ ### 2. Powerful Data Engine
74
+ - **DuckDB-powered** — Run instantly, with no infrastructure
75
+ - **Rich integrations** — PostgreSQL, Parquet, CSV, JSON, HTTP, S3, and more
76
+ - **Full SQL support** — Joins, filters, aggregations, UDFs
77
+
78
+ ### 3. Production-Ready Features
79
+ - **dbt integration** — Use your data models directly
80
+ - **Git-based workflow** — Version control and collaboration
81
+ - **Validation tools** — Type checking, SQL linting, and testing
82
+ - **Drift detection** — Monitor schema and endpoint changes across environments
83
+
84
+ ## 🛠️ Core Concepts
85
+
86
+ ### Tools, Resources, Prompts
87
+ Define your AI interface using MCP (Model Context Protocol) specs:
88
+ - **Tools** — Functions that process data and return results
89
+ - **Resources** — Data sources and caches
90
+ - **Prompts** — Templates for LLM interactions
91
+
92
+ ### Project Structure
93
+ ```
94
+ your-project/
95
+ ├── mxcp-site.yml # Project configuration
96
+ ├── tools/ # Tool definitions
97
+ ├── resources/ # Data sources
98
+ ├── prompts/ # LLM templates
99
+ └── models/ # (Optional) dbt transformations & caches
100
+ ```
101
+
102
+ ### CLI Commands
103
+ ```bash
104
+ mxcp serve # Start local MCP server
105
+ mxcp list # List all endpoints
106
+ mxcp validate # Check types, SQL, and references
107
+ mxcp test # Run endpoint tests
108
+ mxcp query # Execute SQL queries
109
+ mxcp init # Initialize new project
110
+ mxcp dbt-config # Configure dbt integration
111
+ mxcp dbt # Run dbt commands
112
+ mxcp drift-snapshot # Create drift detection baseline
113
+ mxcp drift-check # Check for schema and endpoint drift
114
+ mxcp log # Query audit logs
115
+ ```
116
+
117
+ ## 🔌 LLM Integration
118
+
119
+ MXCP implements the Model Context Protocol (MCP), making it compatible with:
120
+
121
+ - **Claude Desktop** — Native MCP support
122
+ - **OpenAI-compatible tools** — Via MCP adapters
123
+ - **Custom integrations** — Using the MCP specification
124
+
125
+ For specific setup instructions, see:
126
+ - [Earthquakes Example](examples/earthquakes/README.md) — Complete Claude Desktop setup walkthrough
127
+ - [Integration Guide](docs/integrations.md) — Claude Desktop, OpenAI, mcp-cli, and custom integrations
128
+
129
+ ## 📚 Documentation
130
+
131
+ - [Overview](docs/overview.md) — Core concepts and architecture
132
+ - [Quickstart](docs/quickstart.md) — Get up and running
133
+ - [CLI Reference](docs/cli.md) — Command-line tools
134
+ - [Configuration](docs/configuration.md) — Project setup
135
+ - [Plugins](docs/plugins.md) — Extend DuckDB with custom Python functions
136
+ - [Authentication](docs/authentication.md) — OAuth authentication setup
137
+ - [Policy Enforcement](docs/policies.md) — Access control and data filtering
138
+ - [Audit Logging](docs/auditing.md) — Enterprise-grade execution logging
139
+ - [Type System](docs/type-system.md) — Data types and validation
140
+ - [Integrations](docs/integrations.md) — Data sources and tools
141
+ - [Drift Detection](docs/drift-detection.md) — Schema and endpoint change monitoring
142
+
143
+ ## 🤝 Contributing
144
+
145
+ We welcome contributions! See our [development guide](docs/dev-guide.md) to get started.
146
+
147
+ ## 🧠 About
148
+
149
+ MXCP is developed by RAW Labs, combining the best of:
150
+ - dbt's modular data modeling
151
+ - DuckDB's speed and connectors
152
+ - Python MCP official server
153
+ - Modern AI-native workflows
@@ -0,0 +1,77 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "mxcp"
7
+ version = "0.1.0"
8
+ description = "RAW Model Context Protocol"
9
+ authors = [{ name = "RAW Labs SA", email = "hello@raw-labs.com" }]
10
+ readme = "README.md"
11
+ license = { text = "Business Source License 1.1" }
12
+ requires-python = ">=3.9"
13
+ dependencies = [
14
+ "mcp>=1.9.0", # Official MCP Python SDK
15
+ "click>=8.1.7",
16
+ "pyyaml>=6.0.1",
17
+ "jsonschema",
18
+ "duckdb>=0.9.2",
19
+ "jinja2>=3.1.3",
20
+ "aiohttp>=3.8.0", # Required for MCP HTTP transport
21
+ "starlette>=0.27.0", # Required for MCP HTTP transport
22
+ "makefun",
23
+ "pandas>=2.0.0", # Required for DuckDB DataFrame operations
24
+ "posthog>=3.0.0", # For anonymous usage analytics
25
+ "dbt-core>=1.6.0", # dbt core for data transformations
26
+ "dbt-duckdb>=1.6.0", # dbt DuckDB adapter
27
+ "cel-python>=0.2.0" # Common Expression Language for policy enforcement
28
+ ]
29
+
30
+ [project.scripts]
31
+ mxcp = "mxcp.__main__:cli"
32
+
33
+ [project.optional-dependencies]
34
+ dev = [
35
+ "pytest",
36
+ "pytest-asyncio", # For testing async code
37
+ "pytest-cov", # For test coverage
38
+ "pytest-mock", # For better mock integration with pytest
39
+ "pytest-timeout", # For test timeout protection
40
+ "aioresponses", # For mocking HTTP requests
41
+ "black", # For code formatting
42
+ "isort", # For import sorting
43
+ "mypy", # For type checking
44
+ "hvac>=2.0.0", # For testing Vault integration
45
+ ]
46
+ vault = [
47
+ "hvac>=2.0.0", # HashiCorp Vault client for vault:// URL support
48
+ ]
49
+
50
+ [tool.setuptools]
51
+ package-dir = {"" = "src"}
52
+ packages = ["mxcp", "mxcp.audit", "mxcp.cli", "mxcp.config", "mxcp.config.schemas", "mxcp.server", "mxcp.auth", "mxcp.drift", "mxcp.endpoints", "mxcp.engine", "mxcp.plugins", "mxcp.policies"]
53
+ include-package-data = true
54
+
55
+ [tool.setuptools.package-data]
56
+ "mxcp.config.schemas" = ["*.json"]
57
+
58
+ [tool.pytest.ini_options]
59
+ testpaths = ["tests"]
60
+ python_files = ["test_*.py"]
61
+ addopts = "-v"
62
+ asyncio_mode = "auto" # Enable async test support
63
+
64
+ [tool.black]
65
+ line-length = 100
66
+ target-version = ["py39"]
67
+
68
+ [tool.isort]
69
+ profile = "black"
70
+ line_length = 100
71
+
72
+ [tool.mypy]
73
+ python_version = "3.9"
74
+ warn_return_any = true
75
+ warn_unused_configs = true
76
+ disallow_untyped_defs = true
77
+ disallow_incomplete_defs = true
mxcp-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,33 @@
1
+ import click
2
+ from mxcp.cli.list import list_endpoints
3
+ from mxcp.cli.run import run_endpoint
4
+ from mxcp.cli.validate import validate
5
+ from mxcp.cli.test import test
6
+ from mxcp.cli.serve import serve
7
+ from mxcp.cli.init import init
8
+ from mxcp.cli.query import query
9
+ from mxcp.cli.dbt import dbt_config, dbt_wrapper
10
+ from mxcp.config.analytics import initialize_analytics, track_base_command
11
+ from mxcp.cli.drift_snapshot import drift_snapshot
12
+ from mxcp.cli.drift_check import drift_check
13
+ from mxcp.cli.log import log
14
+
15
+ @click.group()
16
+ def cli():
17
+ """MXCP CLI"""
18
+ initialize_analytics()
19
+ # Track when user runs just 'mxcp' without any command
20
+ track_base_command()
21
+
22
+ cli.add_command(list_endpoints)
23
+ cli.add_command(run_endpoint)
24
+ cli.add_command(validate)
25
+ cli.add_command(test)
26
+ cli.add_command(serve)
27
+ cli.add_command(init)
28
+ cli.add_command(query)
29
+ cli.add_command(dbt_config)
30
+ cli.add_command(dbt_wrapper)
31
+ cli.add_command(drift_snapshot)
32
+ cli.add_command(drift_check)
33
+ cli.add_command(log)
@@ -0,0 +1,5 @@
1
+ """MXCP Audit Logging System - Enterprise-grade audit logging for tool, resource, and prompt executions."""
2
+
3
+ from .logger import AuditLogger, LogEvent
4
+
5
+ __all__ = ["AuditLogger", "LogEvent"]