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

WinRemote MCP: Open Source MCP Server for Full Control of Windows Desktops
WinRemote MCP provides AI agents with full control over Windows desktops, allowing for UI detection, file operations, registry access, and more, utilizing over 40 tools.

Four ClawHub Skills for Real-Time Search Data in AI Agents
Four ClawHub skills provide structured search capabilities for AI agents: Google (web, news, images, maps), Amazon (product search across 12 marketplaces), Walmart (product search with delivery filters), and YouTube (video search with transcripts). Install via clawhub install commands with one API key.

Comparing Local vs. Cloud AI Agents: OpenClaw and Twin.so
OpenClaw is an open-source local AI agent that runs on your machine with full data control, while Twin.so is a cloud-based platform with 200,000+ community-built agents for 24/7 automation.

ETL-D MCP Server: Deterministic CSV Parsing for Claude to Prevent Financial Hallucinations
A developer built ETL-D, an open-source MCP server for Claude Desktop that processes CSVs in three deterministic layers to prevent decimal point hallucinations in financial data. It uses Python parsers for known formats, achieves ~70ms response times with 0 LLM calls for 200 parallel requests, and only uses LLMs as a fallback for high-entropy text.