PythonParts Local MCP Server
An MCP server that exposes the local ALLPLAN Python runtime to AI coding assistants. It is started once per ALLPLAN version and gives any MCP-compatible agent accurate, live information about the interpreter, import paths, installed packages, and type correctness — without guessing or hallucinating.
Transport: stdio (spawned as a subprocess by the MCP client).
Protocol: Model Context Protocol via FastMCP.
Release history: CHANGELOG.md.
Prerequisites
-
uv — Python package manager used to run the server without a manual install step.
winget install astral-sh.uv
Attaching to your AI agent
Add the following entry to your MCP configuration:
"pythonparts-local-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"--index", "https://test.pypi.org/simple",
"--index-strategy", "unsafe-best-match",
"pythonparts-mcp",
"--allplan-version", "2026",
"--std-path", "X:\\Path\\To\\Allplan\\Std",
"--usr-path", "X:\\Path\\To\\Allplan\\Usr\\Local"
]
}
Arguments:
| Argument | Description | Example |
|---|---|---|
--allplan-version |
Installed ALLPLAN version | 2026 |
--std-path |
Path to ALLPLAN's Std directory |
C:\Data\Allplan\Allplan 2026\Std |
--usr-path |
Path to ALLPLAN's user directory. Located under Usr\<username> or Usr\Local depending on your ALLPLAN configuration. |
C:\Users\Jane\Nemetschek\Allplan\2026\Usr\Local |
The prg and etc paths are resolved automatically from the Windows registry.
Available Tools
get_allplan_info()
Returns the installed ALLPLAN version string and the four resolved file-system paths (prg, etc, std, usr). No input required.
{
"ok": true,
"data": {
"version": "2026.0.0",
"paths": {
"prg": "C:\\Program Files\\Allplan\\Allplan 2026\\Prg",
"etc": "C:\\ProgramData\\Nemetschek\\Allplan\\2026\\etc",
"std": "X:\\Path\\To\\Allplan\\Std",
"usr": "X:\\Path\\To\\Allplan\\Usr\\Local"
}
}
}
get_python_env_info()
Returns the path to the ALLPLAN-embedded Python interpreter, its version, and the ordered sys.path ALLPLAN uses when executing PythonParts scripts. No input required.
{
"ok": true,
"data": {
"interpreter_path": "C:\\...\\Prg\\Python\\python.exe",
"python_version": "3.11.9",
"sys_path": ["C:\\...\\Prg\\Python", "..."]
}
}
list_site_packages()
Lists all Python packages installed in the ALLPLAN-embedded Python environment, deduplicated and sorted alphabetically. No input required.
{
"ok": true,
"data": [
{"name": "requests", "version": "2.31.0"},
{"name": "shapely", "version": null}
]
}
typecheck_file(file_path: str)
Type-checks a .py file against the ALLPLAN runtime using Pyright. Input: absolute path to the file.
{
"ok": true,
"data": {
"error_count": 2,
"warning_count": 0,
"diagnostics": [
{
"severity": "error",
"message": "...",
"file": "C:\\...\\main.py",
"line": 12,
"column": 5,
"rule": "reportMissingImports"
}
]
}
}
inspect_symbol(symbol: str)
Inspects a Python symbol in the live ALLPLAN runtime — returns its category, signature, docstring, and public members. Use this to verify a symbol exists and discover its API before writing code against it.
Input: dotted Python path to the symbol.
{
"ok": true,
"data": {
"symbol": "NemAll_Python_Geometry.Point3D",
"category": "class",
"module": "NemAll_Python_Geometry",
"docstring": "...",
"signature": null,
"members": ["X", "Y", "Z", "..."]
}
}
run_snippet_in_sandbox(code: str)
Runs a Python snippet against the ALLPLAN libraries in a separate process, outside ALLPLAN, and returns its print() output. ALLPLAN does not need to be running, and the snippet cannot touch the open drawing or project data. This is the tool to reach for when verifying geometry math or API behaviour.
The ALLPLAN interface modules are pre-imported as globals (AllplanGeometry, AllplanBasisElements, …). There is no document and no coordinate input, so document and coord_input are not available — anything that needs the open drawing, the project or user settings will fail or return a meaningless value.
Globals do not persist between calls, so each snippet must be self-contained. The first call spends a second or two loading the ALLPLAN DLLs; the process is then reused. Snippets are abandoned after 60 seconds.
Snippets must not show a user interface — AllplanUtility.ShowMessageBox, file dialogs and the like. There is no ALLPLAN window to host them, so the call never returns and the snippet runs into the timeout.
{
"ok": true,
"data": {
"output": "(30000.0, NemAll_Python_Geometry.eServiceResult.POSITIVE_ORIENTATION)\n"
}
}
Metadata
Release files for pythonparts-mcp 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pythonparts_mcp-0.2.0.tar.gz | 30.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pythonparts_mcp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 60.5 kB
Release files / pythonparts_mcp-0.2.0.tar.gz
| Download URL | pythonparts_mcp-0.2.0.tar.gz |
|---|---|
| Size | 30.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f81e2e4a14030f382b50efb9945ca1a1cb7bb38498f36ae51f962ae8abdda02e
|
|
BLAKE2b-256 checksum How to use checksums |
6bb38d59b584894b2beaaee63ee405d4b18482e8bfbce3696d5dc2f1ebdea24e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / pythonparts_mcp-0.2.0-py3-none-any.whl
| Download URL | pythonparts_mcp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 30.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d22c803002295c1c8c5087cdb095b3606d41c031e1c90251d688924dbf75a835
|
|
BLAKE2b-256 checksum How to use checksums |
afbaa99079672d4597bed8ea71f91751e2e44eb169bdd10cf6327be9fc35faed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|