Skip to content

Commit 9f74c33

Browse files
committed
cocalc-api: MCP server stub
1 parent f4a36b7 commit 9f74c33

File tree

14 files changed

+1754
-442
lines changed

14 files changed

+1754
-442
lines changed
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
{
2-
"python.defaultInterpreterPath": "./.venv/bin/python",
2+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
3+
"python.linting.enabled": true,
34
"python.analysis.extraPaths": ["./src"],
45
"python.analysis.autoSearchPaths": true,
56
"python.analysis.autoImportCompletions": true,
6-
"pylance.insidersChannel": "off"
7+
"python.analysis.typeCheckingMode": "basic",
8+
"[python]": {
9+
"editor.defaultFormatter": "charliermarsh.ruff",
10+
"editor.formatOnSave": true
11+
},
12+
"pylance.insidersChannel": "off",
13+
"python.venvFolderPath": ".venv"
714
}

src/python/cocalc-api/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ help:
1111
@echo " coverage - Run tests with coverage reporting (HTML + terminal)"
1212
@echo " coverage-report - Show coverage report in terminal"
1313
@echo " coverage-html - Generate HTML coverage report only"
14+
@echo " mcp - Start the MCP server (requires COCALC_API_KEY and COCALC_PROJECT_ID)"
1415
@echo " serve-docs - Serve documentation locally"
1516
@echo " build-docs - Build documentation"
1617
@echo " publish - Build and publish package"
@@ -47,6 +48,9 @@ coverage-report:
4748
coverage-html:
4849
uv run coverage html
4950

51+
mcp:
52+
uv run cocalc-mcp-server
53+
5054
serve-docs:
5155
uv run mkdocs serve
5256

src/python/cocalc-api/pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ version = "0.5.0"
44
description = "Python client for the CoCalc API"
55
authors = [{ name="William Stein", email="[email protected]" }, {name="Harald Schilly", email="[email protected]"}]
66
readme = "README.md"
7-
requires-python = ">=3.9"
8-
dependencies = ["httpx"]
7+
requires-python = ">=3.10"
8+
dependencies = ["httpx", "mcp>=0.1.0"]
99
license = "MIT"
1010

1111
[tool.hatch.build.targets.wheel]
@@ -19,6 +19,9 @@ Documentation = "https://cocalc.com/api/python"
1919
Source = "https://github.com/sagemathinc/cocalc/src/python/cocalc-api"
2020
Issues = "https://github.com/sagemathinc/cocalc/issues"
2121

22+
[project.scripts]
23+
cocalc-mcp-server = "cocalc_api.mcp.server:main"
24+
2225
[tool.mypy]
2326
python_version = "3.13"
2427
# strict = true

0 commit comments

Comments
 (0)