civilpy.mcp package

Model Context Protocol servers shipped with civilpy.

civilpy.mcp.pw_server module

MCP server for the ODOT ProjectWise navigator.

Exposes the full-tree project model — classified document queries, pw:// branch resources, tier-2 completion checks, review-round summaries — so an assistant can ask “the geotech report”, “the Stage 2 comments”, “is this project missing anything for Stage 3?” without any path knowledge. Addresses are the classified pw:// scheme from pw_project, so folder renames and consultant-parallel folders never change an answer.

Backends

  • SnapshotStore — the committed crawler recon JSONs (district_file_samples.json, closed_tree_samples.json). Works on any machine; document content is not available.

  • LiveStore — the live datasource through the ProjectWise SDK (Windows + logged-in ProjectWise Explorer). Projects resolve through an explicit {pid: path} map (e.g. built from the crawler’s pw_folder_index.json) or the canonical active-projects template.

Running

pip install civilpy[mcp] then:

civilpy-pw-mcp                     # snapshot mode
CIVILPY_PW_SNAPSHOT=/path/to/crawler_output civilpy-pw-mcp

The core functions (list_projects()project_checklist()) are plain Python over a store — usable and testable without the mcp package installed; only build_server()/main() require it.

class civilpy.mcp.pw_server.LiveStore(path_map=None, datasource=None)[source]

Bases: object

Projects resolved on the live datasource.

path_map is {pid: full folder path} — build it from the crawler’s pw_folder_index.json / co_pw_availability.csv so closed/sold/additional-root projects resolve too. Without a map entry the store falls back to the active-projects template, which needs district and county kwargs on get().

classmethod from_availability(availability_csv)[source]
get(pid, district=None, county=None)[source]
pids()[source]
class civilpy.mcp.pw_server.SnapshotStore(snapshot_dir, datasource=None)[source]

Bases: object

Projects from the committed recon JSONs (see pw_snapshot).

get(pid)[source]
pids()[source]
civilpy.mcp.pw_server.build_server(store)[source]

A FastMCP server over store (requires pip install civilpy[mcp]).

civilpy.mcp.pw_server.describe_project(store, pid)[source]

Branch map of one project: the pw:// resources under it with document counts.

civilpy.mcp.pw_server.list_projects(store)[source]

The PIDs the store can serve.

civilpy.mcp.pw_server.main()[source]

Console entry point (civilpy-pw-mcp).

CIVILPY_PW_SNAPSHOT selects snapshot mode (a directory holding the crawler JSONs); CIVILPY_PW_PATHS (a json {pid: path} file) selects live mode with that path map.

civilpy.mcp.pw_server.project_checklist(store, pid, stage=None)[source]

Tier-2 completion/absence findings for one project. With a stage ("sts", 1, 2, 3) the stage’s submittal-package deliverables (from the ODOT review checklists) are appended.

civilpy.mcp.pw_server.query_documents(store, resource=None, pid=None, series=None, discipline=None, sfn=None, kind=None, stage=None, pattern=None, limit=200)[source]

Classified document query — by pw:// resource or by filters.

civilpy.mcp.pw_server.review_summary(store, pid)[source]

Review rounds and whether each round’s comments were addressed.

Module contents

civilpy’s Model Context Protocol servers.

civilpy.mcp.pw_server exposes the ODOT ProjectWise navigator (project trees, classified document queries, completion checks, review summaries) as MCP tools + pw:// resources, over either the live datasource (on-box) or committed recon snapshots (anywhere).

The mcp SDK is an optional dependency: pip install civilpy[mcp]. Everything except the server loop itself works without it.