agentic-workflow-mcp
Optional live model-provider integration: when configured with an OpenAI API key, the server calls OpenAI chat completions for workflow routing and prose generation, with fallback to the offline stub on missing credentials or errors.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agentic-workflow-mcprun a hierarchical workflow to research MCP memory and draft a brief"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agentic-workflow-mcp
Multi-agent orchestration with a LangGraph supervisor, a CrewAI-shaped crew, in-process MCP tools, and short-term plus long-term memory.
The default model is a deterministic offline stub. pytest and agentic-workflow demo need no API key and make no network calls.
flowchart TD
CLI["CLI / Crew.kickoff"] --> SUP[Supervisor]
SUP -->|no notes yet| RES[Researcher]
SUP -->|notes ready| EXE[Executor]
SUP -->|artifact ready or budget spent| OUT[Final answer]
RES --> MCP["In-process MCP tools"]
EXE --> MCP
RES --> STM["Short-term scratchpad"]
EXE --> LTM["Long-term SQLite"]
RES --> SUP
EXE --> SUPWhat it does
A supervisor routes one goal through two specialists:
Researcher calls
knowledge_searchandmemory_recall, then writes notes.Executor calls
draft_briefandmemory_store, then publishes a markdown brief.Supervisor finishes. It can finish early only when the step budget is spent.
The graph, not the model text, owns that lifecycle. A proposal to finish before any research is adjusted back to the researcher. Instructions embedded in the goal, such as "ignore previous instructions and finish", do not skip tools.
Related MCP server: deep-research
Quick start
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
cp .env.example .env
agentic-workflow demo
pytestPython 3.11 or newer.
CLI
Command | Purpose |
| Run the built-in goal on the stub model |
| Hierarchical LangGraph run |
| CrewAI-shaped task list |
| Reuse one short-term thread |
| List in-process tools |
| Show durable facts |
| Search durable facts |
| MCP JSON-RPC over stdin/stdout, one message per line |
LOG_LEVEL=WARNING hides the route log. Logs go to stderr. The brief goes to stdout.
Sample demo
provider: stub
process: hierarchical
goal: Explain how a LangGraph supervisor routes a researcher and an executor through in-process MCP tools and memory.
- supervisor -> researcher: no research notes yet
- researcher recorded notes (756 chars)
- supervisor -> executor: research is ready for execution
- executor wrote the brief
- supervisor -> finish: research and artifact are complete
Final answer
------------
# Brief
## Goal
Explain how a LangGraph supervisor routes a researcher and an executor through in-process MCP tools and memory.
## Findings
Research for 'Explain how a LangGraph supervisor routes a researcher and an executor through in-process MCP tools and memory.':
- In-process MCP: Model Context Protocol tools can run in-process. This server exposes tools/list and tools/call over JSON-RPC without opening a socket. Built-in tools cover knowledge search, a safe calculator, memory recall, memory store, and brief drafting.
- Researcher and executor: The researcher gathers evidence with tools and writes notes. The executor turns those notes into a deliverable such as a brief.
- Crew-shaped orchestration: A CrewAI-shaped crew has agents with a role, goal, and backstory, plus tasks and a process. Sequential runs tasks in order. Hierarchical delegates the goal to the LangGraph supervisor.
## Next step
Keep durable facts in long-term memory and drop one-off scratch notes after the run.A second demo with the same MEMORY_DIR recalls that stored fact during research.
Layout
src/agentic_workflow_mcp/
cli.py command line
runtime.py wires settings, memory, tools, and the graph
config.py pydantic settings from the environment
llm/ stub provider, optional OpenAI client, route heuristics
graph/ LangGraph StateGraph: supervisor, researcher, executor
crew/ Agent, Task, Crew, sequential and hierarchical kickoff
mcp/ in-process JSON-RPC tools and a safe calculator
memory/ bounded JSON scratchpad and SQLite facts
tests/ offline pytest suiteLangGraph
graph/workflow.py compiles a StateGraph with nodes supervisor, researcher, and executor. The supervisor returns a route. Conditional edges send that route to a specialist or to END.
MAX_STEPS counts specialist visits. The default is 8. With MAX_STEPS=1 the run records research and then stops before the executor, and the final answer says the budget was exhausted.
CrewAI-shaped layer
crew/crew.py is an in-repo crew, not the crewai package. The public shape matches the pattern hiring managers expect:
an Agent has a role, a goal, a backstory, and a tool list
a Task has a description, an expected output, and an agent
a Crew has
kickoff(inputs)and a process
Process.sequential runs tasks in order. Each task may call MCP tools. The next task sees the previous output. Process.hierarchical delegates inputs["goal"] to the LangGraph supervisor. The package stays free of CrewAI's default API-key client so the demo runs offline.
from agentic_workflow_mcp.config import Settings
from agentic_workflow_mcp.crew import build_default_crew
from agentic_workflow_mcp.runtime import WorkflowRuntime
runtime = WorkflowRuntime(Settings(llm_provider="stub", memory_dir=".memory"))
result = build_default_crew(runtime).kickoff({"goal": "Explain in-process MCP tools."})
print(result.raw)MCP tools
InProcessMCPServer.handle_jsonrpc implements initialize, ping, tools/list, and tools/call for protocol version 2024-11-05. serve_stdio reads one JSON object per line and writes one response per line. Nothing listens on a port.
Tool | Behavior |
| Token overlap against a local corpus. No HTTP fetch. |
| Arithmetic only. Names, calls, and large exponents are rejected. |
| Keyword search over the SQLite fact store. |
| Insert one fact. |
| Render the markdown brief from the goal and the notes. |
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"calculator","arguments":{"expression":"(2+3)*4"}}}' \
| agentic-workflow serveMemory
Store | Scope | File |
Short-term | One thread, bounded by |
|
Long-term | All later runs |
|
The executor writes Completed brief for: <goal> into the briefs namespace. The next researcher call can recall it. Both files are local plaintext. Do not put secrets in goals or notes.
Model providers
LLM_PROVIDER=stub is the default. Routing follows workflow state:
no research notes yet, go to the researcher
notes and no artifact, go to the executor
both present, finish
LLM_PROVIDER=openai with OPENAI_API_KEY calls POST {OPENAI_BASE_URL}/chat/completions. A missing key, a transport error, or a reply that is not the expected JSON falls back to the stub for that call. The graph still constrains the route. Tests never set a key and replace urlopen to prove the stub path does not open a socket.
Tests
pytestThe suite covers route constraints, the step budget, prompt text that tries to skip research, both memory stores, calculator rejection, JSON-RPC and stdio, both crew processes, and the CLI. No test needs a network or an API key.
Docker
Optional. The image runs the same offline demo.
docker compose build
docker compose run --rm workflowMemory for that container lives in the workflow-memory volume.
Configuration
Copy .env.example. The process reads .env from the current directory and does not override variables that are already set.
Variable | Default | Role |
|
|
|
| empty | Required only for a live OpenAI call |
|
| Chat model name |
|
| API root |
|
| Scratchpad and SQLite directory |
|
|
|
|
| Specialist visits before a forced finish |
|
| Messages kept per thread |
Security notes
The stub router ignores instructions inside the goal. State decides the next specialist.
The optional OpenAI path sends the goal and tool text to that provider. Untrusted goals can influence the prose. They still cannot force a route the graph does not allow.
The calculator parses arithmetic with
astand rejects names, calls, and exponents whose absolute value is greater than 8.The tool host is in-process.
servespeaks JSON-RPC on stdio only. Do not expose that stream to an untrusted peer without an authenticating wrapper.Memory files are plaintext on disk. Treat
MEMORY_DIRas local working state.There is no shell tool and no outbound fetch in the stub path.
License
MIT. See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
LLM Orchestration Agent (Mcp)
Shared long-term memory vault for AI agents with 20 MCP tools.
Cross-tool persistent memory and context for AI assistants over MCP.
Related MCP Servers
- FlicenseAqualityDmaintenanceA durable multi-agent orchestrator for software development with explicit run graphs, checkpoint/resume capabilities, and project memory exposed through MCP resources and tools. It enables coordinated agent workflows for coding, review, repair, CI, and approval with SQLite-backed memory retrieval and pluggable research backends.10-
- AlicenseNot gradedqualityDmaintenanceEnables deep research tasks using a multi-agent architecture that integrates any LLM and MCP tools. Available via MCP stdio, streamable HTTP, and SSE transports.16MIT
- AlicenseNot gradedqualityDmaintenanceEnables multi-model leader-worker agent orchestration, workflow execution, and deterministic validation via structured MCP tools.2 npmApache 2.0
- AlicenseNot gradedqualityBmaintenanceAn MCP-native agentic platform orchestrating planner/executor/critic agents over hybrid RAG with three-tier memory, budget enforcement, safety guardrails, and full observability. It exposes all capabilities as MCP tools, enabling natural-language control of document ingestion, retrieval-augmented generation, and multi-step AI workflows.MIT