Skip to content

API Reference parrot.flows.dev_loop.mcp_profiles

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.flows.dev_loop.mcp_profiles

View source

Shared MCP helpers for dev-loop / dev-flow dispatch profiles.

The research seats of both flows (dev_loop.ResearchNode and dev_flow.IdeationNode) dispatch headless Claude Code sessions with strict_mcp_config=True (see ClaudeCodeDispatchProfile), which makes the dispatched CLI ignore any filesystem .mcp.json. Reaching an MCP server from such a dispatch therefore requires BOTH the explicit server config on profile.mcp_servers AND the matching mcp__... allow rules on profile.allowed_tools. This module centralizes the pieces both nodes need so they share one mechanism instead of forking it:

  • the read-only wikitoolkit graph-search server entry (FEAT-482 Module 6, originally private to dev_flow/nodes/ideation.py), and
  • the allow-rule derivation for arbitrary caller-supplied servers — e.g. the FEAT-485 parrot mcp-local <toolkit> servers.

Attribute WIKI_MCP_TOOLS

Type: tuple[str, ...]

Function derive_mcp_tool_names

Derive server-level allow rules for a set of MCP servers.

Claude Code accepts a bare mcp__<serverName> allow rule meaning "every tool of that server". Enumerating per-tool names would require importing every toolkit class in the calling process, so this is the default when the caller does not supply an explicit tool list.

derive_mcp_tool_names(mcp_servers: Mapping[str, Any]) -> List[str]

Parameter Type Default Description
mcp_servers Mapping[str, Any] Mapping of server name → server config (the same shape as ClaudeCodeDispatchProfile.mcp_servers).

Returns: List[str] — Sorted ["mcp__<name>", ...] rules, one per server.

Function resolve_wikitoolkit_command

Resolve the wikitoolkit CLI path robustly.

The repo's own .mcp.json hardcodes an absolute venv path, which would break in any other checkout/environment. Resolve it the same way any other console-script installed into the running interpreter's venv is found: PATH first (shutil.which), then a same-directory-as-sys.executable fallback (covers a venv whose bin/ is not on PATH but IS where the running Python lives).

resolve_wikitoolkit_command() -> str

Returns: str — The resolved wikitoolkit command path, or the bare "wikitoolkit" string as a last resort (lets the CLI's own "not found" error surface instead of silently omitting the tool).

Function wikitoolkit_mcp_entry

Build the stdio server config for the wikitoolkit MCP server.

wikitoolkit_mcp_entry() -> Dict[str, Any]

Returns: Dict[str, Any] — A Claude Code MCP server config dict suitable as the value of a "wikitoolkit" key in ClaudeCodeDispatchProfile.mcp_servers.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally