mathematica_mcp 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.
@@ -0,0 +1,204 @@
1
+ language: en-US
2
+ tone_instructions: "Be concise and focus on critical issues only. Do not comment on trivial matters, nitpicks, or stylistic preferences. Only flag issues that could cause bugs, security vulnerabilities, or significant maintainability problems."
3
+ early_access: false
4
+ enable_free_tier: true
5
+ reviews:
6
+ profile: chill
7
+ request_changes_workflow: false
8
+ high_level_summary: true
9
+ high_level_summary_instructions: ""
10
+ high_level_summary_placeholder: "@coderabbitai summary"
11
+ high_level_summary_in_walkthrough: false
12
+ auto_title_placeholder: "@coderabbitai"
13
+ auto_title_instructions: ""
14
+ review_status: true
15
+ commit_status: true
16
+ fail_commit_status: false
17
+ collapse_walkthrough: false
18
+ changed_files_summary: true
19
+ sequence_diagrams: true
20
+ estimate_code_review_effort: true
21
+ assess_linked_issues: true
22
+ related_issues: true
23
+ related_prs: true
24
+ suggested_labels: true
25
+ labeling_instructions: []
26
+ auto_apply_labels: false
27
+ suggested_reviewers: true
28
+ auto_assign_reviewers: false
29
+ in_progress_fortune: true
30
+ poem: true
31
+ path_filters:
32
+ - "!uv.lock"
33
+ - "!coverage/**"
34
+ - "!dist/**"
35
+ - "!*.dot"
36
+ - "!**/__pycache__/**"
37
+ - "!.venv/**"
38
+ - "!node_modules/**"
39
+ path_instructions: []
40
+ abort_on_close: true
41
+ disable_cache: false
42
+ auto_review:
43
+ enabled: true
44
+ auto_incremental_review: true
45
+ ignore_title_keywords: []
46
+ labels: []
47
+ drafts: false
48
+ base_branches: []
49
+ ignore_usernames: []
50
+ finishing_touches:
51
+ docstrings:
52
+ enabled: true
53
+ unit_tests:
54
+ enabled: true
55
+ pre_merge_checks:
56
+ docstrings:
57
+ mode: warning
58
+ threshold: 80
59
+ title:
60
+ mode: warning
61
+ requirements: ""
62
+ description:
63
+ mode: warning
64
+ issue_assessment:
65
+ mode: warning
66
+ custom_checks: []
67
+ tools:
68
+ ast-grep:
69
+ rule_dirs: []
70
+ util_dirs: []
71
+ essential_rules: true
72
+ packages: []
73
+ shellcheck:
74
+ enabled: true
75
+ ruff:
76
+ enabled: true
77
+ markdownlint:
78
+ enabled: true
79
+ github-checks:
80
+ enabled: true
81
+ timeout_ms: 900000
82
+ languagetool:
83
+ enabled: true
84
+ enabled_rules: []
85
+ disabled_rules: []
86
+ enabled_categories: []
87
+ disabled_categories: []
88
+ enabled_only: false
89
+ level: default
90
+ biome:
91
+ enabled: false
92
+ hadolint:
93
+ enabled: false
94
+ swiftlint:
95
+ enabled: false
96
+ phpstan:
97
+ enabled: false
98
+ level: default
99
+ phpmd:
100
+ enabled: false
101
+ phpcs:
102
+ enabled: false
103
+ golangci-lint:
104
+ enabled: false
105
+ yamllint:
106
+ enabled: true
107
+ gitleaks:
108
+ enabled: true
109
+ checkov:
110
+ enabled: true
111
+ detekt:
112
+ enabled: false
113
+ eslint:
114
+ enabled: false
115
+ flake8:
116
+ enabled: false
117
+ rubocop:
118
+ enabled: false
119
+ buf:
120
+ enabled: false
121
+ regal:
122
+ enabled: false
123
+ actionlint:
124
+ enabled: true
125
+ pmd:
126
+ enabled: false
127
+ clang:
128
+ enabled: false
129
+ cppcheck:
130
+ enabled: false
131
+ semgrep:
132
+ enabled: true
133
+ circleci:
134
+ enabled: false
135
+ clippy:
136
+ enabled: false
137
+ sqlfluff:
138
+ enabled: false
139
+ prismaLint:
140
+ enabled: false
141
+ pylint:
142
+ enabled: true
143
+ oxc:
144
+ enabled: false
145
+ shopifyThemeCheck:
146
+ enabled: false
147
+ luacheck:
148
+ enabled: false
149
+ brakeman:
150
+ enabled: false
151
+ dotenvLint:
152
+ enabled: true
153
+ htmlhint:
154
+ enabled: false
155
+ checkmake:
156
+ enabled: false
157
+ osvScanner:
158
+ enabled: true
159
+ chat:
160
+ art: true
161
+ auto_reply: true
162
+ integrations:
163
+ jira:
164
+ usage: auto
165
+ linear:
166
+ usage: auto
167
+ knowledge_base:
168
+ opt_out: false
169
+ web_search:
170
+ enabled: true
171
+ code_guidelines:
172
+ enabled: true
173
+ filePatterns:
174
+ - ".cursor/rules/general.mdc"
175
+ - ".cursor/rules/python.mdc"
176
+ - ".cursor/rules/python-testing.mdc"
177
+ learnings:
178
+ scope: auto
179
+ issues:
180
+ scope: auto
181
+ jira:
182
+ usage: auto
183
+ project_keys: []
184
+ linear:
185
+ usage: auto
186
+ team_keys: []
187
+ pull_requests:
188
+ scope: auto
189
+ mcp:
190
+ usage: auto
191
+ disabled_servers: []
192
+ code_generation:
193
+ docstrings:
194
+ language: en-US
195
+ path_instructions:
196
+ - path: "src/**"
197
+ instructions: "Use Google-style docstrings with Args, Returns, and Raises sections. Include type information in the function signature, not the docstring."
198
+ unit_tests:
199
+ path_instructions: []
200
+ issue_enrichment:
201
+ auto_enrich:
202
+ enabled: true
203
+ planning:
204
+ enabled: true
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "pip" # uv and poetry use pip
9
+ directory: "/" # pyproject.toml is in the root directory
10
+ schedule:
11
+ interval: "weekly"
@@ -0,0 +1,80 @@
1
+ name: CI
2
+ on:
3
+ push
4
+ # pull_request:
5
+ # branches:
6
+ # - main
7
+ # push:
8
+ # branches:
9
+ # - main
10
+
11
+ permissions:
12
+ contents: read
13
+ packages: write
14
+
15
+ jobs:
16
+ ci:
17
+ strategy:
18
+ matrix:
19
+ python-version: ["3.12"]
20
+ uv-version: ["latest"]
21
+ # Only run CI on Linux. Windows and macOS cost 2x and 10x more respectively.
22
+ os: [ubuntu-latest]
23
+ # os: [ubuntu-latest, windows-latest, macos-latest]
24
+ fail-fast: false
25
+ runs-on: ${{ matrix.os }}
26
+ defaults:
27
+ run:
28
+ working-directory: .
29
+ steps:
30
+ - name: Checkout the repository
31
+ uses: actions/checkout@v4.2.0
32
+ - name: Free Disk Space on GitHub Actions runner
33
+ # Runners come with many preinstalled tools that we don't need for our build.
34
+ # This action removes them to free up disk space for the following steps, such as the heavy devcontainer build.
35
+ uses: jlumbroso/free-disk-space@v1.3.1
36
+ with:
37
+ tool-cache: false
38
+ android: true
39
+ dotnet: true
40
+ haskell: true
41
+ large-packages: true
42
+ docker-images: true
43
+ swap-storage: true
44
+ - name: Install uv package manager
45
+ uses: astral-sh/setup-uv@v5.2.2
46
+ with:
47
+ version: ${{ matrix.uv-version }}
48
+ enable-cache: true
49
+ - name: Check uv version
50
+ run: uv --version
51
+ - name: Install dependencies
52
+ run: uv sync
53
+ - name: Check installed dependencies
54
+ run: |
55
+ uv run python --version
56
+ uv tree
57
+ - name: Build the package
58
+ run: uv build
59
+ - name: Lint the package
60
+ run: uvx ruff check .
61
+ - name: Type check the package
62
+ run: uvx pyright .
63
+ - name: Run unit tests
64
+ # -v verbose
65
+ # -m "not paid" skip tests requiring paid API keys
66
+ # -p no:warnings ignore warnings
67
+ # -n auto run tests in parallel
68
+ run: uv run pytest -v -m "not paid" -p no:warnings -n auto --cov=mathematica_mcp --cov-report=xml
69
+ - name: Upload logs
70
+ uses: actions/upload-artifact@v4
71
+ if: always()
72
+ with:
73
+ name: mathematica_mcp-pytest-logs
74
+ path: mathematica_mcp.log
75
+ - name: Upload coverage to Codecov
76
+ uses: codecov/codecov-action@v4
77
+ with:
78
+ file: ./coverage.xml
79
+ fail_ci_if_error: false
80
+ token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,30 @@
1
+ # macOS
2
+ .DS_store
3
+
4
+ # Python
5
+ .venv/
6
+ __pycache__/
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ .ropeproject/
10
+ .env
11
+ .env.backup
12
+ *.log
13
+ .coverage
14
+ coverage*
15
+ *.dot
16
+ codeql-custom-queries-python/
17
+
18
+ # PydanticAI
19
+ examples/
20
+ node_modules/
21
+
22
+ # reports
23
+ reports/*.md
24
+ reports/*.pdf
25
+ tests/reports/*.md
26
+ tests/reports/*.pdf
27
+
28
+ # Coding agents
29
+ CLAUDE.local.md
30
+ .cursor/mcp.json
@@ -0,0 +1,38 @@
1
+ {
2
+ "recommendations": [
3
+ // Python
4
+ "nicohlr.pycharm",
5
+ "ms-python.python",
6
+ "anysphere.pyright", // language server pushed by Cursor
7
+ "ms-python.debugpy",
8
+ "charliermarsh.ruff",
9
+ "njpwerner.autodocstring",
10
+ "ms-python.vscode-pylance",
11
+ // yaml + toml
12
+ "redhat.vscode-yaml",
13
+ "tamasfe.even-better-toml",
14
+ // Bash
15
+ "timonwong.shellcheck",
16
+ "mkhl.shfmt",
17
+ // git + GitHub Actions
18
+ "ivanhofer.git-assistant",
19
+ "GitHub.vscode-github-actions",
20
+ "me-dutour-mathieu.vscode-github-actions",
21
+ "GitHub.vscode-pull-request-github",
22
+ // Copilot
23
+ "GitHub.copilot",
24
+ "GitHub.copilot-chat",
25
+ "ms-vscode.vscode-copilot-data-analysis",
26
+ "AutomataLabs.copilot-mcp",
27
+ "CodeRabbit.coderabbit-vscode",
28
+ // spell checker
29
+ "streetsidesoftware.code-spell-checker",
30
+ // logging
31
+ "berublan.vscode-log-viewer",
32
+ // mermaid
33
+ "bierner.markdown-mermaid",
34
+ ],
35
+ "unwantedRecommendations": [
36
+ "mechatroner.rainbow-csv",
37
+ ]
38
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "servers": {
3
+ "context7": {
4
+ "command": "npx",
5
+ "args": [
6
+ "-y",
7
+ "@upstash/context7-mcp@latest"
8
+ ],
9
+ "type": "stdio"
10
+ },
11
+ "github": {
12
+ "type": "http",
13
+ "url": "https://api.githubcopilot.com/mcp/"
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "python.defaultInterpreterPath": ".venv/bin/python",
3
+ "editor.formatOnSave": true,
4
+ "editor.inlineSuggest.enabled": true,
5
+ "python.languageServer": "Pylance",
6
+ "python.testing.unittestEnabled": false,
7
+ "python.testing.pytestEnabled": true,
8
+ "python.testing.cwd": "${workspaceFolder}",
9
+ "python.testing.autoTestDiscoverOnSaveEnabled": false,
10
+ "python.testing.pytestArgs": [
11
+ "-n",
12
+ "auto",
13
+ ],
14
+ "autoDocstring.docstringFormat": "google",
15
+ "[python]": {
16
+ "editor.tabSize": 4,
17
+ "editor.defaultFormatter": "charliermarsh.ruff",
18
+ },
19
+ "github.copilot.enable": {
20
+ "*": true,
21
+ "bash": true,
22
+ "yaml": true,
23
+ "toml": true,
24
+ "python": true,
25
+ "markdown": true,
26
+ "plaintext": false,
27
+ },
28
+ "chat.agent.enabled": true,
29
+ "cSpell.enabled": true,
30
+ "cSpell.allowCompoundWords": true,
31
+ "cSpell.language": "en",
32
+ "cSpell.ignorePaths": [
33
+ "**/*.json"
34
+ ],
35
+ "cSpell.words": [
36
+ "iloc",
37
+ "logit",
38
+ "pytest",
39
+ "pylint",
40
+ "Nilse",
41
+ "isort",
42
+ "pycodestyle",
43
+ "pyupgrade",
44
+ "kwargs",
45
+ "virtualenv",
46
+ "venv",
47
+ "pycache",
48
+ "pyproject",
49
+ "xdist",
50
+ "pydocstyle",
51
+ "pydantic",
52
+ "asyncio",
53
+ "pypandoc",
54
+ "isinstance",
55
+ "mcpserver",
56
+ "pyright",
57
+ "fastmcp",
58
+ "wolframscript",
59
+ "mathematica",
60
+ ],
61
+ "cSpell.languageSettings": [
62
+ {
63
+ "languageId": "python",
64
+ "enabled": true,
65
+ "includeRegExpList": [
66
+ "Python Docstrings"
67
+ ],
68
+ "patterns": [
69
+ {
70
+ "name": "Python Docstrings",
71
+ "pattern": "^\\s*(\"\"\")[^\"\"\"]*(\"\"\")"
72
+ }
73
+ ]
74
+ }
75
+ ],
76
+ "shellcheck.ignorePatterns": {
77
+ "**/.env.example": true,
78
+ "**/.env": true,
79
+ },
80
+ "logViewer.watch": [
81
+ {
82
+ "title": "mathematica_mcp",
83
+ "pattern": "mathematica_mcp.log"
84
+ },
85
+ ],
86
+ }
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Lars Nilse 2025 to present
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,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: mathematica_mcp
3
+ Version: 0.1.0
4
+ Summary: MCP server for WolframScript
5
+ Author-email: Lars Nilse <l.nilse@dunelm.org.uk>
6
+ License-File: LICENSE
7
+ Requires-Python: <3.13,>=3.12
8
+ Requires-Dist: fastmcp>=2.13.0.1
9
+ Requires-Dist: loguru>=0.7.3
10
+ Requires-Dist: pydantic-settings>=2.8.1
11
+ Requires-Dist: pydantic>=2.10.6
12
+ Requires-Dist: pylint>=3.3.4
13
+ Requires-Dist: pyright>=1.1.404
14
+ Requires-Dist: pytest-asyncio>=0.25.3
15
+ Requires-Dist: pytest-cov>=6.0.0
16
+ Requires-Dist: pytest-mock>=3.15.1
17
+ Requires-Dist: pytest-xdist>=3.6.1
18
+ Requires-Dist: pytest>=8.3.4
19
+ Requires-Dist: ruff>=0.9.5
20
+ Description-Content-Type: text/markdown
21
+
22
+ # mathematica_mcp
@@ -0,0 +1 @@
1
+ # mathematica_mcp
@@ -0,0 +1,121 @@
1
+ [project]
2
+ name = "mathematica_mcp"
3
+ version = "0.1.0"
4
+ description = "MCP server for WolframScript"
5
+ readme = "README.md"
6
+ authors = [{ name = "Lars Nilse", email = "l.nilse@dunelm.org.uk" }]
7
+ requires-python = ">=3.12,<3.13"
8
+ dependencies = [
9
+ "loguru>=0.7.3",
10
+ "pytest>=8.3.4",
11
+ "ruff>=0.9.5",
12
+ "pylint>=3.3.4",
13
+ "pytest-xdist>=3.6.1",
14
+ "pytest-cov>=6.0.0",
15
+ "pydantic>=2.10.6",
16
+ "pytest-asyncio>=0.25.3",
17
+ "pydantic-settings>=2.8.1",
18
+ "pyright>=1.1.404",
19
+ "pytest-mock>=3.15.1",
20
+ "fastmcp>=2.13.0.1",
21
+ ]
22
+
23
+ [project.scripts]
24
+ wolframscript_server = "mathematica_mcp.server:wolframscript_server"
25
+
26
+ [tool.ruff]
27
+ line-length = 150
28
+ lint.select = [
29
+ "E", # pycodestyle
30
+ "F", # pyflakes
31
+ "I", # isort
32
+ "TID", # tidy imports
33
+ "UP", # pyupgrade
34
+ "C4", # comprehensions
35
+ "SIM", # simplifications
36
+ "PD", # pandas-specific rules
37
+ "NPY", # numpy-specific rules
38
+ "PL", # pylint
39
+ "B", # bugbear
40
+ "ANN", # type annotations
41
+ "TC", # type checking
42
+ ]
43
+ lint.ignore = [
44
+ "SIM108", # Ignore ternary operators rule i.e. allow if-else blocks
45
+ "PLR2004", # Allow magic values
46
+ "PLR0915", # Allow long functions
47
+ "PLR0912", # Allow many branches
48
+ "PLR0913", # Allow many arguments
49
+ "TC006", # Allow type casting without strings
50
+ ]
51
+ lint.pydocstyle.convention = "google"
52
+
53
+ [tool.pyright]
54
+ # Core Settings
55
+ typeCheckingMode = "basic" # next step: "standard"
56
+ pythonVersion = "3.12"
57
+ venvPath = "."
58
+ venv = ".venv"
59
+ # Paths
60
+ include = ["src", "tests"]
61
+ exclude = [
62
+ ".git",
63
+ ".venv",
64
+ "dist",
65
+ "uml",
66
+ "**/__pycache__",
67
+ ]
68
+ strict = [] # If you really really want strict checking for parts of the code
69
+ # High-value Rules
70
+ reportOptionalMemberAccess = "error"
71
+ reportOptionalSubscript = "error"
72
+ reportOptionalCall = "error"
73
+ reportGeneralTypeIssues = "error"
74
+ reportReturnType = "error"
75
+ # Grey Area
76
+ reportAttributeAccessIssue = "warning"
77
+ # Noisy Rules
78
+ reportUnknownParameterType = false
79
+ reportUnknownVariableType = false
80
+ reportMissingParameterType = false
81
+ reportMissingTypeStubs = false
82
+ reportPrivateUsage = false
83
+
84
+ [tool.pytest.ini_options]
85
+ addopts = ["-m", "not paid"] # Skip tests that require a paid API key
86
+ asyncio_default_fixture_loop_scope = "function" # Use "session" for a single event loop for all tests or "function" for a new event loop for every test (more isolation).
87
+ markers = [
88
+ "wolframscript: tests requiring a local WolframScript installation",
89
+ ]
90
+
91
+ [tool.coverage.run]
92
+ branch = true
93
+ source = ["mathematica_mcp"]
94
+ parallel = true
95
+ disable_warnings = ["module-not-measured"]
96
+ omit = [
97
+ "tests/*",
98
+ "src/mathematica_mcp/server.py",
99
+ ]
100
+
101
+ [tool.coverage.report]
102
+ show_missing = true # Show line numbers of missing coverage in terminal
103
+ skip_covered = false # Show all files, including those with full coverage
104
+ skip_empty = true # Skip files with no statements
105
+ precision = 1 # Show coverage to 1 decimal place
106
+ exclude_lines = [
107
+ "pragma: no cover", # Don't count lines marked to be excluded
108
+ "raise NotImplementedError", # Don't count abstract methods
109
+ "if __name__ == .__main__.:", # Don't count main entry points
110
+ "if TYPE_CHECKING:", # Don't count type checking blocks
111
+ ]
112
+
113
+ [tool.coverage.html]
114
+ directory = "coverage"
115
+
116
+ [build-system]
117
+ requires = ["hatchling"]
118
+ build-backend = "hatchling.build"
119
+
120
+ [tool.hatch.build.targets.wheel]
121
+ packages = ["src/mathematica_mcp"]
@@ -0,0 +1,3 @@
1
+ """mathematica_mcp public interface"""
2
+
3
+ __all__ = []
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env python3
2
+
3
+ from loguru import logger
4
+
5
+ __all__ = ["logger"]
6
+
7
+ # Configure Loguru
8
+ logger.remove(0) # Remove default console logger
9
+ logger.add(
10
+ __name__.split(".")[0] + ".log",
11
+ rotation="500 MB",
12
+ level="DEBUG",
13
+ )