fachwerk-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.
- fachwerk_mcp-0.1.0/.gitignore +143 -0
- fachwerk_mcp-0.1.0/.readthedocs.yaml +16 -0
- fachwerk_mcp-0.1.0/CHANGELOG.md +46 -0
- fachwerk_mcp-0.1.0/LICENSE +21 -0
- fachwerk_mcp-0.1.0/PKG-INFO +236 -0
- fachwerk_mcp-0.1.0/README.md +196 -0
- fachwerk_mcp-0.1.0/SECURITY.md +27 -0
- fachwerk_mcp-0.1.0/docs/_static/architecture.svg +56 -0
- fachwerk_mcp-0.1.0/docs/_static/chain.svg +74 -0
- fachwerk_mcp-0.1.0/docs/_static/demo.svg +40 -0
- fachwerk_mcp-0.1.0/docs/_static/icon.svg +28 -0
- fachwerk_mcp-0.1.0/docs/_static/write-gate.svg +46 -0
- fachwerk_mcp-0.1.0/docs/architecture.md +14 -0
- fachwerk_mcp-0.1.0/docs/conf.py +48 -0
- fachwerk_mcp-0.1.0/docs/gate.md +62 -0
- fachwerk_mcp-0.1.0/docs/index.md +25 -0
- fachwerk_mcp-0.1.0/docs/projects.md +26 -0
- fachwerk_mcp-0.1.0/docs/python.md +15 -0
- fachwerk_mcp-0.1.0/docs/quickstart.md +77 -0
- fachwerk_mcp-0.1.0/docs/security.md +15 -0
- fachwerk_mcp-0.1.0/docs/tools.md +54 -0
- fachwerk_mcp-0.1.0/docs/write-gate.md +115 -0
- fachwerk_mcp-0.1.0/pyproject.toml +230 -0
- fachwerk_mcp-0.1.0/scripts/make_images.py +228 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/__init__.py +4 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/__main__.py +9 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/access.py +104 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/auth.py +171 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/calls/__init__.py +2 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/calls/log.py +303 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/calls/monitor.py +91 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/calls/toolbase.py +118 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/cli.py +310 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/clients/__init__.py +2 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/clients/config_lines.py +237 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/clients/hook_template.py +78 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/__init__.py +2 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/abort.py +122 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/adapter_base.py +219 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/adapters.py +466 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/baseline.py +351 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/baseline_report.py +169 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/chain.py +847 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/chain_adapters.py +512 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/chain_run.py +199 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/data/recommended/policy.toml +113 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/env.py +305 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/gate.py +996 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/gate_baseline.py +216 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/gate_profile.py +468 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/gate_removals.py +121 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/gate_verdict.py +210 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/grep.py +252 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/impl.py +183 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/import_edits.py +146 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/index.py +714 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/insert.py +41 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/libs.py +283 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/memory.py +213 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/move.py +264 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/patch.py +345 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/profiles.py +151 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/project_settings.py +331 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/pyast.py +442 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/recommended.py +344 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/refs.py +367 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/regex_edit.py +119 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/rename.py +200 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/replace.py +144 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/search.py +299 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/symcache.py +82 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/testing.py +213 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/__init__.py +45 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/base.py +390 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/batch.py +285 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/constants.py +144 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/deleting.py +323 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/file_edits.py +688 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/files.py +226 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/git_tools.py +296 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/helpers.py +487 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/lsp_tools.py +537 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/moving.py +253 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/notes.py +45 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/overview.py +757 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/plans.py +29 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/references.py +303 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/renaming.py +454 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/running.py +251 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/search_tools.py +379 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/surface.py +300 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolbox/writing.py +573 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/toolconfig.py +184 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/code/workers.py +455 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/compact.py +59 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/concurrency.py +59 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/__init__.py +5 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/adapters.py +172 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/client.py +864 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/config.py +299 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/convert.py +528 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/framing.py +102 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/freshness.py +237 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/hub.py +273 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/interpreter.py +69 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/models.py +227 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/operations.py +636 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/policy.py +258 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/positions.py +147 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/process.py +572 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/lsp/suppress.py +107 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/projectconfig/__init__.py +7 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/projectconfig/commands.py +303 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/projectconfig/effective.py +369 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/projectconfig/first_use.py +199 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/projectconfig/keys.py +286 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/projectconfig/proposals.py +204 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/projectconfig/service.py +286 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/projectconfig/store.py +231 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/projects/__init__.py +5 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/projects/git.py +46 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/projects/paths.py +70 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/projects/registry.py +111 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/py.typed +0 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/resources/__init__.py +2 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/sandbox/__init__.py +2 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/sandbox/access.py +352 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/sandbox/bwrap.py +482 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/sandbox/config.py +473 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/sandbox/credentials.py +74 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/sandbox/interpreter.py +113 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/sandbox/runner.py +175 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/server.py +85 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/settings.py +133 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/state.py +31 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/storage/__init__.py +5 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/storage/audit.py +88 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/storage/dirs.py +81 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/storage/toml_writer.py +59 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/toolsets/__init__.py +2 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/toolsets/base.py +85 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/toolsets/code/__init__.py +25 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/toolsets/code/catalog.py +142 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/toolsets/code/config_tools.py +457 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/toolsets/code/extras.py +185 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/toolsets/code/health.py +231 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/toolsets/code/manual.py +112 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/toolsets/code/outside.py +138 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/toolsets/code/registration.py +118 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/toolsets/code/runtime.py +517 -0
- fachwerk_mcp-0.1.0/src/fachwerk_mcp/toolsets/code/status.py +217 -0
- fachwerk_mcp-0.1.0/tests/__init__.py +2 -0
- fachwerk_mcp-0.1.0/tests/calls/__init__.py +2 -0
- fachwerk_mcp-0.1.0/tests/calls/test_log.py +277 -0
- fachwerk_mcp-0.1.0/tests/calls/test_monitor.py +59 -0
- fachwerk_mcp-0.1.0/tests/calls/test_report.py +123 -0
- fachwerk_mcp-0.1.0/tests/calls/test_toolbase.py +120 -0
- fachwerk_mcp-0.1.0/tests/clients/__init__.py +2 -0
- fachwerk_mcp-0.1.0/tests/clients/test_config_lines.py +134 -0
- fachwerk_mcp-0.1.0/tests/clients/test_hook_template.py +80 -0
- fachwerk_mcp-0.1.0/tests/code/__init__.py +2 -0
- fachwerk_mcp-0.1.0/tests/code/gate_support.py +124 -0
- fachwerk_mcp-0.1.0/tests/code/miniproject.py +179 -0
- fachwerk_mcp-0.1.0/tests/code/test_abort.py +153 -0
- fachwerk_mcp-0.1.0/tests/code/test_adapters.py +371 -0
- fachwerk_mcp-0.1.0/tests/code/test_baseline.py +485 -0
- fachwerk_mcp-0.1.0/tests/code/test_chain.py +286 -0
- fachwerk_mcp-0.1.0/tests/code/test_env.py +299 -0
- fachwerk_mcp-0.1.0/tests/code/test_gate.py +877 -0
- fachwerk_mcp-0.1.0/tests/code/test_gate_lsp.py +183 -0
- fachwerk_mcp-0.1.0/tests/code/test_gate_tools.py +297 -0
- fachwerk_mcp-0.1.0/tests/code/test_grep.py +240 -0
- fachwerk_mcp-0.1.0/tests/code/test_impl.py +193 -0
- fachwerk_mcp-0.1.0/tests/code/test_import_edits.py +187 -0
- fachwerk_mcp-0.1.0/tests/code/test_index.py +799 -0
- fachwerk_mcp-0.1.0/tests/code/test_insert.py +104 -0
- fachwerk_mcp-0.1.0/tests/code/test_libs.py +334 -0
- fachwerk_mcp-0.1.0/tests/code/test_memory.py +228 -0
- fachwerk_mcp-0.1.0/tests/code/test_move.py +265 -0
- fachwerk_mcp-0.1.0/tests/code/test_patch.py +262 -0
- fachwerk_mcp-0.1.0/tests/code/test_profiles.py +102 -0
- fachwerk_mcp-0.1.0/tests/code/test_project_settings.py +190 -0
- fachwerk_mcp-0.1.0/tests/code/test_pyast.py +487 -0
- fachwerk_mcp-0.1.0/tests/code/test_refs.py +304 -0
- fachwerk_mcp-0.1.0/tests/code/test_regex_edit.py +189 -0
- fachwerk_mcp-0.1.0/tests/code/test_rename.py +458 -0
- fachwerk_mcp-0.1.0/tests/code/test_replace.py +184 -0
- fachwerk_mcp-0.1.0/tests/code/test_search.py +265 -0
- fachwerk_mcp-0.1.0/tests/code/test_symcache.py +88 -0
- fachwerk_mcp-0.1.0/tests/code/test_testing.py +213 -0
- fachwerk_mcp-0.1.0/tests/code/test_toolconfig.py +178 -0
- fachwerk_mcp-0.1.0/tests/code/test_workers.py +424 -0
- fachwerk_mcp-0.1.0/tests/conformance/__init__.py +6 -0
- fachwerk_mcp-0.1.0/tests/conformance/__main__.py +178 -0
- fachwerk_mcp-0.1.0/tests/conformance/differential.py +391 -0
- fachwerk_mcp-0.1.0/tests/conformance/legacy.py +76 -0
- fachwerk_mcp-0.1.0/tests/conformance/mutations.py +456 -0
- fachwerk_mcp-0.1.0/tests/conformance/pairs.py +87 -0
- fachwerk_mcp-0.1.0/tests/conformance/test_fixture.py +68 -0
- fachwerk_mcp-0.1.0/tests/conformance/truth.py +214 -0
- fachwerk_mcp-0.1.0/tests/conftest.py +45 -0
- fachwerk_mcp-0.1.0/tests/fixtures/.keep +0 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/blog/__init__.py +0 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/blog/models.py +48 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/blog/services.py +25 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/blog/templates/blog/list.html +3 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/blog/test_services.py +8 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/blog/urls.py +10 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/blog/views.py +19 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/docs/CHANGELOG.md +81 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/manage.py +16 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/pyproject.toml +13 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/shop/__init__.py +0 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/shop/settings.py +7 -0
- fachwerk_mcp-0.1.0/tests/fixtures/codeproj/shop/urls.py +7 -0
- fachwerk_mcp-0.1.0/tests/fixtures/conformance_project/pkg/__init__.py +1 -0
- fachwerk_mcp-0.1.0/tests/fixtures/conformance_project/pkg/core.py +13 -0
- fachwerk_mcp-0.1.0/tests/fixtures/conformance_project/pkg/tricky.py +38 -0
- fachwerk_mcp-0.1.0/tests/fixtures/conformance_project/pyproject.toml +45 -0
- fachwerk_mcp-0.1.0/tests/fixtures/conformance_project/tests/__init__.py +0 -0
- fachwerk_mcp-0.1.0/tests/fixtures/conformance_project/tests/test_core.py +11 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/django_site/config/__init__.py +1 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/django_site/config/settings.py +29 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/django_site/config/urls.py +7 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/django_site/manage.py +16 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/django_site/shop/__init__.py +1 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/django_site/shop/models.py +34 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/django_site/shop/templates/shop/product_list.html +6 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/django_site/shop/urls.py +8 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/django_site/shop/views.py +12 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/monorepo/libs/util/pyproject.toml +3 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/monorepo/libs/util/util/__init__.py +1 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/monorepo/libs/util/util/text.py +6 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/monorepo/services/api/api/__init__.py +1 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/monorepo/services/api/api/handlers.py +8 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/monorepo/services/api/pyproject.toml +4 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/namespace/pkg_a/ns/alpha.py +6 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/namespace/pkg_b/ns/beta.py +6 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/scripts/backup.py +15 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/scripts/report.py +17 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/srclib/pyproject.toml +10 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/srclib/src/mathlib/__init__.py +5 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/srclib/src/mathlib/core.py +11 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/srclib/tests/test_core.py +13 -0
- fachwerk_mcp-0.1.0/tests/fixtures/corpus/syntax/constructs.py +158 -0
- fachwerk_mcp-0.1.0/tests/fixtures/crash_worker.py +23 -0
- fachwerk_mcp-0.1.0/tests/fixtures/fake_lsp_agent.py +155 -0
- fachwerk_mcp-0.1.0/tests/fixtures/fake_lsp_server.py +266 -0
- fachwerk_mcp-0.1.0/tests/fixtures/fake_ty_server.py +542 -0
- fachwerk_mcp-0.1.0/tests/lsp/__init__.py +2 -0
- fachwerk_mcp-0.1.0/tests/lsp/support.py +150 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_adapters.py +245 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_client.py +592 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_config.py +291 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_framing.py +72 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_freshness.py +156 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_hub.py +294 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_interpreter.py +103 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_operations.py +271 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_policy.py +185 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_positions.py +104 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_process.py +386 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_real_servers.py +424 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_servers.py +100 -0
- fachwerk_mcp-0.1.0/tests/lsp/test_suppress.py +137 -0
- fachwerk_mcp-0.1.0/tests/projectconfig/__init__.py +2 -0
- fachwerk_mcp-0.1.0/tests/projectconfig/test_audit.py +49 -0
- fachwerk_mcp-0.1.0/tests/projectconfig/test_effective.py +229 -0
- fachwerk_mcp-0.1.0/tests/projectconfig/test_first_use_and_commands.py +322 -0
- fachwerk_mcp-0.1.0/tests/projectconfig/test_keys.py +164 -0
- fachwerk_mcp-0.1.0/tests/projectconfig/test_proposals_and_service.py +263 -0
- fachwerk_mcp-0.1.0/tests/projectconfig/test_store.py +145 -0
- fachwerk_mcp-0.1.0/tests/sandbox/__init__.py +2 -0
- fachwerk_mcp-0.1.0/tests/sandbox/support.py +136 -0
- fachwerk_mcp-0.1.0/tests/sandbox/test_access.py +276 -0
- fachwerk_mcp-0.1.0/tests/sandbox/test_bwrap.py +548 -0
- fachwerk_mcp-0.1.0/tests/sandbox/test_config.py +287 -0
- fachwerk_mcp-0.1.0/tests/sandbox/test_credentials.py +136 -0
- fachwerk_mcp-0.1.0/tests/sandbox/test_interpreter.py +428 -0
- fachwerk_mcp-0.1.0/tests/sandbox/test_runner.py +258 -0
- fachwerk_mcp-0.1.0/tests/support/__init__.py +2 -0
- fachwerk_mcp-0.1.0/tests/support/projects.py +76 -0
- fachwerk_mcp-0.1.0/tests/support/sources.py +287 -0
- fachwerk_mcp-0.1.0/tests/test_auth.py +68 -0
- fachwerk_mcp-0.1.0/tests/test_cli.py +203 -0
- fachwerk_mcp-0.1.0/tests/test_compact.py +76 -0
- fachwerk_mcp-0.1.0/tests/test_concurrency.py +54 -0
- fachwerk_mcp-0.1.0/tests/test_metadata.py +49 -0
- fachwerk_mcp-0.1.0/tests/test_paths.py +58 -0
- fachwerk_mcp-0.1.0/tests/test_registry.py +120 -0
- fachwerk_mcp-0.1.0/tests/test_server.py +114 -0
- fachwerk_mcp-0.1.0/tests/test_settings.py +129 -0
- fachwerk_mcp-0.1.0/tests/test_state.py +29 -0
- fachwerk_mcp-0.1.0/tests/test_transports.py +169 -0
- fachwerk_mcp-0.1.0/tests/toolbox/__init__.py +2 -0
- fachwerk_mcp-0.1.0/tests/toolbox/support_file_edits.py +345 -0
- fachwerk_mcp-0.1.0/tests/toolbox/support_lsp.py +39 -0
- fachwerk_mcp-0.1.0/tests/toolbox/support_reading.py +109 -0
- fachwerk_mcp-0.1.0/tests/toolbox/support_repo_tools.py +279 -0
- fachwerk_mcp-0.1.0/tests/toolbox/support_writing.py +229 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_base.py +402 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_batch.py +827 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_composition.py +53 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_deleting.py +309 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_file_edits.py +564 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_files.py +368 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_git_tools.py +272 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_helpers.py +525 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_lsp_tools.py +503 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_lsp_tools_real.py +82 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_moving.py +321 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_notes.py +63 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_overview.py +643 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_reading_corpus.py +183 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_references.py +286 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_renaming.py +494 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_running.py +702 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_search_tools.py +431 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_test_command_setting.py +59 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_write_gate.py +312 -0
- fachwerk_mcp-0.1.0/tests/toolbox/test_writing.py +541 -0
- fachwerk_mcp-0.1.0/tests/toolsets/__init__.py +2 -0
- fachwerk_mcp-0.1.0/tests/toolsets/conftest.py +19 -0
- fachwerk_mcp-0.1.0/tests/toolsets/support.py +121 -0
- fachwerk_mcp-0.1.0/tests/toolsets/test_catalog.py +161 -0
- fachwerk_mcp-0.1.0/tests/toolsets/test_config_tools.py +528 -0
- fachwerk_mcp-0.1.0/tests/toolsets/test_extras.py +247 -0
- fachwerk_mcp-0.1.0/tests/toolsets/test_flows.py +235 -0
- fachwerk_mcp-0.1.0/tests/toolsets/test_language_servers.py +87 -0
- fachwerk_mcp-0.1.0/tests/toolsets/test_levels.py +93 -0
- fachwerk_mcp-0.1.0/tests/toolsets/test_real_servers.py +69 -0
- fachwerk_mcp-0.1.0/tests/toolsets/test_runtime.py +381 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Local working notes - never committed (research, drafts, competitor analysis, ...)
|
|
2
|
+
/local-notes/
|
|
3
|
+
|
|
4
|
+
# Byte-compiled / optimized / DLL files
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*$py.class
|
|
8
|
+
|
|
9
|
+
# C extensions
|
|
10
|
+
*.so
|
|
11
|
+
|
|
12
|
+
# Distribution / packaging
|
|
13
|
+
.Python
|
|
14
|
+
build/
|
|
15
|
+
develop-eggs/
|
|
16
|
+
dist/
|
|
17
|
+
downloads/
|
|
18
|
+
eggs/
|
|
19
|
+
.eggs/
|
|
20
|
+
lib/
|
|
21
|
+
lib64/
|
|
22
|
+
parts/
|
|
23
|
+
sdist/
|
|
24
|
+
var/
|
|
25
|
+
wheels/
|
|
26
|
+
pip-wheel-metadata/
|
|
27
|
+
share/python-wheels/
|
|
28
|
+
*.egg-info/
|
|
29
|
+
.installed.cfg
|
|
30
|
+
*.egg
|
|
31
|
+
MANIFEST
|
|
32
|
+
|
|
33
|
+
# PyInstaller
|
|
34
|
+
# Usually these files are written by a python script from a template
|
|
35
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
36
|
+
*.manifest
|
|
37
|
+
*.spec
|
|
38
|
+
|
|
39
|
+
# Installer logs
|
|
40
|
+
pip-log.txt
|
|
41
|
+
pip-delete-this-directory.txt
|
|
42
|
+
|
|
43
|
+
# Unit test / coverage reports
|
|
44
|
+
htmlcov/
|
|
45
|
+
.tox/
|
|
46
|
+
.nox/
|
|
47
|
+
.hatch/
|
|
48
|
+
.coverage
|
|
49
|
+
.coverage.*
|
|
50
|
+
.cache
|
|
51
|
+
nosetests.xml
|
|
52
|
+
coverage.xml
|
|
53
|
+
*.cover
|
|
54
|
+
*.py,cover
|
|
55
|
+
.hypothesis/
|
|
56
|
+
.pytest_cache/
|
|
57
|
+
|
|
58
|
+
# Translations
|
|
59
|
+
*.mo
|
|
60
|
+
*.pot
|
|
61
|
+
|
|
62
|
+
# Django stuff:
|
|
63
|
+
*.log
|
|
64
|
+
local_settings.py
|
|
65
|
+
db.sqlite3
|
|
66
|
+
db.sqlite3-journal
|
|
67
|
+
|
|
68
|
+
# Flask stuff:
|
|
69
|
+
instance/
|
|
70
|
+
.webassets-cache
|
|
71
|
+
|
|
72
|
+
# Scrapy stuff:
|
|
73
|
+
.scrapy
|
|
74
|
+
|
|
75
|
+
# Sphinx documentation
|
|
76
|
+
docs/_build/
|
|
77
|
+
|
|
78
|
+
# PyBuilder
|
|
79
|
+
target/
|
|
80
|
+
|
|
81
|
+
# Jupyter Notebook
|
|
82
|
+
.ipynb_checkpoints
|
|
83
|
+
|
|
84
|
+
# IPython
|
|
85
|
+
profile_default/
|
|
86
|
+
ipython_config.py
|
|
87
|
+
|
|
88
|
+
# pyenv
|
|
89
|
+
.python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
#Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
99
|
+
__pypackages__/
|
|
100
|
+
|
|
101
|
+
# Celery stuff
|
|
102
|
+
celerybeat-schedule
|
|
103
|
+
celerybeat.pid
|
|
104
|
+
|
|
105
|
+
# SageMath parsed files
|
|
106
|
+
*.sage.py
|
|
107
|
+
|
|
108
|
+
# Environments
|
|
109
|
+
.env
|
|
110
|
+
.venv
|
|
111
|
+
env/
|
|
112
|
+
venv/
|
|
113
|
+
ENV/
|
|
114
|
+
env.bak/
|
|
115
|
+
venv.bak/
|
|
116
|
+
|
|
117
|
+
# Spyder project settings
|
|
118
|
+
.spyderproject
|
|
119
|
+
.spyproject
|
|
120
|
+
|
|
121
|
+
# Rope project settings
|
|
122
|
+
.ropeproject
|
|
123
|
+
|
|
124
|
+
# mkdocs documentation
|
|
125
|
+
/site
|
|
126
|
+
|
|
127
|
+
# mypy
|
|
128
|
+
.mypy_cache/
|
|
129
|
+
.dmypy.json
|
|
130
|
+
dmypy.json
|
|
131
|
+
|
|
132
|
+
# Pyre type checker
|
|
133
|
+
.pyre/
|
|
134
|
+
.idea/
|
|
135
|
+
|
|
136
|
+
# Ruff
|
|
137
|
+
.ruff_cache/
|
|
138
|
+
|
|
139
|
+
# Hatch / coverage
|
|
140
|
+
.coverage
|
|
141
|
+
.coverage.*
|
|
142
|
+
htmlcov/
|
|
143
|
+
.tox/
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.1.0] - 2026-12-02
|
|
11
|
+
|
|
12
|
+
First release.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **The write gate.** Every edit passes syntax, structure, signature, safe fixes (isort, ruff), format (black), lint and types before a file is touched. The edit is all or nothing: a failed
|
|
17
|
+
check writes nothing and returns every finding. Several changes can be applied together (`code_apply_changes`).
|
|
18
|
+
- **The recommended chain** with a strict policy that ships with the server: black, isort, ruff, flake8, pylint, bandit, mypy and ty (language server). The tools are regular dependencies,
|
|
19
|
+
so nothing needs to be installed next to the server.
|
|
20
|
+
- **Profiles.** `recommended` (the default) runs the chain with the shipped policy and ignores the project's own tool settings; `project` runs the tools the project names with its own
|
|
21
|
+
settings; `custom` chooses per tool. A tool of the chain that cannot run blocks the write and is named (`missing_tool = "warn"` makes it a notice).
|
|
22
|
+
- **Baseline.** Only findings that an edit causes block it. What a file already had before the work (git HEAD, or the state at the first look) is counted, not listed;
|
|
23
|
+
`code_check existing=true` lists it. Gone findings are counted as fixed. Results are cached by tool, version, settings, policy version and content.
|
|
24
|
+
- **Conformance harness** (`python -m tests.conformance`): mutates a project through the real tools and compares the verdict of the gate with the chain run as plain commands.
|
|
25
|
+
- **46 tools** in three levels (`read`, `write`, `run`): reading and searching by symbol, writing by symbol, rename, move, delete and undo, git, language-server queries, notes
|
|
26
|
+
(`memory_*`), tests and commands. Tests and commands run only inside a sandbox (bubblewrap, no network, `.git` and credential files protected); without a sandbox they are refused.
|
|
27
|
+
- **Configuration tools** `config_get`, `config_propose` and `config_status`: the model reads the effective settings of a project with their sources and the open questions, and proposes changes
|
|
28
|
+
of the interpreter, source folders, test runner and command, excluded folders, protected file patterns, the language server and the gate mode. It cannot apply them: the user confirms
|
|
29
|
+
through a question of the client (MCP elicitation) or with `fachwerk-mcp config list|show|approve|reject`. Settings that widen what the model may do or weaken the checks can never be
|
|
30
|
+
proposed. Confirmed settings are stored outside the project (`$XDG_CONFIG_HOME/fachwerk-mcp/projects/<hash>.toml`) and every change is written to an audit log.
|
|
31
|
+
- **First-use question** for the write gate: the user chooses `recommended`, `project` or `custom` once per project through the client's form, or with `fachwerk-mcp gate show|set` when the
|
|
32
|
+
client cannot show one. `server_info` says whether the choice was confirmed and what the chosen profile runs.
|
|
33
|
+
- **Transports and clients:** stdio (`fachwerk-mcp stdio`) and HTTP on loopback with bearer tokens (`fachwerk-mcp serve`, `fachwerk-mcp token`). `fachwerk-mcp print-config` prints the entry for
|
|
34
|
+
Claude Code, Codex, Cursor, OpenCode, VS Code and Zed.
|
|
35
|
+
- A call log with `fachwerk-mcp calls`, `fachwerk-mcp baseline clear`, and `fachwerk_info` as the manual inside the server.
|
|
36
|
+
- Documentation: quick start, the write gate, how the gate checks, made for Python, tools and access levels, projects, architecture and security.
|
|
37
|
+
|
|
38
|
+
### Known limits
|
|
39
|
+
|
|
40
|
+
- New suppression comments (`# nosec`, `# noqa`, `# type: ignore`, `# pylint: disable`) and changes to a project's lint configuration are not checked yet. Legitimate suppressions exist,
|
|
41
|
+
so a later version has to allow them with a reason instead of blocking them.
|
|
42
|
+
- Whole-project checks (duplicate code, import cycles, types of the files that depend on the changed one) do not run on every write; `check_changed` and a full run cover them.
|
|
43
|
+
- The count of findings a project already has and the names of the serious ones are not yet part of the first-use question.
|
|
44
|
+
- Black and ruff's `COM812` (trailing comma) can disagree about a call that black joins onto one line. The gate then names the conflict and refuses; no text satisfies both tools.
|
|
45
|
+
- `source_roots` is stored as a setting but nothing acts on it yet.
|
|
46
|
+
- Linux only for commands and tests (bubblewrap).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The Fachwerk authors
|
|
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,236 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: fachwerk-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server for Python projects: coding agents can only write code that passed syntax, structure, black, isort, ruff and mypy
|
|
5
|
+
Project-URL: Homepage, https://github.com/manfred-kaiser/fachwerk-mcp
|
|
6
|
+
Project-URL: Documentation, https://fachwerk-mcp.readthedocs.io
|
|
7
|
+
Project-URL: Changelog, https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/CHANGELOG.md
|
|
8
|
+
Project-URL: Source, https://github.com/manfred-kaiser/fachwerk-mcp
|
|
9
|
+
Project-URL: Tracker, https://github.com/manfred-kaiser/fachwerk-mcp/issues
|
|
10
|
+
Author-email: Manfred Kaiser <manfred.kaiser@ssh-mitm.at>
|
|
11
|
+
Maintainer-email: Manfred Kaiser <manfred.kaiser@ssh-mitm.at>
|
|
12
|
+
License-Expression: MIT
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: agents,language-server,lsp,mcp,model-context-protocol,python
|
|
15
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Software Development
|
|
22
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.12
|
|
25
|
+
Requires-Dist: bandit<2,>=1.9
|
|
26
|
+
Requires-Dist: black<27,>=26.10
|
|
27
|
+
Requires-Dist: flake8<8,>=7.3
|
|
28
|
+
Requires-Dist: isort<10,>=9.0
|
|
29
|
+
Requires-Dist: mcp<3,>=2.3
|
|
30
|
+
Requires-Dist: mypy<3,>=2.4
|
|
31
|
+
Requires-Dist: pylint<5,>=4.0
|
|
32
|
+
Requires-Dist: ruff<0.18,>=0.17
|
|
33
|
+
Requires-Dist: ty<2,>=1.0
|
|
34
|
+
Provides-Extra: docs
|
|
35
|
+
Requires-Dist: myst-parser; extra == 'docs'
|
|
36
|
+
Requires-Dist: sphinx; extra == 'docs'
|
|
37
|
+
Requires-Dist: sphinx-copybutton; extra == 'docs'
|
|
38
|
+
Requires-Dist: sphinx-rtd-theme; extra == 'docs'
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
|
|
41
|
+
<p align="center">
|
|
42
|
+
<img src="https://raw.githubusercontent.com/manfred-kaiser/fachwerk-mcp/main/docs/_static/icon.svg" width="96" height="96" alt="fachwerk-mcp">
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
<h1 align="center">fachwerk-mcp</h1>
|
|
46
|
+
|
|
47
|
+
<p align="center">
|
|
48
|
+
<strong>An MCP server for Python projects. What a coding agent writes is checked before it reaches your files.</strong><br>
|
|
49
|
+
Every edit passes your strict checks first: black, isort, ruff, flake8, pylint, bandit, mypy and ty. A failed check writes nothing.
|
|
50
|
+
</p>
|
|
51
|
+
|
|
52
|
+
<p align="center">
|
|
53
|
+
<a href="https://pypi.org/project/fachwerk-mcp"><img src="https://img.shields.io/pypi/v/fachwerk-mcp" alt="PyPI"></a>
|
|
54
|
+
<a href="https://pypi.org/project/fachwerk-mcp"><img src="https://img.shields.io/pypi/pyversions/fachwerk-mcp" alt="Python versions"></a>
|
|
55
|
+
<a href="https://github.com/manfred-kaiser/fachwerk-mcp/actions/workflows/ci.yml"><img src="https://github.com/manfred-kaiser/fachwerk-mcp/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
56
|
+
<a href="https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/LICENSE"><img src="https://img.shields.io/github/license/manfred-kaiser/fachwerk-mcp" alt="License"></a>
|
|
57
|
+
</p>
|
|
58
|
+
|
|
59
|
+
<p align="center">
|
|
60
|
+
<img src="https://raw.githubusercontent.com/manfred-kaiser/fachwerk-mcp/main/docs/_static/demo.svg" width="760" alt="An edit with a forgotten import and an unhandled None is rejected with every finding and nothing is written; the corrected edit is written, with the places that use it and the tests to run.">
|
|
61
|
+
</p>
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Why
|
|
66
|
+
|
|
67
|
+
A coding agent writes code that looks right and sometimes is not: an invented API, a forgotten import, an unhandled `None`, a shell command built from input. Reading every diff is the
|
|
68
|
+
only safeguard most setups have, and it does not scale. fachwerk-mcp moves the checks in front of the write. The strict chain you would run in CI runs on every edit, the agent gets the
|
|
69
|
+
findings back at once and fixes them, and what reaches your files has already passed.
|
|
70
|
+
|
|
71
|
+
<p align="center">
|
|
72
|
+
<img src="https://raw.githubusercontent.com/manfred-kaiser/fachwerk-mcp/main/docs/_static/write-gate.svg" width="760" alt="One call: an edit passes syntax, structure, format, lint (ruff, flake8, pylint, bandit) and types (ty, mypy). Only then is it written; a failed check writes nothing and returns every finding to the agent.">
|
|
73
|
+
</p>
|
|
74
|
+
|
|
75
|
+
## How it keeps the code safe
|
|
76
|
+
|
|
77
|
+
<p align="center">
|
|
78
|
+
<img src="https://raw.githubusercontent.com/manfred-kaiser/fachwerk-mcp/main/docs/_static/chain.svg" width="760" alt="The recommended policy drives black, isort, ruff, flake8, pylint, bandit, mypy and ty. The settings of the project are ignored in the default profile. An edit that adds a finding is rejected; findings that existed before the agent's work are counted and do not block.">
|
|
79
|
+
</p>
|
|
80
|
+
|
|
81
|
+
- **Checked before it is written.** An edit goes through the write gate in the same call: syntax, structure, safe fixes, format, lint (ruff, flake8, pylint, bandit) and types (ty, mypy).
|
|
82
|
+
All or nothing: if one check fails, nothing is written and the agent gets every finding. It catches what models get wrong, including `# ... rest unchanged` placeholders.
|
|
83
|
+
- **Strict by default, and your project cannot quietly weaken it.** The default profile `recommended` runs the chain with a strict policy that ships with the server and ignores the rule
|
|
84
|
+
selections and ignore lists of the project. If your project checks with other linters, results can differ, and the server says so. You choose once per project, with a question in
|
|
85
|
+
your client or `fachwerk-mcp gate set`: `recommended`, `project` (your tools with your settings; the server can then no longer ensure that its strict rules are kept) or `custom`.
|
|
86
|
+
A tool of the chain that cannot run blocks the write and is named; nothing passes unchecked by accident.
|
|
87
|
+
- **Only what the agent causes.** Existing code is not clean, and an agent should not drown in findings it did not write. Findings a file had before the work (git HEAD) are counted, not
|
|
88
|
+
listed; only new ones block. The strict rules apply to new code, so a project can move toward them without a clean-up first.
|
|
89
|
+
- **Least privilege.** Three levels: `read`, `write`, `run` (default). Tests and commands run only inside a sandbox (bubblewrap, no network, `.git` and credential files protected); if the
|
|
90
|
+
sandbox cannot start, commands are refused. A model cannot change its own rights: it may *propose* a few settings (interpreter, test command, ...), and only you confirm them. Anything
|
|
91
|
+
that widens its access or weakens the checks can never be proposed.
|
|
92
|
+
- **You can see what happened.** Settings live outside your project, every change is in an audit log, `server_info` says what is active and what is degraded, and the call log shows what
|
|
93
|
+
the agent did.
|
|
94
|
+
|
|
95
|
+
## What it does not do
|
|
96
|
+
|
|
97
|
+
- It is not a proof of security. Linters find known patterns; they do not replace a review of what matters.
|
|
98
|
+
- New suppression comments (`# nosec`, `# noqa`, `# type: ignore`) are not checked yet. This is a known, accepted gap of 0.1.0 (see the [changelog](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/CHANGELOG.md)).
|
|
99
|
+
- Only the recommended chain is tested and measured. Other combinations work, but are not verified.
|
|
100
|
+
- Commands and tests need bubblewrap, so they run on Linux only; reading and editing do not depend on the sandbox.
|
|
101
|
+
|
|
102
|
+
## Why this approach should work
|
|
103
|
+
|
|
104
|
+
The idea, putting the findings of static analysis back in front of the model until the code is clean, is not new, and it has been measured:
|
|
105
|
+
|
|
106
|
+
- **Security and quality improve with a feedback loop.** Blyth, Licorish, Treude and Wagner fed the findings of Bandit (security) and Pylint (quality) back to GPT-4o and asked it to fix them. Within ten iterations the share of generated code with security issues fell from over 40% to 13%, and the share with reliability warnings from over 50% to 11%. ([Static Analysis as a Feedback Loop: Enhancing LLM-Generated Code Beyond Correctness](https://arxiv.org/abs/2508.14419), 2025)
|
|
107
|
+
- **But an agent can clear a finding the wrong way.** Wynter found that external checker feedback lets cheaper coding agents repair many more rule violations, and also that agents often cleared a defect by deleting the newly added files. fachwerk-mcp shows every removal in its report ("Removed, not just changed") for that reason. ([Fixed or Deleted? External Feedback Lets Cheaper AI Coding Agents Repair Rule Violations](https://arxiv.org/abs/2611.29162), 2026)
|
|
108
|
+
|
|
109
|
+
These studies support the approach. They do not measure fachwerk-mcp itself.
|
|
110
|
+
|
|
111
|
+
## How well does it agree with your own checks?
|
|
112
|
+
|
|
113
|
+
The conformance harness (`python -m tests.conformance`) changes a project through the real tools and compares the verdict of the gate with the same chain run as plain commands. On five
|
|
114
|
+
Python projects, 10 changes each, the verdicts agreed in all but one case (a false block after a rename, fixed since and covered by a test). That is a small sample, and the harness is
|
|
115
|
+
there so you can run more on your own project.
|
|
116
|
+
|
|
117
|
+
## More
|
|
118
|
+
|
|
119
|
+
- **Made for Python.** Works on symbols, not lines; uses your virtual environment and your `pyproject.toml`; runs your tests with pytest.
|
|
120
|
+
- **Read little, write once.** Symbol index and reference search instead of whole files; one call per change.
|
|
121
|
+
- **One server for all your projects and clients.** OpenCode, Claude Code, Codex, Cursor, VS Code, Zed, ...
|
|
122
|
+
- **Little setup.** One command, no configuration file, all checking tools included. Nothing is written into your projects.
|
|
123
|
+
|
|
124
|
+
<p align="center">
|
|
125
|
+
<img src="https://raw.githubusercontent.com/manfred-kaiser/fachwerk-mcp/main/docs/_static/architecture.svg" width="760" alt="OpenCode, Claude Code and other MCP clients connect over stdio or HTTP to one fachwerk-mcp server, which serves several Python projects with a symbol index, language servers, the write gate and a sandbox.">
|
|
126
|
+
</p>
|
|
127
|
+
|
|
128
|
+
## Quick start
|
|
129
|
+
|
|
130
|
+
Run this inside your Python project.
|
|
131
|
+
|
|
132
|
+
**OpenCode:** put this into `opencode.jsonc` in the project:
|
|
133
|
+
|
|
134
|
+
```jsonc
|
|
135
|
+
{
|
|
136
|
+
"$schema": "https://opencode.ai/config.json",
|
|
137
|
+
"mcp": {
|
|
138
|
+
"servers": {
|
|
139
|
+
"fachwerk": { "type": "local", "command": ["uvx", "fachwerk-mcp", "stdio"] }
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Claude Code:**
|
|
146
|
+
|
|
147
|
+
```sh
|
|
148
|
+
claude mcp add fachwerk -- uvx fachwerk-mcp stdio
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
That is all. The project you are in is the root; nothing else to install or configure.
|
|
152
|
+
Other clients: `fachwerk-mcp print-config <client>` prints the entry for OpenCode, Claude Code,
|
|
153
|
+
Codex, Cursor, VS Code and Zed. Prefer `pip`? `pip install fachwerk-mcp`, then use
|
|
154
|
+
`fachwerk-mcp stdio` as the command.
|
|
155
|
+
|
|
156
|
+
**Several projects or several clients?** Run one shared server instead; it prints the line that
|
|
157
|
+
connects your client:
|
|
158
|
+
|
|
159
|
+
```sh
|
|
160
|
+
fachwerk-mcp serve --root ~/projects/app --root ~/projects/lib --level write
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Requires Python 3.12 or newer.
|
|
164
|
+
|
|
165
|
+
## Connect your agent
|
|
166
|
+
|
|
167
|
+
`fachwerk-mcp print-config <client>` prints the exact entry for each client
|
|
168
|
+
(`opencode`, `claude-code`, `codex`, `cursor`, `vscode`, `zed`); add `--level read|write` to
|
|
169
|
+
write a lower access level into it. The two agents below in detail.
|
|
170
|
+
|
|
171
|
+
### OpenCode
|
|
172
|
+
|
|
173
|
+
Put the entry into `opencode.jsonc` in your project, or into your global OpenCode config. OpenCode's
|
|
174
|
+
current configuration keeps servers under `mcp.servers`:
|
|
175
|
+
|
|
176
|
+
```jsonc
|
|
177
|
+
{
|
|
178
|
+
"$schema": "https://opencode.ai/config.json",
|
|
179
|
+
"mcp": {
|
|
180
|
+
"servers": {
|
|
181
|
+
"fachwerk": {
|
|
182
|
+
"type": "local",
|
|
183
|
+
"command": ["uvx", "fachwerk-mcp", "stdio"]
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
| You want | Change |
|
|
191
|
+
| --- | --- |
|
|
192
|
+
| Edits but no commands, or read-only | append `"--level", "write"` (or `"read"`) to `command` |
|
|
193
|
+
| A fixed project, whatever folder you start in | append `"--root", "/home/you/projects/app"` to `command` |
|
|
194
|
+
| The shared server (`fachwerk-mcp serve`) | use `{"type": "remote", "url": "http://127.0.0.1:8808/mcp", "oauth": false, "headers": {"Authorization": "Bearer <token>"}}` instead of the `local` entry |
|
|
195
|
+
| To switch it off for a while | add `"disabled": true` to the server entry |
|
|
196
|
+
| The server in every project | `opencode mcp add --global`; without `--global` it writes to the project configuration |
|
|
197
|
+
|
|
198
|
+
OpenCode names the tools `fachwerk_code_*` (server name, underscore, tool name). To make the
|
|
199
|
+
write gate the only way to change files, deny OpenCode's own `edit` and `write` tools in its
|
|
200
|
+
permission settings; the [OpenCode MCP documentation](https://opencode.ai/docs/mcp-servers/)
|
|
201
|
+
has the current rules.
|
|
202
|
+
|
|
203
|
+
### Claude Code
|
|
204
|
+
|
|
205
|
+
Run this inside your project; it registers the server for you (user scope, stored in `~/.claude.json`):
|
|
206
|
+
|
|
207
|
+
```sh
|
|
208
|
+
claude mcp add fachwerk -- uvx fachwerk-mcp stdio
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
| You want | Command |
|
|
212
|
+
| --- | --- |
|
|
213
|
+
| The server only for this project, shared with your team through `.mcp.json` | `claude mcp add --scope project fachwerk -- uvx fachwerk-mcp stdio` |
|
|
214
|
+
| Edits but no commands | `claude mcp add fachwerk -- uvx fachwerk-mcp stdio --level write` |
|
|
215
|
+
| Read-only | `claude mcp add fachwerk -- uvx fachwerk-mcp stdio --level read` |
|
|
216
|
+
| A fixed project, whatever folder you start in | `claude mcp add fachwerk -- uvx fachwerk-mcp stdio --root ~/projects/app` |
|
|
217
|
+
| The shared server (`fachwerk-mcp serve`) | `claude mcp add --transport http fachwerk http://127.0.0.1:8808/mcp --header "Authorization: Bearer <token>"` |
|
|
218
|
+
|
|
219
|
+
Check with `claude mcp list`, or `/mcp` inside Claude Code. The tools show up as
|
|
220
|
+
`mcp__fachwerk__code_*`. Claude Code keeps its own `Edit` and `Write` tools next to them; to make
|
|
221
|
+
the write gate the only way to change files, deny those two in your permission settings
|
|
222
|
+
(`"permissions": {"deny": ["Edit", "Write"]}` in `.claude/settings.json`), so every edit has to
|
|
223
|
+
pass the checks. Run `/mcp` to reconnect after you update `fachwerk-mcp`.
|
|
224
|
+
|
|
225
|
+
## Learn more
|
|
226
|
+
|
|
227
|
+
[Quick start in detail](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/quickstart.md) ·
|
|
228
|
+
[The write gate](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/write-gate.md) ·
|
|
229
|
+
[How the gate checks](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/gate.md) ·
|
|
230
|
+
[Made for Python](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/python.md) ·
|
|
231
|
+
[Tools and access levels](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/tools.md) ·
|
|
232
|
+
[Projects, caches, language servers](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/projects.md) ·
|
|
233
|
+
[Architecture](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/architecture.md) ·
|
|
234
|
+
[Security](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/security.md)
|
|
235
|
+
|
|
236
|
+
Built on the official [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk). MIT licensed.
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/manfred-kaiser/fachwerk-mcp/main/docs/_static/icon.svg" width="96" height="96" alt="fachwerk-mcp">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">fachwerk-mcp</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>An MCP server for Python projects. What a coding agent writes is checked before it reaches your files.</strong><br>
|
|
9
|
+
Every edit passes your strict checks first: black, isort, ruff, flake8, pylint, bandit, mypy and ty. A failed check writes nothing.
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://pypi.org/project/fachwerk-mcp"><img src="https://img.shields.io/pypi/v/fachwerk-mcp" alt="PyPI"></a>
|
|
14
|
+
<a href="https://pypi.org/project/fachwerk-mcp"><img src="https://img.shields.io/pypi/pyversions/fachwerk-mcp" alt="Python versions"></a>
|
|
15
|
+
<a href="https://github.com/manfred-kaiser/fachwerk-mcp/actions/workflows/ci.yml"><img src="https://github.com/manfred-kaiser/fachwerk-mcp/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
16
|
+
<a href="https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/LICENSE"><img src="https://img.shields.io/github/license/manfred-kaiser/fachwerk-mcp" alt="License"></a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img src="https://raw.githubusercontent.com/manfred-kaiser/fachwerk-mcp/main/docs/_static/demo.svg" width="760" alt="An edit with a forgotten import and an unhandled None is rejected with every finding and nothing is written; the corrected edit is written, with the places that use it and the tests to run.">
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
|
|
27
|
+
A coding agent writes code that looks right and sometimes is not: an invented API, a forgotten import, an unhandled `None`, a shell command built from input. Reading every diff is the
|
|
28
|
+
only safeguard most setups have, and it does not scale. fachwerk-mcp moves the checks in front of the write. The strict chain you would run in CI runs on every edit, the agent gets the
|
|
29
|
+
findings back at once and fixes them, and what reaches your files has already passed.
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
<img src="https://raw.githubusercontent.com/manfred-kaiser/fachwerk-mcp/main/docs/_static/write-gate.svg" width="760" alt="One call: an edit passes syntax, structure, format, lint (ruff, flake8, pylint, bandit) and types (ty, mypy). Only then is it written; a failed check writes nothing and returns every finding to the agent.">
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
## How it keeps the code safe
|
|
36
|
+
|
|
37
|
+
<p align="center">
|
|
38
|
+
<img src="https://raw.githubusercontent.com/manfred-kaiser/fachwerk-mcp/main/docs/_static/chain.svg" width="760" alt="The recommended policy drives black, isort, ruff, flake8, pylint, bandit, mypy and ty. The settings of the project are ignored in the default profile. An edit that adds a finding is rejected; findings that existed before the agent's work are counted and do not block.">
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
- **Checked before it is written.** An edit goes through the write gate in the same call: syntax, structure, safe fixes, format, lint (ruff, flake8, pylint, bandit) and types (ty, mypy).
|
|
42
|
+
All or nothing: if one check fails, nothing is written and the agent gets every finding. It catches what models get wrong, including `# ... rest unchanged` placeholders.
|
|
43
|
+
- **Strict by default, and your project cannot quietly weaken it.** The default profile `recommended` runs the chain with a strict policy that ships with the server and ignores the rule
|
|
44
|
+
selections and ignore lists of the project. If your project checks with other linters, results can differ, and the server says so. You choose once per project, with a question in
|
|
45
|
+
your client or `fachwerk-mcp gate set`: `recommended`, `project` (your tools with your settings; the server can then no longer ensure that its strict rules are kept) or `custom`.
|
|
46
|
+
A tool of the chain that cannot run blocks the write and is named; nothing passes unchecked by accident.
|
|
47
|
+
- **Only what the agent causes.** Existing code is not clean, and an agent should not drown in findings it did not write. Findings a file had before the work (git HEAD) are counted, not
|
|
48
|
+
listed; only new ones block. The strict rules apply to new code, so a project can move toward them without a clean-up first.
|
|
49
|
+
- **Least privilege.** Three levels: `read`, `write`, `run` (default). Tests and commands run only inside a sandbox (bubblewrap, no network, `.git` and credential files protected); if the
|
|
50
|
+
sandbox cannot start, commands are refused. A model cannot change its own rights: it may *propose* a few settings (interpreter, test command, ...), and only you confirm them. Anything
|
|
51
|
+
that widens its access or weakens the checks can never be proposed.
|
|
52
|
+
- **You can see what happened.** Settings live outside your project, every change is in an audit log, `server_info` says what is active and what is degraded, and the call log shows what
|
|
53
|
+
the agent did.
|
|
54
|
+
|
|
55
|
+
## What it does not do
|
|
56
|
+
|
|
57
|
+
- It is not a proof of security. Linters find known patterns; they do not replace a review of what matters.
|
|
58
|
+
- New suppression comments (`# nosec`, `# noqa`, `# type: ignore`) are not checked yet. This is a known, accepted gap of 0.1.0 (see the [changelog](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/CHANGELOG.md)).
|
|
59
|
+
- Only the recommended chain is tested and measured. Other combinations work, but are not verified.
|
|
60
|
+
- Commands and tests need bubblewrap, so they run on Linux only; reading and editing do not depend on the sandbox.
|
|
61
|
+
|
|
62
|
+
## Why this approach should work
|
|
63
|
+
|
|
64
|
+
The idea, putting the findings of static analysis back in front of the model until the code is clean, is not new, and it has been measured:
|
|
65
|
+
|
|
66
|
+
- **Security and quality improve with a feedback loop.** Blyth, Licorish, Treude and Wagner fed the findings of Bandit (security) and Pylint (quality) back to GPT-4o and asked it to fix them. Within ten iterations the share of generated code with security issues fell from over 40% to 13%, and the share with reliability warnings from over 50% to 11%. ([Static Analysis as a Feedback Loop: Enhancing LLM-Generated Code Beyond Correctness](https://arxiv.org/abs/2508.14419), 2025)
|
|
67
|
+
- **But an agent can clear a finding the wrong way.** Wynter found that external checker feedback lets cheaper coding agents repair many more rule violations, and also that agents often cleared a defect by deleting the newly added files. fachwerk-mcp shows every removal in its report ("Removed, not just changed") for that reason. ([Fixed or Deleted? External Feedback Lets Cheaper AI Coding Agents Repair Rule Violations](https://arxiv.org/abs/2611.29162), 2026)
|
|
68
|
+
|
|
69
|
+
These studies support the approach. They do not measure fachwerk-mcp itself.
|
|
70
|
+
|
|
71
|
+
## How well does it agree with your own checks?
|
|
72
|
+
|
|
73
|
+
The conformance harness (`python -m tests.conformance`) changes a project through the real tools and compares the verdict of the gate with the same chain run as plain commands. On five
|
|
74
|
+
Python projects, 10 changes each, the verdicts agreed in all but one case (a false block after a rename, fixed since and covered by a test). That is a small sample, and the harness is
|
|
75
|
+
there so you can run more on your own project.
|
|
76
|
+
|
|
77
|
+
## More
|
|
78
|
+
|
|
79
|
+
- **Made for Python.** Works on symbols, not lines; uses your virtual environment and your `pyproject.toml`; runs your tests with pytest.
|
|
80
|
+
- **Read little, write once.** Symbol index and reference search instead of whole files; one call per change.
|
|
81
|
+
- **One server for all your projects and clients.** OpenCode, Claude Code, Codex, Cursor, VS Code, Zed, ...
|
|
82
|
+
- **Little setup.** One command, no configuration file, all checking tools included. Nothing is written into your projects.
|
|
83
|
+
|
|
84
|
+
<p align="center">
|
|
85
|
+
<img src="https://raw.githubusercontent.com/manfred-kaiser/fachwerk-mcp/main/docs/_static/architecture.svg" width="760" alt="OpenCode, Claude Code and other MCP clients connect over stdio or HTTP to one fachwerk-mcp server, which serves several Python projects with a symbol index, language servers, the write gate and a sandbox.">
|
|
86
|
+
</p>
|
|
87
|
+
|
|
88
|
+
## Quick start
|
|
89
|
+
|
|
90
|
+
Run this inside your Python project.
|
|
91
|
+
|
|
92
|
+
**OpenCode:** put this into `opencode.jsonc` in the project:
|
|
93
|
+
|
|
94
|
+
```jsonc
|
|
95
|
+
{
|
|
96
|
+
"$schema": "https://opencode.ai/config.json",
|
|
97
|
+
"mcp": {
|
|
98
|
+
"servers": {
|
|
99
|
+
"fachwerk": { "type": "local", "command": ["uvx", "fachwerk-mcp", "stdio"] }
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Claude Code:**
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
claude mcp add fachwerk -- uvx fachwerk-mcp stdio
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
That is all. The project you are in is the root; nothing else to install or configure.
|
|
112
|
+
Other clients: `fachwerk-mcp print-config <client>` prints the entry for OpenCode, Claude Code,
|
|
113
|
+
Codex, Cursor, VS Code and Zed. Prefer `pip`? `pip install fachwerk-mcp`, then use
|
|
114
|
+
`fachwerk-mcp stdio` as the command.
|
|
115
|
+
|
|
116
|
+
**Several projects or several clients?** Run one shared server instead; it prints the line that
|
|
117
|
+
connects your client:
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
fachwerk-mcp serve --root ~/projects/app --root ~/projects/lib --level write
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Requires Python 3.12 or newer.
|
|
124
|
+
|
|
125
|
+
## Connect your agent
|
|
126
|
+
|
|
127
|
+
`fachwerk-mcp print-config <client>` prints the exact entry for each client
|
|
128
|
+
(`opencode`, `claude-code`, `codex`, `cursor`, `vscode`, `zed`); add `--level read|write` to
|
|
129
|
+
write a lower access level into it. The two agents below in detail.
|
|
130
|
+
|
|
131
|
+
### OpenCode
|
|
132
|
+
|
|
133
|
+
Put the entry into `opencode.jsonc` in your project, or into your global OpenCode config. OpenCode's
|
|
134
|
+
current configuration keeps servers under `mcp.servers`:
|
|
135
|
+
|
|
136
|
+
```jsonc
|
|
137
|
+
{
|
|
138
|
+
"$schema": "https://opencode.ai/config.json",
|
|
139
|
+
"mcp": {
|
|
140
|
+
"servers": {
|
|
141
|
+
"fachwerk": {
|
|
142
|
+
"type": "local",
|
|
143
|
+
"command": ["uvx", "fachwerk-mcp", "stdio"]
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
| You want | Change |
|
|
151
|
+
| --- | --- |
|
|
152
|
+
| Edits but no commands, or read-only | append `"--level", "write"` (or `"read"`) to `command` |
|
|
153
|
+
| A fixed project, whatever folder you start in | append `"--root", "/home/you/projects/app"` to `command` |
|
|
154
|
+
| The shared server (`fachwerk-mcp serve`) | use `{"type": "remote", "url": "http://127.0.0.1:8808/mcp", "oauth": false, "headers": {"Authorization": "Bearer <token>"}}` instead of the `local` entry |
|
|
155
|
+
| To switch it off for a while | add `"disabled": true` to the server entry |
|
|
156
|
+
| The server in every project | `opencode mcp add --global`; without `--global` it writes to the project configuration |
|
|
157
|
+
|
|
158
|
+
OpenCode names the tools `fachwerk_code_*` (server name, underscore, tool name). To make the
|
|
159
|
+
write gate the only way to change files, deny OpenCode's own `edit` and `write` tools in its
|
|
160
|
+
permission settings; the [OpenCode MCP documentation](https://opencode.ai/docs/mcp-servers/)
|
|
161
|
+
has the current rules.
|
|
162
|
+
|
|
163
|
+
### Claude Code
|
|
164
|
+
|
|
165
|
+
Run this inside your project; it registers the server for you (user scope, stored in `~/.claude.json`):
|
|
166
|
+
|
|
167
|
+
```sh
|
|
168
|
+
claude mcp add fachwerk -- uvx fachwerk-mcp stdio
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
| You want | Command |
|
|
172
|
+
| --- | --- |
|
|
173
|
+
| The server only for this project, shared with your team through `.mcp.json` | `claude mcp add --scope project fachwerk -- uvx fachwerk-mcp stdio` |
|
|
174
|
+
| Edits but no commands | `claude mcp add fachwerk -- uvx fachwerk-mcp stdio --level write` |
|
|
175
|
+
| Read-only | `claude mcp add fachwerk -- uvx fachwerk-mcp stdio --level read` |
|
|
176
|
+
| A fixed project, whatever folder you start in | `claude mcp add fachwerk -- uvx fachwerk-mcp stdio --root ~/projects/app` |
|
|
177
|
+
| The shared server (`fachwerk-mcp serve`) | `claude mcp add --transport http fachwerk http://127.0.0.1:8808/mcp --header "Authorization: Bearer <token>"` |
|
|
178
|
+
|
|
179
|
+
Check with `claude mcp list`, or `/mcp` inside Claude Code. The tools show up as
|
|
180
|
+
`mcp__fachwerk__code_*`. Claude Code keeps its own `Edit` and `Write` tools next to them; to make
|
|
181
|
+
the write gate the only way to change files, deny those two in your permission settings
|
|
182
|
+
(`"permissions": {"deny": ["Edit", "Write"]}` in `.claude/settings.json`), so every edit has to
|
|
183
|
+
pass the checks. Run `/mcp` to reconnect after you update `fachwerk-mcp`.
|
|
184
|
+
|
|
185
|
+
## Learn more
|
|
186
|
+
|
|
187
|
+
[Quick start in detail](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/quickstart.md) ·
|
|
188
|
+
[The write gate](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/write-gate.md) ·
|
|
189
|
+
[How the gate checks](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/gate.md) ·
|
|
190
|
+
[Made for Python](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/python.md) ·
|
|
191
|
+
[Tools and access levels](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/tools.md) ·
|
|
192
|
+
[Projects, caches, language servers](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/projects.md) ·
|
|
193
|
+
[Architecture](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/architecture.md) ·
|
|
194
|
+
[Security](https://github.com/manfred-kaiser/fachwerk-mcp/blob/main/docs/security.md)
|
|
195
|
+
|
|
196
|
+
Built on the official [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk). MIT licensed.
|