look at that users of @node. first, three variants
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
Main packages live under `src/`:
|
||||
- `wf_core`: workflow model, validation, runtime semantics, frames, trace, interrupts, foreach, async execution.
|
||||
- `wf_authoring`: ergonomic authoring layer including `@node`, `NodeSpec`, `WorkflowBuilder`, conditions, paths, and subgraph wrapping.
|
||||
- `wf_mcp`: MCP broker/proxy layer for managing multiple backend MCP connections, discovery/catalog snapshots, transparent FastMCP proxying, config/admin tools, and eventual workflow build/run integration.
|
||||
- `wf_mcp`: MCP broker/proxy layer for managing multiple backend MCP connections, transparent FastMCP proxying, live config/admin tools, hot reload, tool introspection, discovery/catalog snapshots, and eventual workflow build/run integration.
|
||||
|
||||
Important docs:
|
||||
- `readme.md`: running design notes and architecture.
|
||||
@@ -13,4 +13,20 @@ Important docs:
|
||||
- `wf_mcp_plan.md`: MCP proxy/broker/workflow integration plan.
|
||||
- `scratchpad.md`: rough design history.
|
||||
|
||||
Current MCP direction: transparent proxy mode is the main product path. Old broker tools remain useful for debugging/admin/catalog operations, but protocol-native FastMCP proxying exposes upstream tools/resources/prompts as first-class MCP capabilities.
|
||||
Current MCP direction:
|
||||
- Transparent proxy mode is the main product path.
|
||||
- Old broker mode remains useful for debugging/admin/catalog operations.
|
||||
- Protocol-native FastMCP proxying exposes upstream tools/resources/prompts as first-class MCP capabilities.
|
||||
- Current configured live connections have included `context7.default`, `serena.default`, and `everything.default`; treat `wf_mcp.config.json` as user-owned live state.
|
||||
- Direct Serena is configured outside `wf_mcp` and should be preferred for code navigation/editing because it does not reset when `wf-mcp` hot-reloads.
|
||||
|
||||
Recent `wf_mcp` capabilities:
|
||||
- Pydantic config boundary in `config_models.py`.
|
||||
- Config mutation boundary in `config_manager.py`.
|
||||
- Proxy validation in `proxy_validation.py`.
|
||||
- Transparent proxy runtime and manual hot reload in `transparent_proxy.py`.
|
||||
- Explicit name mapping in `names.py`.
|
||||
- Opaque cursor pagination helpers in `pagination.py`.
|
||||
- Admin tools under `wf.mcp_*`: list/get config, add/update/enable/disable/remove connection, reload config, list/get proxy tools.
|
||||
- `wf.mcp_list_proxy_tools` supports `connection_id`, `query`, `limit`, and `cursor`; returns `{tools, nextCursor, total}`.
|
||||
- `wf.mcp_get_proxy_tool` returns one detailed proxied tool row with schema where available.
|
||||
@@ -7,14 +7,24 @@ General:
|
||||
- Keep MCP proxy concepts separate from workflow-specific concepts like `outcome`.
|
||||
- Do not leak workflow-only fields into MCP `tools/list`.
|
||||
|
||||
MCP/proxy conventions:
|
||||
- Transparent proxy mode is the product path; old broker mode is secondary/debug/admin-oriented.
|
||||
- Admin tools live under the reserved namespace `wf.mcp_*`.
|
||||
- Upstream FastMCP names use Namespace behavior: `<connection_id>_<local_tool_name>`, e.g. `everything.default_echo`.
|
||||
- Keep name parsing and unmangling in `names.py`; do not scatter string slicing across modules.
|
||||
- Keep cursor mechanics in `pagination.py`; use opaque cursors and `nextCursor` to mirror MCP pagination style.
|
||||
- Keep config disk writes in `config_manager.py`; transparent proxy code should expose/administer behavior, not own JSON mutation details.
|
||||
- `wf_mcp.config.json` is user-owned live config. Do not edit/revert it unless explicitly asked.
|
||||
|
||||
Code style:
|
||||
- Use precise type hints and modern Python collection syntax (`list[str]`, `dict[str, Any]`).
|
||||
- Keep modules layered by responsibility; avoid stuffing everything into service/runtime files.
|
||||
- Prefer small helper modules when behavior becomes a boundary (`config_models.py`, `config_manager.py`, `proxy_validation.py`).
|
||||
- Prefer small helper modules when behavior becomes a boundary (`config_models.py`, `config_manager.py`, `proxy_validation.py`, `names.py`, `pagination.py`).
|
||||
- Validation should fail early with clear errors.
|
||||
- Tests should exercise behavior through public APIs/MCP calls where practical.
|
||||
- For MCP client `CallToolResult.structured_content`, guard for `None` in tests before subscripting; use helper assertions where useful.
|
||||
|
||||
Editing rules from repo collaboration:
|
||||
- Use `apply_patch` for manual code edits.
|
||||
- Do not revert user-owned changes.
|
||||
- Treat `wf_mcp.config.json` as user-owned live config unless explicitly asked.
|
||||
- Direct Serena MCP is available and can be used for semantic navigation/editing; onboarding is already complete.
|
||||
@@ -4,11 +4,12 @@ Use PowerShell on Windows from the repo root.
|
||||
|
||||
Testing:
|
||||
- `uv run --with pytest pytest -q`
|
||||
- Focused example: `uv run --with pytest pytest tests/test_wf_mcp_transparent_proxy.py -q`
|
||||
- Focused MCP proxy tests: `uv run --with pytest pytest tests/test_wf_mcp_transparent_proxy.py -q`
|
||||
- Focused names/pagination examples: `uv run --with pytest pytest tests/test_wf_mcp_names.py tests/test_wf_mcp_transparent_proxy.py -q`
|
||||
|
||||
Lint/type checks:
|
||||
- `uv run ruff check src/wf_mcp tests`
|
||||
- Focused basedpyright example: `uv run basedpyright src/wf_mcp/transparent_proxy.py --level error`
|
||||
- Focused basedpyright example: `uv run basedpyright src/wf_mcp/transparent_proxy.py src/wf_mcp/pagination.py --level error`
|
||||
|
||||
Formatting:
|
||||
- `uv run ruff format`
|
||||
@@ -19,6 +20,18 @@ CLI / MCP server:
|
||||
- Old broker mode: `uv run wf-mcp --config wf_mcp.config.json serve --mode broker`
|
||||
- Optional compatibility/search flags: `--resources-as-tools`, `--prompts-as-tools`, `--search-tools`
|
||||
|
||||
Useful live MCP admin tools exposed by `wf-mcp`:
|
||||
- `wf.mcp_list_connections`
|
||||
- `wf.mcp_get_config`
|
||||
- `wf.mcp_add_connection`
|
||||
- `wf.mcp_update_connection`
|
||||
- `wf.mcp_enable_connection`
|
||||
- `wf.mcp_disable_connection`
|
||||
- `wf.mcp_remove_connection`
|
||||
- `wf.mcp_reload_config`
|
||||
- `wf.mcp_list_proxy_tools`
|
||||
- `wf.mcp_get_proxy_tool`
|
||||
|
||||
Useful Windows shell commands:
|
||||
- Fast search: `rg "pattern" path`
|
||||
- List files: `Get-ChildItem -Force`
|
||||
|
||||
@@ -6,7 +6,12 @@ Before considering a code task done:
|
||||
- Run ruff on touched source/tests, usually `uv run ruff check src/wf_mcp tests` for MCP work.
|
||||
- Run focused basedpyright at error level for new or heavily changed files when type issues are likely.
|
||||
- Check `git status --short` and distinguish user-owned config changes from code changes.
|
||||
- For MCP/proxy changes, consider direct FastMCP client verification when Codex's native MCP tool registry is stale.
|
||||
- Summarize functional changes and verification results concisely.
|
||||
|
||||
Known environment note:
|
||||
- Windows sandbox may block commands with `CreateProcessAsUserW failed: 5`; retry important commands with escalation rather than working around via unsafe shell tricks.
|
||||
Recent known-good full-suite count after proxy tool pagination/detail work:
|
||||
- `48 passed, 1 skipped`
|
||||
|
||||
Known environment notes:
|
||||
- Windows sandbox may block commands with `CreateProcessAsUserW failed: 5`; retry important commands with escalation rather than working around via unsafe shell tricks.
|
||||
- Codex/native MCP tool schemas may not refresh dynamically after `wf-mcp` hot reload. A fresh client/session may be needed to see newly added MCP tools.
|
||||
Reference in New Issue
Block a user