Local AI Agent Workflow Using OpenCode, FastMCP, and DeepSeek-r1

A developer on r/LocalLLaMA describes moving beyond using LLMs as "glorified autocomplete" by implementing a local agentic workflow with OpenCode, FastMCP, and the DeepSeek-r1 model.
AGENTS.md Standard for Deterministic Prompts
The developer uses an AGENTS.md file as a deterministic manual that injects strict rules into the AI's system prompt. Examples include "Use Python 3.9, format with Ruff, absolutely no global variables." This approach aims to eliminate hallucinations from the start.
Local Subagents with DeepSeek-r1
Instead of using cloud APIs like Claude or GPT-4o for trivial tasks, they set up Ollama with the free deepseek-r1 model. They created specific subagents, such as one for testing defined in a pytest.md file. Key configurations include:
- Temperature set to 0.1
- Tools restricted: "pytest": true and "bash": false
This allows the AI to autonomously run test suites, read tracebacks, and fix syntax errors while being blocked from potentially dangerous commands like rm -rf.
FastMCP for Standardized Local Function Exposure
FastMCP is described as "the 'USB-C' of AI"—similar to FastAPI but for AI agents. With about 5 lines of Python, you can spin up a local server to expose secure local functions (like querying a development database) in a standardized way that any OpenCode agent can consume.
A critical implementation tip: route all Python logs to stderr because the MCP protocol runs over stdio. Leaving a standard print() statement can corrupt the JSON-RPC packet and drop the connection.
The developer notes they recorded a video coding this entire architecture from scratch and setting up the local environment in about 15 minutes.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Native macOS MCP Server for Full OS Control
A native macOS server provides 24 tools for pixel-accurate clicks, key combos, drag-and-drop, app management, multi-display support, and clipboard access. It's open source and works with Claude Code, Cursor, or any MCP client.

Ctxpact: Context Compaction Proxy for Local LLMs
Ctxpact is an OpenAI-compatible proxy that compresses oversized inputs for local LLMs with 16k context windows, using a 3-stage pipeline that includes DCP, summarization, and extraction strategies. Benchmarks show 110k tokens compressed to 12k with 8/8 reading comprehension accuracy.

Claude Code Rebuilt a SaaS Onboarding Flow in 6 Hours vs Developer's 3-Week Quote, Boosting Activation 13 Points
A SaaS founder used Claude Code to rebuild their entire onboarding flow (signup → profile → first invoice → dashboard tutorial) in 6 hours, replacing a developer's $4,500, 3-week estimate. Activation rate improved 13 points from 35% to 48%.

FlowBoard v5: The Project Workspace Your AI Agents Actually Run
FlowBoard v5 is a React-based project workspace for AI agents. It includes an event-sourced task store (SQLite), multi-agent support, idea-to-specs loop, and modular overview widgets.