diff --git a/demos/README.md b/demos/README.md index f874ca0349..0bdf2f8e9f 100644 --- a/demos/README.md +++ b/demos/README.md @@ -88,3 +88,4 @@ Integrations |[Integration with Open WebUI](integration_with_OpenWebUI/README.md)|Using Open WebUI with OVMS as inference provider. Shows text and image generation as well as usage with RAG and tools.| |[Visual Studio Code assistant](./code_local_assistant/README.md)|Use Continue extension in Visual Studio Code with local OVMS serving.| |[Cline coding agent integration](./cline_integration/README.md)|Use the Cline coding agent in Visual Studio Code with local OVMS serving, including MCP, image input and reasoning_effort usage.| +|[Integration with DeepAgents Code](integration_with_deepagents_code/README.md)|Using DeepAgents Code with OVMS as inference provider. Shows MCP server creation, subagent-based validation and tool use.| diff --git a/demos/continuous_batching/structured_output/README.md b/demos/continuous_batching/structured_output/README.md index a282d21d59..5c3c1d4071 100644 --- a/demos/continuous_batching/structured_output/README.md +++ b/demos/continuous_batching/structured_output/README.md @@ -15,9 +15,9 @@ There are no extra steps needed to use structured output. Whole behavior is trig **Required:** Docker Engine installed ```bash -mkdir models +mkdir -p ${HOME}/models export GPU_ARGS=$(if ls /dev/dri/render* >/dev/null 2>&1; then echo "--device /dev/dri --group-add $(stat -c '%g' /dev/dri/render* | head -n1)"; fi) -docker run ${GPU_ARGS} --user $(id -u):$(id -g) -d --rm -p 8000:8000 -v $(pwd)/models:/models:rw openvino/model_server:latest-gpu --source_model OpenVINO/Mistral-7B-Instruct-v0.3-int4-cw-ov --model_repository_path /models --rest_port 8000 +docker run ${GPU_ARGS} --user $(id -u):$(id -g) -d --rm -p 8000:8000 -v ${HOME}/models:/models:rw openvino/model_server:latest-gpu --source_model OpenVINO/Mistral-7B-Instruct-v0.3-int4-cw-ov --model_repository_path /models --rest_port 8000 ``` ::: :::{tab-item} On Baremetal Host Windows diff --git a/demos/integration_with_deepagents_code/.deepagents/.mcp.json b/demos/integration_with_deepagents_code/.deepagents/.mcp.json new file mode 100644 index 0000000000..80c0097c92 --- /dev/null +++ b/demos/integration_with_deepagents_code/.deepagents/.mcp.json @@ -0,0 +1,10 @@ +{ + "mcpServers": { + "time-server": { + "command": "python", + "args": [ + "${DEMO_DIR}/mcp_server/time_mcp_server.py" + ] + } + } +} \ No newline at end of file diff --git a/demos/integration_with_deepagents_code/.deepagents/agents/mcp-tester/AGENTS.md b/demos/integration_with_deepagents_code/.deepagents/agents/mcp-tester/AGENTS.md new file mode 100644 index 0000000000..20f9cf2752 --- /dev/null +++ b/demos/integration_with_deepagents_code/.deepagents/agents/mcp-tester/AGENTS.md @@ -0,0 +1,49 @@ +--- +name: mcp-tester +description: Verifies local Python MCP stdio servers by static checks and short runtime startup checks. +model: openai:OpenVINO/Qwen3.8-27B-int4-ov +--- + +You are a focused subagent for MCP server verification. +Be concise. Do not explain your reasoning. +Do not produce plans or long commentary. + +Goal: +- Verify that a local Python MCP stdio server is runnable. +- Return a short pass/fail report with concrete evidence. + +What this subagent is responsible for: +- Inspect the target server script. +- Verify required elements exist: FastMCP usage, at least one @mcp.tool, and stdio run call. +- Run a syntax/import check: `python -m py_compile `. +- Run a short startup check: `timeout 2s python `. +- Read `.deepagents/.mcp.json` and confirm there is a matching stdio entry. + +What this subagent is not responsible for: +- Writing or changing MCP config files. +- Refactoring unrelated project files. +- Long prose explanations. + +Rules: +- Resolve paths from the current working directory. +- Treat `python -m py_compile ` as authoritative for syntax: any unterminated string, malformed docstring quote, or other parse error is a hard FAIL. +- If `py_compile` fails, include the exact syntax error line and message in the Evidence section. +- If `timeout 2s python ` exits with 124, treat that as expected for a long-running stdio server if no traceback appears. +- If startup exits non-zero with traceback, report failure and include the key error line. +- Do not claim success without command output evidence. +- Never return placeholders or template tokens such as `%stdio*`, `%args%`, ``, ``, or `PASS/FAIL` literals without resolved values. +- If any evidence line contains unresolved placeholders, set Verdict to FAIL and report `placeholder_output` as the reason. +- Keep output short. + +Output format: +1. Verdict: PASS or FAIL. +2. Checks: + - script_structure: PASS/FAIL + - py_compile: PASS/FAIL + - startup_timeout_run: PASS/FAIL + - mcp_config_match: PASS/FAIL +3. Evidence: exactly 4 lines, one per check, each containing: + - the exact command run, + - exit code, + - one concrete output fragment (stdout/stderr snippet or "no output"). +4. If FAIL: a brief description of what failed, naming the failing check(s) and the key error or missing condition. diff --git a/demos/integration_with_deepagents_code/.deepagents/skills/python-mcp-sdk-skill/SKILL.md b/demos/integration_with_deepagents_code/.deepagents/skills/python-mcp-sdk-skill/SKILL.md new file mode 100644 index 0000000000..51f848f4d2 --- /dev/null +++ b/demos/integration_with_deepagents_code/.deepagents/skills/python-mcp-sdk-skill/SKILL.md @@ -0,0 +1,89 @@ +--- +name: python-mcp-sdk-skill +description: "Guidance for implementing Python MCP SDK stdio servers with FastMCP, robust validation, and deterministic tool output." +license: MIT +compatibility: designed for deepagents-code +--- + +# Python MCP SDK Server Builder + +Use this skill when the user asks to create or modify an MCP server in Python. + +## Goal +Build a minimal, production-safe MCP stdio server using the Python MCP SDK package `mcp`. + +## Implementation pattern + +1. Create `mcp_server/_mcp_server.py`. +2. Use `FastMCP`. +3. Register one or more `@mcp.tool()` functions. +4. Add explicit docstrings and strict input validation. +5. Start with `mcp.run(transport="stdio")`. + +## Required template + +```python +from mcp.server.fastmcp import FastMCP +from mcp.types import ToolAnnotations + +mcp = FastMCP("your-server-name") + +# Reusable annotations for tools that only read state and never mutate anything. +READ_ONLY = ToolAnnotations( + readOnlyHint=True, + destructiveHint=False, + idempotentHint=True, + openWorldHint=False, +) + + +@mcp.tool(annotations=READ_ONLY) +def your_tool_name(arg: str) -> str: + """Describe exactly what this tool returns.""" + value = arg.strip() + if not value: + raise ValueError("arg cannot be empty") + return value + + +if __name__ == "__main__": + mcp.run(transport="stdio") +``` + +## Tool annotations — MANDATORY + +Every `@mcp.tool()` MUST declare MCP tool annotations. Annotations tell hosts (like dcode) whether a tool is safe to call without user approval. Tools with no annotations are treated as "possibly mutating" and are rejected outright in dcode headless mode (`dcode -n ...`) with: + +> "This MCP action requires approval, but the current headless runtime has no approval UI." + +dcode's `HeadlessMCPGuardMiddleware` gates any tool whose metadata does not satisfy BOTH: +- `readOnlyHint is True` +- `destructiveHint is not True` + +Choose the annotation set that matches the tool's real behavior: + +| Tool behavior | Annotations | +|---------------------------------------------------|---------------------------------------------------------------------------------------------------------------------| +| Pure read (clock, config lookup, HTTP GET) | `readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=False` | +| Read that consults an external service (web/API) | `readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=True` | +| Idempotent write (set a value; same input twice = same result) | `readOnlyHint=False, destructiveHint=False, idempotentHint=True, openWorldHint=` | +| Destructive write (delete, drop, DROP TABLE, rm) | `readOnlyHint=False, destructiveHint=True, idempotentHint=False, openWorldHint=` | + +Never claim `readOnlyHint=True` for a tool that mutates state. Lying to skip the approval gate is a security issue. + +For tools that are NOT read-only, users must run them from the interactive TUI (approval required); document that limitation in the tool's docstring. + +## Time tool recipe + +When the user needs exact current time, expose: +- `get_current_utc_iso8601()` returning UTC timestamp in ISO 8601 with trailing Z. +- Optional timezone helper for named zones using `zoneinfo`. + +Both are pure reads → annotate with `READ_ONLY` (see template above). + +## Quality checks + +- Avoid third-party dependencies beyond `mcp`. +- Do not use network calls unless required. +- Keep tool outputs deterministic and machine-readable. +- **Every tool must have `ToolAnnotations` matching its real behavior** — see the table above. Verify by running the tool from `dcode -n` after implementation; if it fails with the "approval, but the current headless runtime has no approval UI" message, the annotations are missing or wrong. diff --git a/demos/integration_with_deepagents_code/README.md b/demos/integration_with_deepagents_code/README.md new file mode 100644 index 0000000000..ea035b9c79 --- /dev/null +++ b/demos/integration_with_deepagents_code/README.md @@ -0,0 +1,431 @@ +# DeepAgents Code Integration Demo {#ovms_demos_integration_with_deepagents_code} + +## Description + +This demo presents [OpenVINO Model Server (OVMS)](https://github.com/openvinotoolkit/model_server) integration with [DeepAgents Code](https://github.com/langchain-ai/deepagents) (`dcode`), an open coding agent. You run a model on OVMS, point `dcode` at it with a single environment variable, and then use the agent to build and call a custom MCP tool — all served locally, with no cloud model and no provider lock-in. + +### How it fits together + +```text +frontend (dcode) ──OpenAI API──▶ OVMS ──▶ OpenVINO model (GPU / CPU / NPU) +``` + +- **OVMS** runs the model locally and exposes `http://localhost:8000/v1` (OpenAI-compatible). +- **dcode** is configured with `OPENAI_BASE_URL` pointing at that endpoint — that single line is the whole integration. +- On top of that connection you add an **MCP tool**, validate it with a **subagent**, and call it end to end. + +## Setup + +### Prerequisites + +This demo deploys OpenVINO Model Server with a Docker container (Linux) or the native `ovms.exe` (Windows), and installs `dcode` via Python pip. + +Requirements: +* Intel x86_64 host, Linux or Windows +* [Docker Engine](https://docs.docker.com/engine/) on Linux +* Python 3.12+ with pip +* HuggingFace access to `OpenVINO/Qwen3.8-27B-int4-ov` (auto-downloaded on first OVMS start) + +This demo was tested on an Intel host with 32 GB RAM and GPU VRAM extended via Intel Graphics Software. Smaller-memory systems may also work; if you hit memory limits, switch to a smaller model from the [preconfigured OpenVINO models](https://huggingface.co/OpenVINO) catalog. + +### Step 1: Start OVMS + +The model is auto-pulled on first start if it is not already present in the model repository. + +::::{tab-set} +:::{tab-item} Linux +:sync: Linux +```bash +mkdir -p ${HOME}/models +export GPU_ARGS=$(if ls /dev/dri/render* >/dev/null 2>&1; then echo "--device /dev/dri --group-add $(stat -c '%g' /dev/dri/render* | head -n1)"; fi) +docker run -d ${GPU_ARGS} -u $(id -u):$(id -g) \ + -v ${HOME}/models:/models -p 8000:8000 openvino/model_server:latest-gpu \ + --rest_port 8000 --model_repository_path /models \ + --source_model OpenVINO/Qwen3.8-27B-int4-ov +``` +::: +:::{tab-item} Windows +:sync: Windows +```bat +mkdir c:\models +ovms.exe --source_model OpenVINO/Qwen3.8-27B-int4-ov --model_repository_path c:\models --model_name OpenVINO/Qwen3.8-27B-int4-ov --rest_port 8000 +``` +::: +:::: + +Readiness checks: + +```console +curl -f http://localhost:8000/v1/models +``` + + +### Step 2: Install dependencies + +::::{tab-set} +:::{tab-item} Linux +:sync: Linux +```bash +python -m pip install --upgrade pip +python -m pip install 'deepagents-code==0.1.70' 'mcp<2' +``` +::: +:::{tab-item} Windows +:sync: Windows +```bat +python -m pip install --upgrade pip +python -m pip install "deepagents-code==0.1.70" "mcp<2" colorama +``` + +`colorama` is required by the console renderer on Windows. +::: +:::: + +> On Windows, use a short relative working directory such as `demo` or `dcode-demo`; dcode may reject absolute paths with `Error: Windows absolute paths are not supported`. + +### Step 3: Clone OVMS repository and enter demo directory + +If you do not already have the OVMS repository checked out locally, clone it and change into the demo directory. + +::::{tab-set} +:::{tab-item} Linux +:sync: Linux +```bash +git clone https://github.com/openvinotoolkit/model_server.git +cd model_server/demos/integration_with_deepagents_code +``` +::: +:::{tab-item} Windows +:sync: Windows +```bat +git clone https://github.com/openvinotoolkit/model_server.git +cd model_server\demos\integration_with_deepagents_code +``` +::: +:::: + +If you already have the repository checked out, just change into `demos/integration_with_deepagents_code`. + +### Step 4: Prepare dcode configuration + +The only line that actually connects `dcode` to OVMS is `OPENAI_BASE_URL=http://localhost:8000/v1` — everything else below is dcode convenience configuration. First export the environment variables below: + +::::{tab-set} +:::{tab-item} Linux +:sync: Linux +```bash +export OPENAI_API_KEY=not_used +export OPENAI_BASE_URL=http://localhost:8000/v1 +export TAVILY_API_KEY=not_used +export DEEPAGENTS_CODE_PRICES_AUTO_UPDATE=0 +export DEMO_DIR="$PWD" +``` +::: +:::{tab-item} Windows +:sync: Windows +```bat +set OPENAI_API_KEY=not_used +set OPENAI_BASE_URL=http://localhost:8000/v1 +set TAVILY_API_KEY=not_used +set DEEPAGENTS_CODE_PRICES_AUTO_UPDATE=0 +set DEMO_DIR=%CD% +``` +::: +:::: + +Then set the default model so later `dcode` invocations don't need to repeat `--model`. This writes `~/.deepagents/config.toml` and exits immediately: + +```text +dcode --default-model openai:OpenVINO/Qwen3.8-27B-int4-ov +``` + +- **`OPENAI_BASE_URL`**: points dcode at the OVMS endpoint. +- **`OPENAI_API_KEY=not_used`**: OVMS does not require a key for local serving, but the OpenAI client library expects the variable to be set. +- **`TAVILY_API_KEY=not_used`**: silences the web-search key warning; the demo never invokes web search, so the placeholder is inert. +- **`DEEPAGENTS_CODE_PRICES_AUTO_UPDATE=0`**: avoids external pricing refresh. +- **`DEMO_DIR`**: expanded inside [`.deepagents/.mcp.json`](https://github.com/openvinotoolkit/model_server/blob/main/demos/integration_with_deepagents_code/.deepagents/.mcp.json) so the MCP server script is located reliably. + +dcode uses git to track file state and pins its project root (and its skill / MCP / subagent discovery) at the closest `.git` directory. Initialize a repository *inside the demo folder* so dcode scopes to it, even when the folder itself lives inside another checkout (like the `model_server` clone): + +```text +git init +``` + +--- + +## Demo flow + +Start `dcode` session and follow the steps below in order. + +### Step 1: Start dcode + +Launch dcode with a locked-down tool surface. + +Run deepagents code with a limited set of tools: + +```text +dcode --allow-fs-tools read_file,write_file,grep,ls,execute -S python,python3,timeout,cat,grep,ls --no-interpreter --trust-project-mcp +``` + +Parameter notes: +- `--allow-fs-tools`: controls exposed local tools. `execute` is needed for runtime checks. +- `-S ...`: shell allow-list for `execute` command safety. +- `--no-interpreter`: disables js_eval middleware. +- `--trust-project-mcp`: auto-trusts project MCP configuration. + +![dcode start](./screenshots/dcode_start.jpg) + +### Step 2: Ask agent to summarize demo + +Start with a broad, low-risk prompt so the agent explores the working directory, loads project files into its context and confirms that OVMS is reachable. This also warms up prefix caching on the server for later turns. + +```text +Summarize demo in current directory. +``` + +First response can be slower because initial dcode context is large. Later turns are typically faster due to prefix caching. + +![demo summary](./screenshots/demo_summary.jpg) + +### Step 3: Create MCP server + +The project ships with a preconfigured MCP client entry in [`.deepagents/.mcp.json`](https://github.com/openvinotoolkit/model_server/blob/main/demos/integration_with_deepagents_code/.deepagents/.mcp.json), but the actual server script does not exist yet. In interactive mode, dcode surfaces this as a tool-loading error — a good signal that the agent is aware of the MCP configuration. Ask the agent to create the script using the project skill located at [`.deepagents/skills/python-mcp-sdk-skill/SKILL.md`](https://github.com/openvinotoolkit/model_server/blob/main/demos/integration_with_deepagents_code/.deepagents/skills/python-mcp-sdk-skill/SKILL.md). Invoking a skill with `/skill:` gives the agent a focused, tested recipe instead of relying on generic knowledge: + +```text +/skill:python-mcp-sdk-skill implement a Python MCP stdio server at mcp_server/time_mcp_server.py that provides current UTC time using the Python MCP SDK. +``` + +![MCP server created](./screenshots/server_created.jpg) + +### Step 4: Extend MCP server with date tool + +Use `/goal` to switch the agent into goal mode: it will propose acceptance criteria, iterate on the implementation and self-grade the result against those criteria. This is a good fit for incremental changes on top of an existing file. + +```text +/goal Extend mcp_server/time_mcp_server.py with date tool. +``` + +First the agent negotiates acceptance criteria for the change: + +![acceptance criteria](./screenshots/acceptance_criteria.jpg) + +Then it works towards those criteria: + +![goal completed](./screenshots/goal_completed.jpg) + +And finally grades its own output: + +![grader result](./screenshots/grader.jpg) + +Once the goal is satisfied, clear it so subsequent prompts run in normal mode: + +```text +/goal clear +``` + +### Step 5: Validate MCP server with subagent + +Instead of running tests in the main context, delegate validation to a dedicated subagent. This keeps the main conversation focused. The subagent definition lives in: + +- [`.deepagents/agents/mcp-tester/AGENTS.md`](https://github.com/openvinotoolkit/model_server/blob/main/demos/integration_with_deepagents_code/.deepagents/agents/mcp-tester/AGENTS.md) + +`mcp-tester` verifies static structure and runtime behavior of the MCP server and returns a concise `PASS`/`FAIL` verdict. + +```text +Delegate to subagent mcp-tester: +Test mcp_server/time_mcp_server.py +``` + +![tester validation](./screenshots/tester.jpg) + +If tester returns `FAIL`, main agent can proceed with fixes. If tester returns `PASS`, continue below. + +### Step 6: Reload MCP tools + +The MCP server is now on disk, but the current dcode session was started before it existed, so its tools are not yet registered. Use `/tools` to inspect the currently loaded tool list, then `/reload` to re-scan the MCP configuration without restarting dcode. + +```text +/tools +``` + +![tools before reload](./screenshots/tools_before.jpg) + +```text +/reload +/tools +``` + +![tools after reload](./screenshots/tools_after.jpg) + +### Step 7: Verify end-to-end tool call + +With the MCP tools now registered, issue a prompt that can only be answered correctly by calling the freshly created server. If the agent invokes the MCP tool and reports the real UTC time and date, the end-to-end integration is working. + +```text +Give me the exact current UTC timestamp down to the current second along with current date. +``` + +![final tool result](./screenshots/final.jpg) + +## Headless flow + +Use these one-shot commands for automation or quick verification. In this mode, each `dcode -n ...` invocation starts a fresh session and exits after producing a final response. The expected outputs below are illustrative — exact wording and values vary by model and run. + +### Step 1: Summarize demo + +```text +dcode -n "Summarize demo in current directory." --allow-fs-tools read_file,grep,ls --no-mcp --no-interpreter --quiet +``` + +
+Expected output + +```text +## Demo Summary: DeepAgents Code Integration with OpenVINO Model Server + +This demo (`integration_with_deepagents_code`) showcases how to integrate [DeepAgents Code](https://github.com/langchain-ai/deepagents) (`dcode`) with [OpenVINO Model Server (OVMS)](https://github.com/openvinotoolkit/model_server) using OpenAI-compatible endpoints. + +### Architecture + +- **OVMS** serves an OpenVINO model (`OpenVINO/Qwen3.8-27B-int4-ov`) via a Docker container on port `8000` +- **dcode** connects to OVMS via `OPENAI_BASE_URL=http://localhost:8000/v1` +- An **MCP stdio server** (`mcp_server/time_mcp_server.py`) provides `time` and `date` tools to agents +- A **subagent** (`mcp-tester`) validates the MCP server's structure and runtime behavior + +### Demo Flow (6 Steps) + +| Step | Description | +|------|-------------| +| 1 | Ask agent to summarize the demo (exploration + OVMS reachability check) | +| 2 | Agent creates the MCP server using `python-mcp-sdk-skill` | +| 3 | Agent extends the server with a `date` tool (via `/goal` acceptance-criteria loop) | +| 4 | Subagent `mcp-tester` validates the server statically and at runtime | +| 5 | Reload MCP tools in the current session (`/reload`) | +| 6 | End-to-end tool use — agent calls `time` + `date` MCP tools to answer a real prompt | + +### Key Components + +- **Config**: `.deepagents/.mcp.json` declares the `time-server` MCP endpoint +- **Agent**: `.deepagents/agents/mcp-tester/` defines the validation subagent +- **Skill**: `.deepagents/skills/python-mcp-sdk-skill/` provides the MCP server scaffolding recipe +- **Screenshots**: `screenshots/` contains visual reference images for each step + +### Use Cases + +- **Interactive**: Type prompts into the dcode TUI for hands-on learning +- **Headless**: Run `dcode -n "..." --quiet` for CI/automation scripts +``` + +
+ +### Step 2: Create MCP server + +```text +dcode -n "Implement a Python MCP stdio server at mcp_server/time_mcp_server.py that provides current UTC time using the Python MCP SDK." --skill python-mcp-sdk-skill --allow-fs-tools read_file,write_file,grep,ls,execute -S python,python3,timeout,cat,grep,ls --no-mcp --no-interpreter --quiet +``` + +
+Expected output + +```text +Created `mcp_server/time_mcp_server.py` with: + +- `get_current_utc_iso8601()` tool returning the current UTC time as an ISO 8601 string with trailing `Z`. +- No third-party dependencies beyond `mcp`. +- No network calls. Deterministic, machine-readable output. +``` + +
+ +### Step 3: Extend MCP server with date tool + +```text +dcode -n "Extend mcp_server/time_mcp_server.py with a date tool." --rubric "mcp_server/time_mcp_server.py defines a new @mcp.tool returning the current UTC date as an ISO string; the existing time tool still works; python -m py_compile mcp_server/time_mcp_server.py succeeds." --allow-fs-tools read_file,write_file,grep,ls,execute -S python,python3,timeout,cat,grep,ls --no-mcp --no-interpreter --quiet +``` + +
+Expected output + +```text +Done. Added `get_current_utc_date()` tool to `time_mcp_server.py`. It returns the current UTC date as an ISO 8601 string (`YYYY-MM-DD`). Compiles cleanly.⏳ Checking acceptance criteria… +✓ Acceptance criteria satisfied +``` + +
+ +### Step 4: Validate MCP server with subagent + +```text +dcode -n "Delegate to subagent mcp-tester: Test mcp_server/time_mcp_server.py" --allow-fs-tools read_file,grep,ls,execute -S python,python3,timeout,cat,grep,ls --no-mcp --no-interpreter --quiet +``` + +
+Expected output + +```text +**time_mcp_server.py — MCP Test Results: All PASSED ✅** + +| Check | Result | +|---|---| +| Script Structure | ✅ FastMCP, 2 tools, `mcp.run(transport="stdio")` | +| py_compile | ✅ Compiles cleanly (Python 3.12) | +| Startup Timeout | ✅ Exits cleanly (no TTY in sandbox) | +| MCP Config Match | ✅ `.deepagents/.mcp.json` references the correct server | +``` + +
+ +### Step 5: Verify end-to-end tool call + +```text +dcode -n "Give me the exact current UTC timestamp down to the current second along with current date." --allow-fs-tools read_file,grep,ls,execute -S python,python3,timeout,cat,grep,ls --trust-project-mcp --no-interpreter --quiet +``` + +
+Expected output + +```text +Current UTC timestamp: `2026-09-30T14:00:12.508579Z` + +Current UTC date: `2026-09-30` + +Full datetime: **Tuesday, September 30, 2026 at 14:00:12 UTC** +``` + +
+ +If the agent instead returns *"This MCP action requires approval, but the current headless runtime has no approval UI"*, the tools in `mcp_server/time_mcp_server.py` are missing MCP `ToolAnnotations`. dcode's headless guard rejects any MCP tool whose metadata does not have `readOnlyHint=True` and `destructiveHint=False`. The `python-mcp-sdk-skill` used in Step 3 emits these annotations for read-only tools; if you edited the server by hand, re-run Step 3 or add the annotations manually. + +--- + +## Tips + +### Smaller tool surface + +By default, if `--allow-fs-tools` is not set, dcode enables the built-in filesystem tools. For open-weight models, reducing the tool surface can improve reliability and make the agent more predictable. + +Non-MCP tasks: + +```text +dcode --interpreter-tools safe --allow-fs-tools read_file,grep,glob,ls --no-mcp +``` + +MCP tasks: + +```text +dcode --interpreter-tools safe --allow-fs-tools read_file,grep,glob,ls,execute +``` + +If a task fails because a required tool is unavailable, restart dcode with a broader tool set. + +### Approval modes + +dcode supports several approval modes (Manual, Auto, YOLO) that trade off safety for autonomy. See the [official dcode documentation](https://docs.langchain.com/deepagents-code) for details on each mode and how to enable them. + +### Compacting conversation + +With `/offload` command the agent can reduce its context by dropping messages that are not relevant anymore. + +```text +/offload +``` diff --git a/demos/integration_with_deepagents_code/screenshots/acceptance_criteria.jpg b/demos/integration_with_deepagents_code/screenshots/acceptance_criteria.jpg new file mode 100644 index 0000000000..807546369f Binary files /dev/null and b/demos/integration_with_deepagents_code/screenshots/acceptance_criteria.jpg differ diff --git a/demos/integration_with_deepagents_code/screenshots/dcode_start.jpg b/demos/integration_with_deepagents_code/screenshots/dcode_start.jpg new file mode 100644 index 0000000000..a718b894ec Binary files /dev/null and b/demos/integration_with_deepagents_code/screenshots/dcode_start.jpg differ diff --git a/demos/integration_with_deepagents_code/screenshots/demo_summary.jpg b/demos/integration_with_deepagents_code/screenshots/demo_summary.jpg new file mode 100644 index 0000000000..472aebcdc7 Binary files /dev/null and b/demos/integration_with_deepagents_code/screenshots/demo_summary.jpg differ diff --git a/demos/integration_with_deepagents_code/screenshots/final.jpg b/demos/integration_with_deepagents_code/screenshots/final.jpg new file mode 100644 index 0000000000..6d543f5254 Binary files /dev/null and b/demos/integration_with_deepagents_code/screenshots/final.jpg differ diff --git a/demos/integration_with_deepagents_code/screenshots/goal_completed.jpg b/demos/integration_with_deepagents_code/screenshots/goal_completed.jpg new file mode 100644 index 0000000000..664d02b2ad Binary files /dev/null and b/demos/integration_with_deepagents_code/screenshots/goal_completed.jpg differ diff --git a/demos/integration_with_deepagents_code/screenshots/grader.jpg b/demos/integration_with_deepagents_code/screenshots/grader.jpg new file mode 100644 index 0000000000..5b2d2df38e Binary files /dev/null and b/demos/integration_with_deepagents_code/screenshots/grader.jpg differ diff --git a/demos/integration_with_deepagents_code/screenshots/server_created.jpg b/demos/integration_with_deepagents_code/screenshots/server_created.jpg new file mode 100644 index 0000000000..6dce4479f0 Binary files /dev/null and b/demos/integration_with_deepagents_code/screenshots/server_created.jpg differ diff --git a/demos/integration_with_deepagents_code/screenshots/tester.jpg b/demos/integration_with_deepagents_code/screenshots/tester.jpg new file mode 100644 index 0000000000..cc92e374e4 Binary files /dev/null and b/demos/integration_with_deepagents_code/screenshots/tester.jpg differ diff --git a/demos/integration_with_deepagents_code/screenshots/tools_after.jpg b/demos/integration_with_deepagents_code/screenshots/tools_after.jpg new file mode 100644 index 0000000000..ee28267b6b Binary files /dev/null and b/demos/integration_with_deepagents_code/screenshots/tools_after.jpg differ diff --git a/demos/integration_with_deepagents_code/screenshots/tools_before.jpg b/demos/integration_with_deepagents_code/screenshots/tools_before.jpg new file mode 100644 index 0000000000..1789a4634c Binary files /dev/null and b/demos/integration_with_deepagents_code/screenshots/tools_before.jpg differ diff --git a/demos/integrations.md b/demos/integrations.md index a886d1ab2b..9671c30ab7 100644 --- a/demos/integrations.md +++ b/demos/integrations.md @@ -8,6 +8,7 @@ maxdepth: 1 OpenWebUI VSC Continue dev Cline demo +DeepAgents Code ```